I was hoping to have an update a little earlier than this, but decided to hold off and throw together at least a bit of content with the update. I’ve added a slew of joints and controllers into the Farseer engine for Blitzmax (which I think I’ll just start referring to as just Farseer.BMX to save my poor little fingers). Below is a list of stuff I’ve added since the initial post:

  • Angle Limit Joints (featured in the youtube video below) – this allows you to do some interesting joint behaviors that could potentially allow you to create a 2D ragdoll of sorts with limb constraints.
  • Fixed Angle Limit Joints – Same as above except instead of linking two objects together, only one is used and it’s angle is limited.
  • Fixed Angle Joints – Allows you to make an object always point in a certain direction. You can think of it as a way to disable ‘rotation’ for a particular object, and it will always be set at some angle from some anchor regardless of where it is in the world.
  • Angle Springs – You can link two bodies and they will attempt to align themselves to a certain angle using spring physics to give a bouncy effect.
  • Interactive Angle Joints (untested)
  • Circular Interpolator (untested)
  • Pin Joint – This one allows you to choose an anchor on two bodies and a distance, and the two physics bodies will always stay that distance apart, but still tumble and interact with other bodies realistically.
  • Slider Joint – Same concept as a ‘Pin Joint’ except now instead of a concrete distance apart there is a minimum distance and a maximum distance these two objects will stay within.
  • Brute Force Collider – Just another broad phase collider you can use instead of the default one. I may dig up a forum post by Jeff and others that describes the advantages/disadvantages among the different colliders you can choose from in Farseer.
  • Some getters/setters for the physics debug viewer class – Makes the debugger class a little easier to use.
  • Fixed a few minor bugs

Anyway, the video I posted isn’t that impressive but shows you that Farseer makes it pretty easy to setup different types of constraints and scenarios with just a few classes. There’s no new demo application to download for this update as I’m pretty close to finishing up the rest of the port, and would rather just wrap up a few more demos and get the code out there for others to use. Hopefully I’ll have more in a week or so!

Hurray! Finially got to a stable stopping point in porting over Farseer Physics from C# on XNA to Blitzmax! Farseer Physics Engine is a 2D physics engine originally written by Jeff Weber who develops XNA/Silverlight games over at Farseer Games. Much thanks to him for creating a great physics engine and for allowing me to move it to another language, which once done, I hope will help others create fun physics games in Blitzmax.

I’ve ported the ‘core’ features of the engine which now would allow you to use the basic features of the engine. If you head over to the Codeplex Farseer Physics Page you’ll see a list of the features in the C# version of the engine. Right now the things that aren’t implemented in the Blitzmax version:

  1. Fluid Drag and Buoyancy Controller.
  2. Slider (Prismatic) Joint
  3. Pin (Distance) Joint
  4. Broadphase Colliders: SweepAndPrune, BruteForce
  5. Collision Callback Mechanism

Currently, the Blitzmax version is using the ‘SelectiveSweep’ Broadphase collider that is the default collider in Farseer, and is supposed to have the best performance in a wider range of scenarios. The others have their advantages and disadvantages based on specific situations in the physics environment. I’ll be implementing those as well along with the rest of the list, but they weren’t used in the current build of the C# Farseer demo application so I chose to focus on the needed classes first to get an identical demo app running in Blitzmax.

Just some metrics you may find interesting (as I’ve noticed typical Blitzmax users have a very different way of developing their games):

84 .bmx files used for the physics engine and the demo application
7957 lines of code (blank lines not included)

Sounds like it may be a lot, but in reality it really isn’t much compared to a full relatively complex commercial Casual, Indie, or AAA game. But the reason I put that up there is to illustrate a point. I feel like if I was using the default Blitzmax IDE I would’ve have one hell of a nightmare just handling these little files. Having a project of a much bigger scale in BlitzPlus in the past, I know from experience the headaches of a large monolithic code base. You spend a lot of time scrolling and searching through files because the IDE promotes that type of behavior from the get go. Using BLIde, a very flexible editor created by Manel Ibáñez, productivity went way up and I was able to get more done on the physics engine. Not to mention built in Intellisense support is a god-send, which lets you spend more time coding instead of reading API docs. Just that feature alone I think is enough to abandon the default IDE and stick to BLIde. Anyway, if you’re a Blitzmax user I highly recommend that you take the time to learn to use BLIde and support Manel’s efforts for an outstanding product!

I’ve uploaded a demo video showcasing the same demos available in C# running in Blitzmax. I also added a new and original demo by me showing the use of concave polygons, which is one feature many 2D physics libraries lack. With other physics engines you can emulate concave shapes by putting together a bunch of convex ones, but it’s still a cumbersome and tedious task. The ability to create concave shapes with minimal hassle is a great productivity boost for content creation in your game. Below is a video of the physics demo app, along with a download link to the demo app itself so you can run it on your own PC. Hope to have more info posted with updates in the coming weeks!

To download the demo application shown in the above video click below:

Download Farseer Physics Demo


– Windows XP/Vista
– Direct X 7 or higher capable video card
– Minimum supported screen resolution: 1024 X 768

Known Issues:

– In Vista the fps are lower (and in some demos locked to 60 instead of 100 fps).