This project has moved and is read-only. For the latest updates, please go here.

Farseer engine based XNA game - Gerbil Physics

Dec 10, 2009 at 8:04 PM

In case anyone is interested, the recently released Indie Game Gerbil Physics uses Farseer, in fact the entire premise of the game is built around the engine.  Its all about blowing up buildings made of Gerbils. 

Thanks to all in the forums for your help.

A bit of background:  I used Gleed2d for the level design, Mercury for the particles and SAT for the narrow phase collisions and found performance on the Xbox to be just fine.  There are never that many gerbils around at once though :)

(I hope its ok to post this in this forum, I don't mean to be inappropriately promoting the game or anything, so feel free to move this post to the showcase or delete it this isnt the right place for it, thanks :))

Dec 10, 2009 at 9:48 PM

Looks very nice, I love the Gerbils faces :)

You are using exactly the same tools and configurations as I do:
Farseer + Mercury + Gleed2d and SAT :)


Dec 11, 2009 at 2:17 AM

Hey guys,

I am really happy to hear that SAT is working for you. I am finally getting back to programming after one of the most stressful summers of my life. Hopefully me and Ian can get working on Farseer 3.0.

Dec 16, 2009 at 1:55 AM
Edited Dec 16, 2009 at 1:56 AM

I just checked out Gerbil Physics, it's fantastic!  I'm building a game that also involves stacks of blocks.  I actually found this post while looking for a solution to a problem I'm having with SAT, so hopefully it's cool to reply to this thread (I'm wondering if maybe you encountered a similar issue when making GP).

The game I'm working on involves large numbers of rectangle geometries.  I'm using CreateSimpleRectangle and SAT.  When I stack rectangles atop one another, I'm able to get stable structures up to a certain point, but with more than 4 or 5 geos in a stack, I start getting random collisions and every geo starts to vibrate until it finds a settling point.  I was able to get stable structures with DistanceGrid and a high number of PhysicsSimulator Iterations, but this puts a pretty strict limit on the number of bodies I can have onscreen. 

Hopefully my description made sense, but have you run into this with GP?


Dec 17, 2009 at 4:35 PM

Hi CosbyTron, yes I ran into similar issues with GP, and I didn't find a generic solution.  I did learn this:

  • Some structures are more stable than others: pyramids are good, placing very heavy blocks on top of light blocks is bad
  • One thing that helped a lot was putting some weak pins in the lowest level blocks.  That seemed to give a lot of extra stability for any constructions above.
  • Make sure you're using the very latest change set, as I believe SAT had fixes applied to it.
  • Fiddle about with the simulator settings, which it sounds like your doing already: iterations, allowedpenetration, maxcontactstodetect, maxcontactstoresolve etc.  I settled on 10 iterations, 0.1 penetration, 4 contacts to detect, 2 to resolve.

Hope that helps.

Dec 19, 2009 at 4:58 AM

Thanks for the tips, Beringela.  I'll definitely give them a shot (I hadn't thought of using weak pins to help hold things together).  I haven't tried messing with the MaxContacts at all, so it should be interesting to see how that affects things.  If I learn anything useful along the way, I'll be sure to share :-)  Congrats again on GP!!