3
\$\begingroup\$

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?

\$\endgroup\$
  • 1
    \$\begingroup\$ What type of game is this? How many players? \$\endgroup\$ – XiaoChuan Yu Mar 28 '12 at 22:58
  • \$\begingroup\$ 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. \$\endgroup\$ – MaiaVictor Mar 28 '12 at 23:05
  • 1
    \$\begingroup\$ You might want to edit your comment into the question/title... \$\endgroup\$ – XiaoChuan Yu Mar 28 '12 at 23:12
  • \$\begingroup\$ 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. \$\endgroup\$ – MichaelHouse Mar 28 '12 at 23:17
  • \$\begingroup\$ 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. \$\endgroup\$ – MaiaVictor Mar 29 '12 at 0:22
3
\$\begingroup\$

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.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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