Java-Gaming.org Hi !
Featured games (88)
games approved by the League of Dukes
Games in Showcase (681)
Games in Android Showcase (196)
games submitted by our members
Games in WIP (745)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  libGDX / Box2D multiplayer implementation  (Read 1871 times)
0 Members and 1 Guest are viewing this topic.
Offline Herjan
« Posted 2014-06-02 08:34:22 »

Hi there,

First let me explain the game I'm currently working on real quick:
I'm working on a top-down shooter for mobile phones (they are quite rare), but also with vehicles (tanks/cars etc. that's why I use Box2D (and because its so much fun Grin )).
Well, lets say that there are 20 players and 20 vehicles in the game, which makes 40 Body's total.
I think it is the smartest to just let the client send his input to the server, and the server sends that input to all clients, and it simulates it himself as well.

Why simulate it as well? Well, because if a new player joins, he needs all Body's (in current state).
Well, supposing that sending 40 Body's won't be a problem (has anybody better ideas, thanks), what do I do to keep all clients synchronized?
Sending input to all clients sounds fine to me, but what if a client has lagg and gets one packet 5 seconds later (which messes up his whole game).

Maybe there is some way to check if a client had 2+ seconds delay and if it had, 'refresh' the game??? I hope this doesn't overload the server?

Edit: Asynchronous clients (with Box2D) is inevitable? I think the best option I have then is simulating the game on the server and sending the positions to all clients via UDP Smiley funfun
Offline BurntPizza

« JGO Bitwise Duke »


Medals: 482
Exp: 7 years



« Reply #1 - Posted 2014-06-03 05:19:28 »

Glenn Fiedler's blog contains what continues to be one of the best blog series on game networking I have seen. Take a look, he talks about all these issues and what is usually done to work with them.
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 
CopyableCougar4 (61 views)
2016-06-25 16:56:52

Hydroque (93 views)
2016-06-22 02:17:53

SwampChicken (96 views)
2016-06-20 13:22:57

SwampChicken (99 views)
2016-06-20 13:22:49

SwampChicken (91 views)
2016-06-20 13:22:26

Hydroque (137 views)
2016-06-15 08:22:50

Hydroque (132 views)
2016-06-13 06:40:55

DarkCart (245 views)
2016-05-29 02:30:33

Hydroque (212 views)
2016-05-26 14:45:46

Mac70 (196 views)
2016-05-24 21:16:33
Making a Dynamic Plugin System
by Hydroque
2016-06-25 00:13:25

Java Data structures
by BinaryMonkL
2016-06-13 21:22:09

Java Data structures
by BinaryMonkL
2016-06-13 21:20:42

FPS Camera Tutorial
by Hydroque
2016-05-22 05:40:58

Website offering 3D Models specifically for games for free
by vusman
2016-05-18 17:23:09

Website offering 3D Models specifically for games for free
by vusman
2016-05-09 08:50:56

Website offering 3D Models specifically for games for free
by vusman
2016-05-06 11:10:21

Website offering 3D Models specifically for games for free
by vusman
2016-04-29 12:56:17
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!