[Plugin] Multiplayer Function Sync

Post your work in progress addons and get feedback

Post » Fri Jun 27, 2014 2:17 am

Uh, I thought you might miss something.
This syn-function only could pass commands, not the execution result, so that it could not be used in real-time game, that is Ashley considered. You might emphasize that the syn-function is only used in turn based game, to prevent misunderstanding.

BTW, the concept of my syn-function is trying to ignore the different of host/client in game logic, so there is only one way to evoke the function, calling at one peer, executing on all peers.
B
108
S
26
G
272
Posts: 4,472
Reputation: 152,279

Post » Fri Jun 27, 2014 11:05 pm

Ashley wrote:@troublesum - what, so you don't even implement interpolation or input prediction? Have you actually tested that over a real-world connection?


@Ashley I wanted to address this:

Interpolation is predicting the next logical location based on speed and direction in between recieving input commands. Since i only call functions that act on simulate behaviors that are subject to dt, isn't interpolation is already handled. Both players call move left for player 1 at the same time and the simulated action is adjusted for dt so they move across the screen in sync regardless of framerate as there locations are interpolated by dt being accounted for in the behavior movement.

As for input prediction since i latch a function call in place until sending another that is in essence input prediction. Player 1 sends the move left command and each peer latches that command in place and continues (persists) to call it until receiving another action call from the same action group (IE Stop, move right etc..).

So yes, I do implement interpolation (So long as i only use movement that has dt accounted for which all behaviors have including physics if set to frame rate independent) and I do input prediction by latching (persisting) function calls . I do feel this method provides the cleanest and simplest method of lag free control (When used by plugin to make it easier). Can you use for this erratic x,y positioning that is not subject to dt... probably not (it would be very complicated). But for movements generated by a behavior that are subject to dt. Yes you absolutely can.

Please, test my capx, im confident in its ability to sway your opinion. [Just uses functions with out any 3rd party plugins] (just run/preview in a coupe of browsers, click connect on each, and then use arrow keys to move players)
multiplayerPlatformFn.capx

In any case i wont push this any further i just think it would be helpful for others if this was more easily made available. Thank you
You do not have the required permissions to view the files attached to this post.
B
20
S
7
G
1
Posts: 221
Reputation: 2,077

Post » Sat Jun 28, 2014 11:28 am

No, from what you've described you don't know what those terms actually are. Interpolation is estimating mid-points between two known values. Input prediction is where you move the local player immediately without waiting for the authoritative host response, and reconcile their position when the host response is later received, thereby preventing cheating whilst removing the round trip latency on the peer's movements. We already did loads of testing with our multiplayer engine over realistic (and often unreliable) Internet connections and without those features the game will perform very poorly and be easily hackable. If something runs well locally it says nothing of how it will run when a player in the US is connected to a player in the EU.
Scirra Founder
B
398
S
236
G
88
Posts: 24,441
Reputation: 194,681

Post » Sat Jun 28, 2014 1:49 pm

@Ashley Fair enough.. I appreciate the response. Thank you

Edit: Apparently what I'm doing is extrapolation?, not interpolation. I move objects based on its current state as opposed to the object movement being interpolated from one point to another. If latency is low extrapolation does provide better results (which is why i show no lag on local games) but if latency is high interpolation would be better.
B
20
S
7
G
1
Posts: 221
Reputation: 2,077

Previous

Return to Work in Progress Addons

Who is online

Users browsing this forum: No registered users and 1 guest