4
\$\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\$
5
  • 1
    \$\begingroup\$ What type of game is this? How many players? \$\endgroup\$ Mar 28, 2012 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, 2012 at 23:05
  • 1
    \$\begingroup\$ You might want to edit your comment into the question/title... \$\endgroup\$ Mar 28, 2012 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\$
    – House
    Mar 28, 2012 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, 2012 at 0:22

1 Answer 1

4
\$\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\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .