On Alien rescue mission on aliens turn popper explode near group of my agents and one agent dies. Their body and equipment falls into a hole in the floor. This rises an error message dialog: "Wrong tile...". After select OK option game crashed.
I saw interpretation of this issue in one of @Quickmind01 videos.
gdb logs attached:
gdb_log.txt
Robust code should set invalid values to some default, something like pos.z = max(pos.z, 1) but maybe that would be just band-aiding poor map decisions.
Is it possible to have a check for every object where if it's detected to be below the bottom level of the map, the object is then set to the floor level with gravity turned off?
I generally don't want to "silently clamp" values as that just makes errors easier to miss - better to fix it properly and not try to spawn stuff outside the map in the first place, and instead fail loudly (IE the error message) to try to make it easier to fix.
I generally don't want to "silently clamp" values as that just makes errors easier to miss - better to fix it properly and not try to spawn stuff outside the map in the first place, and instead fail loudly (IE the error message) to try to make it easier to fix.
That would be such an easy bandaid that I figured there was a reason. What about automatically making the lower and side boundaries of the current map impenetrable? In the original game you can carve out tunnels into the terrain, but you cannot blast through the bottom layer, or the sides.
It should already mark the very bottom layer as immortal - but some parts of this are a bit spidery and end up having multiple paths where objects can be "destroyed" or move/fall, so it's likely some things fall through the gaps.
It sounds like the code that you are having to work with doesn't follow strict object-oriented guidelines.
Nothing "object oriented" about having a good design with Don't Repeat Yourself and other "good" design principles :)
But yeah, there's a LOT of cleanup possible in the design and implementation of a lot of this - a good portion of that is it was written concurrently with the behavior being reverse engineered, so a consistent upfront design simply wasn't possible, as we didn't know what the results should be.