How do I Multiplayer With the Physics

Get help using Construct 2

Post » Sat Oct 24, 2015 7:25 am

In my game, I'm using the physics behavior for a custom platformer type gameplay. The problem I hadn't thought I might run into is that the physics behavior lags between the host and peer to a ridiculous extent. Obviously using input prediction only makes it worse, and makes the peer jump around quite a lot.
I'm quite sure that my 7mbs dl speed is not the issue, but maybe the server I'm using is? I'm using the default Scirra server for now, because my game isn't even in beta yet, so I don't need a server yet. If this issue is because of the Scirra server, then no problems, I just have to see if there could be an issue with trying to send physics through a server, period.
ImageImage
B
49
S
15
G
2
Posts: 270
Reputation: 6,679

Post » Sat Oct 24, 2015 3:57 pm

Give Unity a shot. Our Photon project uses physics and we are not having any uncommon lag issues. Games like Rocket League use U4E without too much of a latency problem. IIRC they are using the noobie multiplayer FPS template that ships with U4e. They are also using the default Controller input module.

Sorry i don't have an easy solution for C2.
B
29
S
8
G
4
Posts: 767
Reputation: 5,985

Post » Sat Oct 24, 2015 10:58 pm

Maybe @Ashley has an answer?
ImageImage
B
49
S
15
G
2
Posts: 270
Reputation: 6,679

Post » Mon Oct 26, 2015 12:23 pm

Game data goes peer-to-peer so the performance of the Scirra server has no impact on the gameplay performance. There is nothing special about physics; as with any multiplayer game, only the host is really running the movement, and the peers are just seeing and controlling virtual versions of themselves (typically with all their actual movements disabled, so they don't conflict with the multiplayer engine's control of the object). You're probably doing something wrong, like leaving the behaviors enabled for the peers. Multiplayer is hard.
Scirra Founder
B
403
S
238
G
89
Posts: 24,654
Reputation: 196,155

Post » Wed Oct 28, 2015 6:37 am

Ashley wrote:Game data goes peer-to-peer so the performance of the Scirra server has no impact on the gameplay performance. There is nothing special about physics; as with any multiplayer game, only the host is really running the movement, and the peers are just seeing and controlling virtual versions of themselves (typically with all their actual movements disabled, so they don't conflict with the multiplayer engine's control of the object). You're probably doing something wrong, like leaving the behaviors enabled for the peers. Multiplayer is hard.


Haha I guess it's not the EASIEST thing in Construct 2. I hadn't tried disabling the Physics behavior though. I hadn't thought about that, since I was following the Multiplayer Game example that comes with C2. I can see why that'd be different though. Thanks for taking the time, Ashley, hope I didn't disturb ya.
ImageImage
B
49
S
15
G
2
Posts: 270
Reputation: 6,679

Post » Fri Oct 30, 2015 5:52 am

I don't get it... Disabling the behavior on the peers side didn't work, which makes sense, as it's basically just a copy of the object from the Host. The host tells the peer whether the behavior is enabled or not, so it seems, and disabling the physics didn't do anything. I was doing something wrong, the values for the movement were different for the peer and host, so the input prediction was off, because it wasn't the same...

Again, thanks though..
ImageImage
B
49
S
15
G
2
Posts: 270
Reputation: 6,679

Post » Sat Oct 31, 2015 7:51 am

Okay, sorry for all the confusion. I'm gonna guess you knew better, the peer can control whether the behavior is enabled or not. I wouldn't recommend it though, without input prediction, multiplayer is useless.
ImageImage
B
49
S
15
G
2
Posts: 270
Reputation: 6,679


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 27 guests