Python Networking, TimeDelta & GGPO (Good Netcode)

For questions about using Classic.

Post » Fri Apr 23, 2010 7:56 pm

Are there any examples of some MMORPGs using it (not that I'm making a mmorpg btw). And can you say for certain that using a python library for networking will work well with a fast paced online action game with construct, and there isn't any reason why it shouldn't be fine. MMORPG in a 2D sense would probably mean 6-18 characters in a room cooperating. I should point out I'm talking about the quality of the network and not that it just works. Will it just depend on the programmer and there isn't any reason Construct and Python would conflict.

For those that don't know what GGPO is, you can read this (first and"What's this rewind thing?" paragraphs. And the first few paragraphs here) for a quick understanding of what it is. This is what newer fighting game like "BlazBlue, Street Fighter 2 HD Remix, and the recent Marvel vs Capcom 2 release use". It basically keeps the clients in sync behind the scenes by rolling back frames in the game play. The is done while you can't see, so it feels more close to the real arcade experience. Here is a random online match of a game using GGPO http://www.youtube.com/watch?v=f2vi_Dsiahc.

Now how would trying to use timedelta instead of fixed frames affect this style of netcode? I don't want to waste any time when it's time to convert to netplay. And if it doesn't work, I'd rather remake this specific game last in something else and finish offline only games. Thanks.

@ Jonathan5 I'm aware of Scidave's work and he's done enough for community already. Thanks for posting those links, so more people get a chance to see them. Hopefully, he or a dev could shed some light on this issue.
B
2
S
2
G
4
Posts: 259
Reputation: 1,968

Post » Sat Apr 24, 2010 5:46 am

Scidave said he is working on a tutorial, so you should probably wait for that.

Dungeon Escape Online:
[url:1enlolvd]http://www.scirra.com/forum/viewtopic.php?f=4&t=6239[/url:1enlolvd]

Pong Demo:
[url:1enlolvd]http://www.scirra.com/forum/viewtopic.php?f=4&t=6102[/url:1enlolvd]
B
3
G
3
Posts: 23
Reputation: 946

Post » Sat Apr 24, 2010 1:48 pm

Still, even if Scidave can do it, I'd like to know if this isn't more suited to a C++ plugin or something else. I wouldn't want to use Python for something it isn't suited for.
B
2
S
2
G
2
Posts: 372
Reputation: 1,794

Post » Sat Apr 24, 2010 8:21 pm

Also:

For those that don't know what GGPO is, you can read this (first and"What's this rewind thing?" paragraphs. And the first few paragraphs here) for a quick understanding of what it is. This is what newer fighting game like "BlazBlue, Street Fighter 2 HD Remix, and the recent Marvel vs Capcom 2 release use". It basically keeps the clients in sync behind the scenes by rolling back frames in the game play. The is done while you can't see, so it feels more close to the real arcade experience. Here is a random online match of a game using GGPO http://www.youtube.com/watch?v=f2vi_Dsiahc.

Now how would trying to use timedelta instead of fixed frames affect this style of netcode? I don't want to waste any time when it's time to convert to netplay. And if it doesn't work, I'd rather remake this specific game last in something else and finish offline only games. Thanks.

@ Jonathan5 I'm aware of Scidave's work and he's done enough for community already. Thanks for posting those links, so more people get a chance to see them. Hopefully, he or a dev could shed some light on this issue.
B
2
S
2
G
4
Posts: 259
Reputation: 1,968

Post » Mon Apr 26, 2010 2:25 am

I'll take a crack at answering your questions, although I'm not a big network programmer myself.

[quote="manontherun":3qzbdxeg]Are there any examples of some MMORPGs using it [/quote:3qzbdxeg]
- Eve uses Stackless Python.
- The creator of PodSixnet is making an MMO that should support hundreds of players at one time.
- OpenRTS is written in Python/Pygame

[quote="manontherun":3qzbdxeg]And can you say for certain that using a python library for networking will work well with a fast paced online action game with construct, and there isn't any reason why it shouldn't be fine.[/quote:3qzbdxeg]
It hasn't been done yet so nobody can say for certain, although I don't see any roadblocks assuming the following issues are addressed:
- Access to Object private variables in Python
- Access to behaviors from Python code
While there are workarounds to the two above cases it will make for messy and inefficient code. You need to have access to behaviors in order to interpolate and predict properly. Until that is done, Construct/Python code will be limited to turn-based and slow action games over internet.

[quote="manontherun":3qzbdxeg]MMORPG in a 2D sense would probably mean 6-18 characters in a room cooperating.[/quote:3qzbdxeg]
This is already a given in Python. I'd venture to say even in PodSixNet you could do this for faster pace assuming that you also interpolated the players positions and perhaps added predictive code. I don't know how fast your characters will be moving so if things are happening insanely fast you might have issues w/ TCP. You wouldn't even need to do the GGPO type things you are talking about.

There are different levels of netcode which handles various levels of lag. From simple to more complex:
1. Basic TCP/UDP library. PodSixNet is an example of a basic TCP library. It performs what it needs to do quite well and integrates perfectly with Construct. However, by itself it is only practical with slower online or fast LAN games. You will start to notice the effects of lag over a 150ms latency (300ms round-trip).

2. Interpolation: Even with a UDP library you can't escape lag. Interpolation is used to smooth the movement of the player from the prior position to the new position. This is usually done with tiny movements each frame until the player reaches the new position.

3. ClientSide Prediction (Dead Reckoning): If there are large amounts of lag even interpolation will not be sufficient. In that case, the clients can predict where other objects will be by keeping a rolling average of the latency and using speed,direction characteristics to predict the actual position.

4.Lock-Step: This is usually used in a peer to peer networking scheme where each client will take a fixed amount of latency in exchange for seemless play with other peers (of similar latency). Usually, everybody will have a latency of say 100ms and that allows for deterministic play between all of the peers.

5. Roll-back: This is used in GGPO and in a bunch of FPS games as well. Sometimes a player will die on the server, but then an update comes from the client saying that he would have moved in time. The game is then rolled back on the server and all clients get updated information.

I think roll-back will be a real pain to implement and I have no idea how it would fit in with Construct. I'll have to leave the timedelta issues and implementing it to the developers.


[quote="Mr Wolf":3qzbdxeg]I'd like to know if this isn't more suited to a C++ plugin or something else.[/quote:3qzbdxeg]
I think we can all agree that a plugin is going to be more suited to networking than Python. If a plugin was written it could handle a lot of the synchronization for fast-paced games behind the scenes you might have to do with Python. That being said, PodSixNet integrates well with Construct so for its use case I would say it is well suited.

So to summarize all of this:
If you want to make turn-based, RTS, or slow action online games use PodSixNet. It integrates easily with Construct and is easy to understand and use.
If you want to make fast-paced games then as of right now it is not practical (because of Python access to behaviors). Once the Python support is improved then it is probably up to the skill of the programmer, but you are in uncharted territory. :wink:

Edit: Based on frpnit's work with UDP, the Mastermind library might be a good alternative as well.
B
8
S
3
G
7
Posts: 835
Reputation: 5,313


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 1 guest