Bug 5040 - high-precision buildable placement
Status: NEW
Alias: None
Product: Tremulous
Classification: Unclassified
Component: Misc
Version: SVN HEAD
Hardware: All All
: P3 normal
Assignee: Tim Angus
QA Contact: Tremulous Bugs
URL:
Depends on: 5000 5039
Blocks: 4725
 
Reported: 2011-06-14 03:27 EDT by /dev/humancontroller
Modified: 2011-06-14 05:04:40 EDT
0 users

See Also:


Attachments
high-precision buildable placement (7.47 KB, patch)
2011-06-14 03:28 EDT, /dev/humancontroller

Description /dev/humancontroller 2011-06-14 03:27:09 EDT
high-precision building should greatly help the issues in bug 4725.

when buildables are built, they are placed a bit above the ground, and then "gently" nudged down for whatever reason. however, due to the bouncy physics of the buildables, the buildables bounce up even higher, and stop up there for some reason. perhaps the nudging was supposed to align the buildable's bottom with the floor, while guaranteeing that buildables don't meld into the ground.

an explanation to why displace-and-nudge should not be required to avoid objects "melding": in my testing, traces stop approximately 0.125 qunits before a "wall"; the distance can be a bit more or less than 0.125, due to floating point imprecision, but if the (next) trace is started from closer than 0.125 qunits, then it will not end closer. this should be an understandable engine feature to handle floating point imprecision. that's the theory.

the most obvious additional benefit of the precise buildable placement is that it's likely to cease all cases of alien buildables falling off the ceiling due to some amount of imprecision. furthermore, the withdrawal of buildable displacement during layout loading can decrease the number of cases of saved buildables failing to load due to startsolid errors.
Comment 1 /dev/humancontroller 2011-06-14 03:28:28 EDT
Created attachment 2778 [details]
high-precision buildable placement

taking the above in mind, i have modified the code precisely place the buildable at the end of the primary trace, and keep the buildable stationed there. G_CanBuild() now offers to return the number of the ground entity on which the buildable was placed; the buildable placement functions pass that number to G_Build(). in G_Build(), it is assumed that if a ground entity is specified (ie., if the number is not ENTITYNUM_NONE), then the buildable can stably rest on the surface, and so is stationed there. buildable displacement is also removed, as it is deemed unnecessary.
Comment 2 /dev/humancontroller 2011-06-14 04:54:45 EDT
attachment 2779 [details] of bug 5000 should be applied prior to above patch, to avoid a compiler warning.
the above patch depends on the patch in bug 5039.
Comment 3 /dev/humancontroller 2011-06-14 05:04:40 EDT
the patch needs testing btw