scp-fs2open / fs2open.github.com

Origin Repository for SCP FreeSpace 2 Open
https://www.hard-light.net/
Other
406 stars 162 forks source link

$Collision LOD: in ships table too narrow #4112

Open EatThePath opened 2 years ago

EatThePath commented 2 years ago

I'm not sure if this is a bug or a misfeature, the documentation on the wiki confuses me.

I have the GTD Erebus pof from blue planet.

Detail0 is the whole ship, while Detail1 is only the front half. If I put $Collision LOD: 1 in it's table file, then the turrets all receive collisions properly still, the front of the ship does, but the back doesn't. I've tried a few different names to give the hull_back1 object as the wiki documentation seems to suggest that might potentially help, and even tried some instances of renaming subobjects of detail0 to trick it into working, with no luck.

To save anyone curious the navigation, here's what the wiki currently says about this:

This works as follows: collision detection proceeds normally through the various model/submodel radius and bounding box checks based on LOD0, but when the game decides to perform a mesh-based collision check of a given submodel, it will use the submodel's LOD mesh instead. However, all submodels do not need to have a counterpart in the given LOD; if one is not found, the closest alternative will automatically be used instead. For example, if $Collision LOD: 3 is used and the submodel engine01a is checked for a hit, the game will attempt to use the mesh of engine01d instead. However, if there is no engine01d submodel, the game will find the closest alternative: it'll look for engine01c, then engine01b, and finally fall back to engine01a. Note the implications of for example the root LOD submodel (detaild, detail3, etc) including the geometry of subsystem submodels; if detail0 is checked for a collision before engine01a, and detail3 includes the engine geometry (as opposed to having it in engine01d), then the subsystem engine01a cannot be hit.

Is simply making everything in the specified detail level collidable an intractable issue? I don't know enough yet about pof loading and collision detection to be able to say myself.

JohnAFernandez commented 1 year ago

This seems like a bug. Perhaps someone naively set it to just detail1 and its turrets instead of all the subobjects. I don't believe this is how it should be set up.