Tuesday, April 27, 2010

Vehicles and Physics

I've added the Farseer Physics Engine to our game. I have to say, it's very impressive and a lot of fun to play with. I spent hours tweaking various physics values and trying different functionality. For now, my goal was to get the engine integrated into our game and create a vehicle that can ride around our maps with a mounted turret gun that fires. To do this, I first had to make our map ledges "collidable" with Farseer's Physics Simulator. I changed the map loading routine to automatically create polygon "Geoms" with which objects can collide with when creating the ledges. Then, I went to work with building a prototype vehicle that I (very) roughly modeled after the Warthog from the Halo series. One interesting thing I discovered during this whole process is that most popular platformers don't actually use realistic physics like this. It makes the character difficult to control and the movement just doesn't feel "right" for a human (or human like being). For this reason, I decided to keep the original, simple, physics system I already had developed and include Farseer as an additional physics system to use only for specific entities that require more complex and realistic physics such as vehicles and grenades. Because we don't have art yet for sloped ground or any vehicles, I just draw simple shapes to demonstrate the physics and vehicle.



No comments:

Post a Comment