Jump to content

  • Log In with Google      Sign In   
  • Create Account

Vaclav

Member Since 19 Jul 2012
Offline Last Active Sep 30 2013 07:09 PM

Posts I've Made

In Topic: Chain of Events

11 June 2013 - 01:41 PM

I like it very much. Though killing your father sounds too harsh to me.

Can you tell more about the game?

 


In Topic: SDL_net get MAC address from socket

14 May 2013 - 12:11 PM

Oh thank you, you're absolutely right!


In Topic: Which physics library can also step backwards in time?

19 December 2012 - 10:31 AM

Well what I want to do is like a multiplayer racing game over network, so something with physics over network.
I have read some articles about it, here is what I think how it would work:
Say I have a client and a server. I measure the latency between them, one direction it's ping/2. Let's say ping is 200 ms, so one way latency is 100 ms.
The physics simulations runs on the server, but the client also tries to approximate it. If the client gets an input for example to move, sends it to the server that it wants to move. Then the server has to roll back time of the physics with 100 ms, because the action of the client happened at that time. Then apply the action, and go forward with time 100 ms again.
The server sends the actual positions and velocities let's say 10 times a second. When the client receives positions, the ones it got are the positions reflecting the physics state 100 ms earlier, so the client sets those positions and velocities and advances time by 100 ms.

For this, restarting the simulation every time when teleporting objects, would be too often to do. I'm going to use Box2D. I don't know if you have problems with collisions when setting the new positions and velocities.
So is it correct what I think of? Or do I make it overcomplicated?

In Topic: Which physics library can also step backwards in time?

18 December 2012 - 08:54 AM

Thank you for your reply.

b)Save snapshots at some interval, then either interpolate or simulate forward/backward from closest point (whichever works the best)

So I'm going to do this. Set the position, rotation, velocity and angular velocity at the earlier of the two frames next to the desired time. Then advance physics by the difference between the desired time and the frame time.
This should be better than interpolating between two frames myself, because a collision might happen in the meantime.

In Topic: [SDL] Pixel access segfault

04 September 2012 - 01:56 AM

Yes, I'm sure because exactly the same code works for 32 bit surfaces. If would try to access with invalid parameters, it would cause segfault for 32 bit surafces as well.

PARTNERS