Attemt at realtime multiplayer game

If anyone wants to try it
http://nonoba.com/mike950/multiplayer-flippin-hockey
I didn't credit box2d yet until I determine if it's a decent game
or not & most bugs gone. The last thing I'd want is a made with box2d and have people
think it must be a bad lib.
Each client runs the physics so that's the reason for the strange puck
behavior at the opponents end.
mike
Thanks..well you might want to try it before saying it's nice 😉
Some people have really complained about lag making it really ugly to play.

Yes the way the game works allows me to run the simulatation on each
client and when something important happens (puck collides with flipper)
I then attempt to sync up by sending the position & velocity to the opponent.
So I'm not sure running box2d on the server would really get me anywhere but
you're right that would be cool just to say i did it 🙂 And that would help in
other types of games where that method wouldn't fit.
I'm really at the mercy of the nonoba multiplayer api..They control
the server but you can develop c# server code easily and they generally have
a fast system and network to work with.
I'd highly recommend using it if not for anything else to test ideas risk free.
[url]nonoba.com[/url]

edit:
Also keep in mind having Box2d running on the server might be fine for one
or two game instances but imagine if you had 10 or more games
going at once. I haven't tried it but imagine what would happen to
the poor machine with 20 box2d games running at once.
It wouldn't be pretty.
Well, I tried it, and found a player.

But the lag makes this suck, to be brutally honest. I don't know how Nonoba expect anyone to make real time games with a second latency. You are going to have to speak to them.

This is an excellent game idea for testing multiplayer though. The two court halves make it clear which client is the authority, and ensure that there is at some time between an update being sent and the ball reaching my court, so I could still hit the ball despite the latency.

A small suggestion that will improve things slightly. I noticed my ball go through the enemy paddle quite frequently, only to discover he had hit it. That's unavoidable to a certain circumstance, yeah, but you should at least do a local collision of the ball with the enemy paddle, so I don't see anything unphysical in the mean time. It also means the ball will be closer to it's correct position, which is good.

PS: Not that I suggest trying it, but I bet the C++ version of Box2D could chug through 20 games with 10 objects in without much fuss, particularly when it doesn't have to draw them.
Thanks for the observations. It's nice to have technical people playing it since
you don't usually get much useful feedback from the usual gamers there.
Yeah I thought about that also being a great way to try multiplayer.

I did try your idea at first by making the opponent flippers rigid bodies but the problem
I found was the ball would appear to come off the flipper and then back up when it
really hit the flipper (on the opponents machine). So that was just to confusing.

Mike
Entanglar runs a full simulation on each client, but keeps track of who has authority on each entity. Then it tries to keep track of things that happen to entities it has authority on, and estimate how much inertial error is getting introduced into remote simulations. Then it sends sync messages to try and resync the most error per message possible.

This tends to work well, but I'm not sure how you'd deal with up to a second of latency. Unfortunately Entanglar is .Net only :/

Original thread: https://box2d.org/forum/viewtopic.php?t=1184