1

Is it some design pattern exist, which can be helpful in designing client server real time physics simulation, which demands some specific need in design(logic/code decoupling) because of network formalities like :

  • drawing on the client, not sending much data on wires and main simulation logic (engine) on server

  • half of the object code on server and half on client (the changing part) to draw

  • sending only part of objects(attributes) which are changing constantly

any suggestion as far as implementtion is concerned with Javanio will be really appreciated.

thanks,

jibbylala

P.S: i saw lot of articles and discussion and pseudo codes, how decoupling can be achieved but didn't find any particular simple compact implementation.

static void main
  • 728
  • 2
  • 9
  • 34

1 Answers1

2

I highly recommend reading Glenn Fiedler's article on this subject.

Real-time server-client networked physics is a challenging problem due to the constraints of bandwidth and latency. In order to alleviate these problems, most networked simulations rely on clients only sending input to the server, with the server only sending back differences between framestates. Along with this, the client can predict the server's world-state using client-side prediction. Unfortunately, this model is imperfect due to the fact that interactions between multiple client's actions can create discrepancies in the client-side prediction. However, dealing with these discrepancies is another part of the problem you have to solve...

epaik
  • 235
  • 2
  • 5