Sunday, April 1, 2012

Why not use a physics engine?

I asked myself...if I was using a physics engine (3d of course), I wouldn't have had to deal with keeping the dozer 'aligned' with the slope of the ground...or manually twisting/rotating trees to make them fall.   On the other hand, those activities were minimal amounts of code (maybe 20 lines total)....and they are fairly good 'simulations' of the end goal.
There are plenty of javascript 3d physics engines out there:

I've had plenty of experience with physics engines..specifically box2d and phys2d (java ports) for my DemolitionFX game.  They are very easy to use and un-intrusive.  Performance (with lots of objects) becomes the only big issue.  If I am to keep my end resulting game in javascript, I need all the performance I can get.  I don't intend to have a LOT of objects..but I dont think even the slight overhead of a physics engine is needed for my type of game.   

If I was coding this in the Unity engine (targeting IOS or PC), I might start off with a physics engine day-one with the tree and dozer models effected by gravity and shearing and other forces (and without a doubt, a proper physics/fluid engine will help me if I proceed with adding water elements to the game)

For mow, I'll do without.



No comments:

Post a Comment