0 Favourites

Dungeon Escape - Online

This forum is currently in read-only mode.
  • 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".

    <img src="http://i43.tinypic.com/153ma2p.jpg">

    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.

    Will you work together to escape the dungeon or feed your friends to the beast?

  • Holy crap this is just too awesome! I'm REALLY looking forward to the tutorial!!!

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

    This could change EVERYTHING

  • Construct 3

    Buy Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Buy Now Construct 3 users don't see these ads
  • 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.

  • Thanks folks!

    It's quite slow so the turn base game type would be the best for it, but it works.

    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.

  • 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:

    http://blog.mikepan.com/very-simple-2player-networking-in-python/

    And a post where it all started, i think:

    http://blenderartists.org/forum/archive/index.php/t-100682.html

    Hope it helps in some way...

    EDIT 2: I've found something like Podsixnet (i guess), but with UDP protocol support as well. Maybe you should see that one too:

    http://www.pygame.org/project-Mastermind+Networking+Lib-859-.html

    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 -
  • EDIT 2: I've found something like Podsixnet (i guess), but with UDP protocol support as well. Maybe you should see that one too:

    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.

  • Dude, that is awesome! Keep pushing, I would love to see online functionality in Construct! YAY!

  • mmm definitely interested in how this was accomploshed!

  • 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.

    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.

    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.

    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 -
  • Awesome. Just... awesome.

    Ima chargin' my expectations for this tutorial.

  • Thanks all for the inspirational words!

    Hmm, well, maybe even on Raknet library, this should be done by the programmer, since prediction may vary from each game style.

    This is a good point. I'm inclined to agree. I think most people will have to do this based on their type of game. The only thing that can perhaps be done to help is provide people with an example or two on how it is done and they can take it from there.

    When i initialize udp server, there is some function with while statement in there, and it freezes everything.

    I think you are talking about this call: server.serve_forever() which leads to netbase.py and the while loop. The problem is this pretty much hijacks the main loop and that doesn't play well with Construct. That is why I like PodSixNet so much because it uses the Pump() feature to check packets but doesn't steal the main event loop. I'll have to look at Mastermind closer to see if there is a workaround.

  • I think you are talking about this call: server.serve_forever() which leads to netbase.py and the while loop. The problem is this pretty much hijacks the main loop and that doesn't play well with Construct. That is why I like PodSixNet so much because it uses the Pump() feature to check packets but doesn't steal the main event loop. I'll have to look at Mastermind closer to see if there is a workaround.

    I think it's not the while statement what's hijacking main loop, but the actions from inside of it. I think it's not polling data in asynchronous event like Pump() in podsix, as it uses asyncore lib from python and mastermind doesn't.

    From that point of view, podsix is much more efficient than mastemind. Damn!!

    • FRP -
  • Does this list anyone that's hosting? I don't know if anyone's hosting

  • Does this list anyone that's hosting? I don't know if anyone's hosting

    Right now the server is in a rough state where you have to restart it each time you want a new game. Eventually, I'll set it where it automatically resets once the game ends and also add the option where a client can remotely set the number of players. I'll also add AI players to fill the gaps at some point.

    I've uploaded a new version of client and server where you can now specify IP address if you want to use Hamachi (it needs to listen on the Hamachi IP not your default IP address).

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

    Edit: Decided it was too soon to host a server if it doesn't support restarts and client updates. I'll do this at some point, but I'm going to just start on the tut for know and stop adding features.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)