Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (753)
Games in Android Showcase (228)
games submitted by our members
Games in WIP (842)
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 3040 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: 485
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  

nelsongames (14 views)
2018-04-24 18:15:36

nelsongames (11 views)
2018-04-24 18:14:32

ivj94 (587 views)
2018-03-24 14:47:39

ivj94 (49 views)
2018-03-24 14:46:31

ivj94 (383 views)
2018-03-24 14:43:53

Solater (64 views)
2018-03-17 05:04:08

nelsongames (110 views)
2018-03-05 17:56:34

Gornova (159 views)
2018-03-02 22:15:33

buddyBro (707 views)
2018-02-28 16:59:18

buddyBro (93 views)
2018-02-28 16:45:17
Java Gaming Resources
by philfrei
2017-12-05 19:38:37

Java Gaming Resources
by philfrei
2017-12-05 19:37:39

Java Gaming Resources
by philfrei
2017-12-05 19:36:10

Java Gaming Resources
by philfrei
2017-12-05 19:33:10

List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05 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‑
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!