Client vs Server, World partitioning

sipickles
Posts: 44
Joined: Thu Aug 07, 2008 6:57 am

Client vs Server, World partitioning

Post by sipickles »

Hi!

My game only had a simple hand built movement system up until now, with very crude AABB collision detection. I am currently upgrading to Bullet, and like what I see so far.

My question is how to use Bullet in a large play area, and how to divide the processing between client and server.

Firstly, a little about my game structure.

Server - Play area is divided into discrete zones. Clients receive updates and object info from current and neighbouring zones.

Client - No awareness of zones, just a 3x3zone sized world with the client at centre. Objects are created and destroyed by the client on the instructions of the server when they cross a zone boundary.

Here are my options as I see them, to integrate a bullet world with this model:

Option 1 - Server runs multiple BulletDiscreteWorlds, one for each zone, or one world and objects are subdivided by group. RigidBodyObjects are held in each BDWorld and 'ghosted' in neighbouring zones allowing boundary collisions. Client receives all collision events and position data from server. Verdict: Laggy, but accurate.

Option 2 - Client runs a single BulletDiscreteWorld centred around player performing movement and collisions locally. Server validates movement and overrides if necessary. Verdict - Unsecure, problem of divergence between clients.

Option 3 - Server runs BulletDynamicWorlds as in Option 1, but with fast crude algorithms. Client also runs bullet as in Option 2, performing detail of physics and collisions. Client is overridden by server and deviation is smoothly blended out.

Option 4 - As option 3, but both client and server run identical physics, server overrides client, client runs a subset of server world.

I'd love to hear your ideas on this subject. Perhaps I am looking at this all wrong.

Bullet Docs mention not making a world bigger than say 5000 units, to maintain accuracy. Hence my approach to sectorize the world.

I should also mention, I am not looking for per poly collisions, its a vehicle game too.

Thanks

Simon
Wavesonics
Posts: 71
Joined: Thu May 22, 2008 8:03 pm

Re: Client vs Server, World partitioning

Post by Wavesonics »

Well in all of these options the underlying problem is of course, the synchronization of client and server as they will inevitably fall out of coherency due to differing floating point calculation errors.

There is a good thread here:
http://www.bulletphysics.com/Bullet/php ... rver#p9315

Which has some good discussion and good links on the topic.

Once/If you solve this problem, the next step would be to base your divisioning scheme around this solution I would think.

Btw if you do solve the client/server simulation synchronization problem effectively I as well as many others here im sure would be very interested in your solution. This is currently a very pressing issue in game programming.