Physics Engine Woes - Part 1
When we started the programing for this project we split up the first tasks between Riscvul and Myself (CornDog). Riscvul was assigned, among other things, the set up of the menu system and the state machine. I was assigned the job of figuring out how to do the character movement and animation. as well as physical interaction with the world. as this was the case I found it needful to learn how to use our chosen API's. and the first step: Setting it up to work with the current version of our test game.
There seems to be a funny trend in the world of physics engines. A SERIOUS lack of good documentation. or at the very least UP-TO-DATE documentation. As I was digging through forum posts and Blog entries to try and peace together how exactly to go about implementing Farseer, I was surprised to find that most references to what I was looking for left some very large holes in my understanding. So after spending several days searching I finally found something that helped me get it working.
So I post this information here in hopes that it will help some poor programmer who finds himself in my position.
I finally found the answer here: http://www.flatredball.com/frb/docs/index.php?title=FlatRedBallXna:Tutorials:Farseer
The code listed there is a bit out of date. when Farseer was updated to version 3.0 they changed how some of the basic things were done. A summery of the instructions are found below:
Farseer can be found at the following address:
http://www.codeplex.com/FarseerPhysics
Perform the following steps to prepare using Farseer:
- Click on the "Downloads" link on the page posted above.
- Select the appropriate library. For this sample, I clicked on the "Farseer Physics 2.0.1 XNA" link.
- Download the .zip file somewhere on your computer.
- Unzip the newly-downloaded zip file.
The unzipped file contains the necessary .cs files as well as the project file which you can add to your game's solution.
Assuming you have an already-created project that links to FlatRedBall, perform the following steps to add Farseer:
- Right click on the solution name in the Solution Explorer
- Select Add->Existing Project...
- Navigate to the location where you unzipped the Farseer zip file.
- Select the project file (FarseerPhysics.csproj) and click the "Open" button.
- Right-click the "References" folder under your game project.
- Select "Add Reference..."
- Select the "Projects" tab.
- Select "FarseerPhysics" and click the "OK" button.
Rebuild to make sure that everything is set up correctly.
I am not including the Code in this post because I myself am still getting acquainted with the changes that have been made in the 3.0 update. but it seems like they have made things a fair bit simpler to use. I intend to post some code samples in Part 3 but for now this will get Farseer set up in Visual Studio.
What is in store for Part 2 you ask? well, I will awe you all with my knowledge of how to set up the Farseer Debug View which allows you to see all the physics bodies and the data produced by their interactions.
"But CornDog, When will you post this delicious bit of information?!" you say. my answer? just as soon As I know how to do it myself.
CornDog
PS. Some of you may be wondering what was up with the funny names mentioned earlier in the post. We have decided to use our gaming handles instead of our names on here. This is mostly to protect our identity but also so that we don't need to live in constant fear of being mobbed by hordes of our fans. :P


