April 3, 2015

Mass Aggregate Physis (Game Physics)


For this Game Physics project I confronted a mass aggregate-style physics simulation, attempting to get basic shapes and motion from rod and cable constraints.  For various reasons this didn't turn out as expected.

Debugging mass aggregate systems can be time-consuming and challenging, particularly when the issues only show up at scale.  One physics rod may correctly resolve two linked particles, but what if there are four inter-dependent rods connecting a pyramid?  I pored over my contact resolution algorithm many different times, spotting no differences between my code and the provided code, yet something was clearly wrong.  Shapes would collapse upon themselves or, worse, explode outward.  Eventually, I managed to resolve the issues, though more through brute force than anything else.  Given more time, I would like to figure out exactly where my original simulation went wrong.

The project also took longer than it should to complete.  I underestimated how long debugging the simulation could take.  After all, the algorithms are pretty simple and laid out for us in the course material - I only have to implement them, quickly test them, and get the gameplay working.  Easy, right?  This didn't hold true, and I spend too much time at the end attempting to fix basic physics issues.  The physics work, but performance could be improved.  Additionally, this cut time from being able to improve the presentation of the simulation by, say, rendering lines for each physics rod in the scene.

No comments: