Högni and Amy's game project

Thought in deed

What is the best way to run physics on a client server architecture….

leave a comment »

Do I run updates from the server into keyframed objects on the client?

Do I run updates from the client into keyframed objects on the server… The problem as far as I can tell with keyframed objects is that they have infinite mass when other things collide with them, and thus when client actors run into them on the client side they would have no effect on them, while the client actor would stop dead and/or be moved by them..

The solution thus seems to be that the client actor only creates local copies of static objects, e.g. terrain and static containers etc, that are keyframed during animations… That seems somewhat limiting though, as keyframed animated containers would need keyframe definition files… that might be possible without too much problems perhaps… So the sequence might go like, client has static geometry and a character controller. The character controller is replicated to the server as a keyframed mesh and thereby affect the environment with infinite force, but the client only receives position updates for world objects for use in graphical form with no physical manifestation.

It’s obvious from experimentation that the character controllers can’t reside on the server, the jerkiness would drive local server players nuts in short order, but they have to affect the environment in some way…. I should continue that way, basically having the client take care of the movement of the character, and sending position updates to the server each frame, keeping the server completely and absolutely separate even when running as a separate thread in the same application instance.

Blocking calls from the client stopping the server is not acceptable. I guess I could let the server run and wait for each frame to finish, locking the client meanwhile, but no, that’s not acceptable really… Should it send velocity updates? Good question, I might as well, an additional vector is not really a great deal of extra bandwidth but I don’t see what the server is gonna do with it really.. It doesn’t seem to make sense really, as the server will check each update the last position of the character and calculate velocity from that. It might prevent the shit from flying around if the character misses a few frames and suddenly updates and gets a huge velocity, but that should be solved from timestamps on the last updated time thing I’ll have put on the server side character tracking information struct in any case.

I guess I’ll go whatever way I go.


Written by Högni Gylfason

17.07.09 at 18:54

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: