Networking Physics
Posted: Sat Jan 19, 2013 8:32 pm
Before I came to BEPU, I had my own little jerry rigged AABB collision system, since my terrain was composed of blocks.
This was pretty fast, and it made coding an authoritative server a breeze - I could store states, rewind, and replay specific entities at a time. The client would send a packet number along with the timestep (i.e. "16 milliseconds") used for the prediction calculations, and the server would process the individual player's physics with the timestep, and then send back a packet with the packet number and the authoritative position. This pretty much guaranteed that the client and server were always synced (or could "understand" each other with infinite precision) in terms of packet number.
I've read another thread on this forum that asked if processing a single entity is possible with BEPU, but it appears that it's extremely complicated and not feasible.
So how feasible is it to give each Player object on the server their own space? Memory wise, how much space would this take up? My terrain is composed of ~1,000,000 triangles, *3 that gives you 3,000,000 vertices. Since my game is a run-and-shoot-esque FPS, the only really collisions that would occur would be between the players and the terrain.
I've also read online that the physics engines should be run at a fixed timestep - that is to say, you have an accumulator that fits as many dt chunks as possible in the elapsed game time, and saving the remaining fractional dt for the next frame. I don't see how this could help though - wouldn't the lack of processing the fractional dt create occasional jumps in the game, and if a player's computer lagged, wouldn't everything blow up?
Thanks for any help!
This was pretty fast, and it made coding an authoritative server a breeze - I could store states, rewind, and replay specific entities at a time. The client would send a packet number along with the timestep (i.e. "16 milliseconds") used for the prediction calculations, and the server would process the individual player's physics with the timestep, and then send back a packet with the packet number and the authoritative position. This pretty much guaranteed that the client and server were always synced (or could "understand" each other with infinite precision) in terms of packet number.
I've read another thread on this forum that asked if processing a single entity is possible with BEPU, but it appears that it's extremely complicated and not feasible.
So how feasible is it to give each Player object on the server their own space? Memory wise, how much space would this take up? My terrain is composed of ~1,000,000 triangles, *3 that gives you 3,000,000 vertices. Since my game is a run-and-shoot-esque FPS, the only really collisions that would occur would be between the players and the terrain.
I've also read online that the physics engines should be run at a fixed timestep - that is to say, you have an accumulator that fits as many dt chunks as possible in the elapsed game time, and saving the remaining fractional dt for the next frame. I don't see how this could help though - wouldn't the lack of processing the fractional dt create occasional jumps in the game, and if a player's computer lagged, wouldn't everything blow up?
Thanks for any help!