Dungeon Escape - Online

Post your Construct-made creations!

Post » Sat Apr 17, 2010 9:33 am

Here is the last example game for the networking tutorial... that I hope to finally start on next week. ;-) I optimized this one as much as possible for many players and on a LAN I wouldn't be surprised if 20+ players could play. I've limited it to 10 players due to size of game field. This is a TCP networking engine and I didn't do any interpolation so let me know if you try it out over internet.

Edit: I think turn-based, real-time strategy, slower action, RPG, and strategy are possible for this particular library (PodSixNet). The only game that TCP is a poor choice for is fast real-time games (FPS). After doing more testing, I think with interpolation/prediction most lag issues for the TCP engine on "slower" (speeds less than 100 pixels second) games can be accounted for (after all WoW and other MMOs use TCP). Still I plan to look into UDP "down the road".




Get the files here (need .99.84):
This is a new version with a slightly higher top speed and acceleration. Also, some server side changes to reduce # packets.
http://www.box.net/shared/ypq6pdj0mf

You will need the dependencies on both the client and the server.

If you want to host the server online either setup your router for NAT passthrough or use a tool like Hamachi (https://secure.logmein.com/products/ham ... nload.aspx) on everyone's system. Hamachi will setup a virtual LAN between everyone's system and the game runs pretty good in my testing over the VLAN.

Controls:
Up, Down, Left, Right - Control your guy
Spacebar - Drop Stars/Bombs. These inflict heavy damage on other players and slow the beast down.
T - Teleport. Randomly moves you on the map.
L - Light You only have limited light so use it wisely.
M - Minimap Your light must be off to see other players positions with the map. Using the
minimap lowers your health, so use wisely.

Strategy:

The goal of the game is to either be the last one standing in the dungeon (you can't kill the beast) or to escape first. You need one key to be able to unlock the blue portal. Look out for the red traps which slow you down. The keys, traps, and escape portal are randomly generated each time you play.

I was going to turn this in to a real true game, but I'm running short on time so I figure I better get the tutorial out like I promised. ;-) The beast is pretty dumb and I don't think I did the picking right on him, but heh. ;-)

Will you work together to escape the dungeon or feed your friends to the beast?
B
8
S
3
G
7
Posts: 835
Reputation: 5,313

Post » Sat Apr 17, 2010 11:49 am

Holy crap this is just too awesome! I'm REALLY looking forward to the tutorial!!!
B
7
S
2
G
4
Posts: 164
Reputation: 2,418

Post » Sat Apr 17, 2010 2:33 pm

Amazing! I hope the online tutorial is not as hard for how cool this will be.

This could change EVERYTHING
B
28
S
8
G
8
Posts: 530
Reputation: 7,154

Post » Sat Apr 17, 2010 2:37 pm

I just tried it online, and it actually works, awesome. It's quite slow so the turn base game type would be the best for it, but it works. Good job. Looking forward to see the tutorial.
B
4
S
1
G
3
Posts: 85
Reputation: 1,234

Post » Sat Apr 17, 2010 4:31 pm

Thanks folks!

[quote="Maciej":uawr3k3v]It's quite slow so the turn base game type would be the best for it, but it works.[/quote:uawr3k3v]
I limited the maximum speed to be slow (40) to see if there would be lag online, but it is probably a little too slow. So I'm not sure if you are seeing lag or just the default slowness of the movement.

Could people try out this version, with faster speeds, and let me know what lag difference you see online and in LAN?

http://www.box.net/shared/ypq6pdj0mf

Either way, a UDP solution w/interpolation will be much better for any game (FPS) with high movement speeds. There just happens to be a UDP Python library so shooter type games, over internet, should be possibility at some point.
B
8
S
3
G
7
Posts: 835
Reputation: 5,313

Post » Sat Apr 17, 2010 5:01 pm

Hey Dave.

I'm new to construct and well, netplay is indeed interesting.

Can't test yet your game online but on LAN, anyway, i've found someone experiments on Python and Blender Engine and appears it used UDP library. Dunno if it would help you or even help to change this netlibrary to a UDP aproach, below link for the experiment and basic UDP source code idea:

[url:31o68jyl]http://blog.mikepan.com/very-simple-2player-networking-in-python/[/url:31o68jyl]


And a post where it all started, i think:

[url:31o68jyl]http://blenderartists.org/forum/archive/index.php/t-100682.html[/url:31o68jyl]


Hope it helps in some way...

[color=#800000:31o68jyl]EDIT 2: I've found something like Podsixnet (i guess), but with UDP protocol support as well. Maybe you should see that one too:
[url:31o68jyl]http://www.pygame.org/project-Mastermind+Networking+Lib-859-.html[/url:31o68jyl][/color:31o68jyl]

Edit: Seems that you can transform your TCP socket to UDP socket just changing type on plugin lines like this one:

self.create_socket(socket.AF_INET, socket.SOCK_STREAM) - this is a TCP Socket, changing to:
self.create_socket(socket.AF_INET, socket.SOCK_DGRAM) - would transform to UDP socket.

Dunno what it could implies on PodSixNet anyways, but it's a start.

- FRP -
B
3
S
1
G
2
Posts: 16
Reputation: 857

Post » Sun Apr 18, 2010 12:03 am

[quote="frpnit":1zsbs0rf]EDIT 2: I've found something like Podsixnet (i guess), but with UDP protocol support as well. Maybe you should see that one too:[/quote:1zsbs0rf]

Thanks for the great info frpnit! I didn't know Eve online used Python (UDP library).. that's pretty cool. I also noticed that this is your first post, so welcome to the forum! Construct is an awesome tool and this community is very helpful. :)

That Mastermind library looks exactly like what is needed for higher speed over internet games. I don't know how good the performance will be, but it should be better. We will still have to do some interpolation/prediction to handle long lag times which unfortunately right now we have to manually do.

I did some more testing using a Network latency simulator and the Dungeon game actually performs pretty well up to around 150ms lag. That's not bad!! I think the slowness that MacieJ was talking about was how I made the game. The new version I uploaded seems about as laggy, but is more responsive so people may like that better. I've removed the old version and made a few server improvements and uploaded a newer version.
B
8
S
3
G
7
Posts: 835
Reputation: 5,313

Post » Sun Apr 18, 2010 1:35 am

Dude, that is awesome! Keep pushing, I would love to see online functionality in Construct! YAY!
B
6
S
2
G
3
Posts: 520
Reputation: 2,690

Post » Sun Apr 18, 2010 1:21 pm

mmm definitely interested in how this was accomploshed!
B
2
S
2
G
5
Posts: 293
Reputation: 2,236

Post » Sun Apr 18, 2010 2:46 pm

[quote="scidave":3ax109qh]
Thanks for the great info frpnit! I didn't know Eve online used Python (UDP library).. that's pretty cool. I also noticed that this is your first post, so welcome to the forum! Construct is an awesome tool and this community is very helpful. :)
[/quote:3ax109qh]

Thank you, scidave! I've been observing Construct sometime ago, but my real interest came now i've seen it's possible to accomplish networking on games, even if has to be on small, simpler games.

[quote:3ax109qh]
That Mastermind library looks exactly like what is needed for higher speed over internet games. I don't know how good the performance will be, but it should be better. We will still have to do some interpolation/prediction to handle long lag times which unfortunately right now we have to manually do.
[/quote:3ax109qh]

I was reading superficially both Podsix and Mastermind code. Seems that what i told about podsix should work, just changing socket type on .py files. But both libraries does pretty much the same, connects two endpoints, and send encoded data to save traffic.

About interpolation/prediction. Hmm, well, maybe even on Raknet library, this should be done by the programmer, since prediction may vary from each game style. A race game must use prediction in different way that FPS should. Dunno, just wondering here.

[quote:3ax109qh]
I did some more testing using a Network latency simulator and the Dungeon game actually performs pretty well up to around 150ms lag. That's not bad!! I think the slowness that MacieJ was talking about was how I made the game. The new version I uploaded seems about as laggy, but is more responsive so people may like that better. I've removed the old version and made a few server improvements and uploaded a newer version.
[/quote:3ax109qh]

Great! It becomes more and more interesting, keep the good work. I'm trying here do some silly stuff to test Mastermind library, used cxfreeze as on your tutorial, and library successfully exported, i own you thanks. Now i'm stucked, opened that Construct python script editor and seems the code is executing in infinite loop. When i initialize udp server, there is some function with while statement in there, and it freezes everything. Well, i'll try do something more today.

- FRP -
B
3
S
1
G
2
Posts: 16
Reputation: 857

Next

Return to Your Creations

Who is online

Users browsing this forum: No registered users and 0 guests