Talk:Exploiting Collision Detection

From UFOpaedia
Jump to navigation Jump to search

I have a question regarding collision detection. Can a walking soldier move off a ledge where there is a soldier or hwp beneath it? If yes, then what happens? a) Do they occupy the same space? b) The soldier lands on top of the unit? c) Something else?

The idea is to use a hovertank as a platform to transport troops to the top of a ufo. Anyone tested this before?


It would be A.Units cannot stand on top of other units, they would just fall into the same tile as the unit directly under it. - NKF 22:42, 29 July 2008 (PDT)


In that case, would it be possible to write a utility that does collision-checking for falling units, as in a lot of cases it could be potentially screwy (e.g. what happens when a Chryssalid falls inside a tank, etc). Something simple like adding conditional checks to determine if there is a unit under an area or above a unit (the latter case would be if the bottom unit moved)? MagicJuggler 07:03, 30 July 2008 (PDT)


To make it work "correctly", a check would need to be done when the above unit attempted to step forward (to see if a) there was a drop in front of it b) which map levels the unit would fall through c) if any of those levels contained another unit). If it's determined that the walker would drop through another unit, then it simply wouldn't be allowed to move. Not sure how "simple" that'd be to code.

Not sure why you'd need to do a check when the bottom unit is moving. If you walk under another unit, that will not cause them to fall down (even if they aren't standing on a floor and don't have the ability to fly (that is, even if they shouldn't be up there in the first place)). The upper unit will only fall to the ground when attempting to step forward, or if he's standing on a floor and that is destroyed.

If you make one unit fall into another by destroying the floor between them, ideally the above unit would "slide off" the one below and end up standing next to it. Again, not sure how simple that would be to code.

Incedently, the game doesn't much care if two units are standing in the same place. It just carries on as usual. Might be a bit self-destructive shooting at an enemy that's standing on your guy, so if you somehow end up in that situation just move your unit out of the way first.

- Bomb Bloke 23:13, 30 July 2008 (PDT)

From a movement perspective, it could be hazardous for a large unit if another large unit falls on top of it. E.g. in the off-chance scenario a reaper or sectopod falls on top of your tank during a Terror Ship assault MagicJuggler 08:50, 31 July 2008 (PDT)