mspraggs / potentia

Southampton Game Jam 2015
0 stars 0 forks source link

Crates intersecting #41

Closed DivFord closed 9 years ago

DivFord commented 9 years ago

On the level where there are crates held up by dirt, when two crates fall at once, the upper one falls halfway through the lower one.

DivFord commented 9 years ago

bug screenshot

Fyll commented 9 years ago

Yeah. This is a nightmare of the collision detection's efficiency. This happens when the block above sees that it's not going to bump into anyone below it, because the block below it still thinks it's falling (it hasn't been collision detected yet). The block below then gets collision detected and stops moving, but it doesn't tell the crate above.

The only realistic solution I can think of is to check every single moving object again, each time any object bumps into another one, as opposed to just checking the blocks involved. Clearly, this is not efficient, but it may be necessary.

EDIT: Actually, having thought about this a bit more, it actually is a bug. The behaviour I described above shouldn't happen. I'll start looking into this.

Fyll commented 9 years ago

Okay. Fixed this. It turns out I just accidentally typed == instead of !=, so it was only checking if stationary objects had collided with anything. >.<