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

Farseer for networked game

Topics: Developer Forum
Dec 3, 2010 at 1:38 PM

Hi everyone,

My name is Ron and me and a friend are developing a small multiplayer racing game, and after examining Farseer it seems like one of the best free 2D physics library and we wanted to perhaps use it for our game.


My question is, how exactly is it recommended to run the game's physics on the server (no visualisation required) and synchronize that data with the client?

We already have a networking layer up and running, and in order to use interpolation/dead reckoning we need to run 1 game instance on the server and 1 game instance per client for interpolation.


In summary:

1. How should the engine run on the engine without any visualization (And on non-XNA project)?

2. If anyone has any experience with this, how should interpolation/dead reckoning be implemented on the client side?


Thank you,

Ron Rejwan

Dec 4, 2010 at 2:25 AM
Edited Dec 4, 2010 at 2:26 AM

Glen Fiedler has some interesting info on this subject. You might also want to search the Box2D forums as they have quite a lot of questions like this and proposals on how it can be implemented.

Dec 4, 2010 at 11:05 AM

I'm already read Glenn Fiedler's blog and it's terrific - however, I was hoping to get some real code samples detailing Farseer.

Especially how to use Farseer in a non-visualized, non-XNA project.


Help anyone?

Dec 4, 2010 at 3:41 PM

Well Farseer comes with a class library that allows any C# platform. As for not visualizing anything that is a simple as not drawing anything.

Are you targeting Windows?

If so and if I was you I would write a server app that runs the simulation and could be considered the leader, all clients would simply receive packets describing position, rotation, and relevant velocities of each object for rendering. With a good connection and interpolation you should be able to get fairly decent results with a decent sized world.

If Xbox?

Then one player will become the server, all players will feed of the servers simulation. This means your game would need two versions built in.

Dec 4, 2010 at 4:03 PM

We are targeting for windows for our proof of concept, maybe in the future an XBOX game, but for now we're focusing on Windows.

OK so I understand the basic principal of game network programming & design, question is - what classes should I use with Farseer (as I don't have too much experience with it).

Dec 5, 2010 at 12:59 PM



Anyone knows which Farseer classes I should use in order to simulate server physics non-visually (and non XNA)?