Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

The game consists of a world with just one force, gravity. All the players can do is jump and set their velocities with arrow keys. Physical AABBs and sphere's are used for collision.

What is the best method to serve this game on websockets? Dead-reckoning? Sending positions only for play back?

share|improve this question
1  
What type of game is this? How many players? –  XiaoChuan Yu Mar 28 '12 at 22:58
    
The game consists of a world with just one force, gravity; physical AABBs and sphere's for collision. All the players can do is jump and set their velocities with arrow keys. I can't say a number of players. It would be favorable if the server could handle as many players as possible. –  Dokkat Mar 28 '12 at 23:05
1  
You might want to edit your comment into the question/title... –  XiaoChuan Yu Mar 28 '12 at 23:12
    
If there were no other forces, the players wouldn't be jumping, changing their velocities or colliding with anything. The first two are the effect of forces, and collision is a force between two objects. –  Byte56 Mar 28 '12 at 23:17
    
Jumping will only set the velocity of the player to a fixed amount on the z axis. Collision will only change the velocity of 2 objects according to equations. Of course those are results of physical forces, but what I meant is that those are not coded, that is, I'm not accelerating the object in the opposite direction of the collision, for example. –  Dokkat Mar 29 '12 at 0:22
add comment

1 Answer

up vote 3 down vote accepted

Refer to this article: http://gafferongames.com/game-physics/networked-physics/

In short:

Physics is run on the server according to a stream of input from clients

This means the actual physics/collision runs on the sever, and client simply sends player input and renders server output to screen. Server continuously broadcasts required rendering information per physics update like object positions.

This is not very simple though several problems/solutions are discussed in the article such as player input lag and choppy client side visuals.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.