Network Pong Demo

This forum is currently in read-only mode.
0 favourites
From the Asset Store
[C3] Banner ads, Interstitial ads, Rewared video ads, Rewarded Interstitial Ads
  • Here is another simple network program with Construct and Python. This time it is a 2 player online/lan Pong game. After struggling with how to implement it and running into a few bugs I finally came up with a real simple solution. I'm using the PodSixNet Python Library which handles and hides all of the complex logic behind the scenes.

    Pong isn't all that exciting, but it is online!!

    Run it the same way as the chat program. In a later variation I might add exception handling but for now pick a high port for the server like 5000. See the discussion in the chat program thread about ports. The controls for each player are Up/Down arrow keys.

    Get it here (need Construct .99.84):

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

    This version uses the mouse for Control instead (need .99.84 as well):

    http://www.box.net/shared/5703uihspa

    This is the latest version which supports 2 or 4 players (need .99.84 as well):

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

    <img src="http://i42.tinypic.com/657hbc.jpg">

    Next, I'll work on a N-player or 4-8 player networked game. Once, I finish that then I think I'll be ready to write the tut. I'll walk through the PodSixNet library and how to integrate it with Construct to make online multiplayer games.

  • Way to go, dude, this is sweet stuff.

  • Thats amazing, cant wait to see more. Keep up good work

  • Very cool indeed.

    I would love to have a looky at the cap for this. Looking forward to the tutorial regardless.

  • The first proper Construct online game ever?!! Pretty big deal! Thanks for that scidave!

    I just hope it's not too hard to incorporate the Python code for this. Looking forward to your tutorial!

  • I think tutorial is really cool but im sure many people are wanting to dig there teeth into the Network Pong demo lol. But ill be patient to see what else you are cooking up.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You know with a slight modification this could work out to be a VERY fun 4 person hockey (or air hockey) game.

    Make the paddles smaller and give it mouse control.

    *getting out my quarters*

  • Worked ok when we tried with PixelRebirth though connection was laggy (might been my fault but can't be sure or PR's or the program itself) and yeah looking good so far though the game itself was a bit boring as ball didn't have any randominess (yes im fully aware that this is more like a technology demo)

  • Thanks everybody for the feedback.

    though the game itself was a bit boring as ball didn't have any randominess (yes im fully aware that this is more like a technology demo)

    You mean you don't like aimlessly bouncing a ball endlessly back and forth??! You can affect the direction of the ball by moving your paddle quickly up or down as it contacts the ball. Yeah, I never really meant it to be all that exciting, but maybe I'll jazz it up a bit with randomness or with what Guyon suggested which would be kinda cool. I like the idea of using the mouse for control.

    though connection was laggy (might been my fault but can't be sure or PR's or the program itself)

    Were you playing over the internet or on a Lan? Do you both have high-speed connections or dialup? I didn't notice any lag on the Lan when I tested it, but I could see it having potential lag over internet. It would be good to know if there were issues with this library, because I can always go with another one if the performance is not good enough.

    I'm hoping a new version of Construct will come out with a bunch of Python fixes (editor and private variable access) before I start on the tut. I also want to wait just in case another library might be better.

  • Cool, I can't wait to see how this is done. I tested it out, and it works well.

  • Yeah it was over internet... My connection is 10/2 so it should be fast enough for this (it's cable)

  • Thanks Sagal for the info. I did some network testing and I'm getting the following info for latency:

    - Lan: .4 ms

    - google: 25ms

    - scirra: 46ms

    I'm on a cable connection as well. Since the ball location only updates once a game loop my guess is everything is fine in the LAN case since it is well under the 10 ms event loop time. However, the internet latency is at best 2-4x over over so it might cause some lag for the ball. Also, I have the ball going pretty fast and I might want to slow it down some as well.

    I have a couple of ideas on how to minimize internet lag it so hopefully I'll get a new version out that fixes this.

  • Ah great^^ this all will mark new era for Construct maybe even the Golden Era! (probably not). But good luck trying to get it done so it can be used to make over internet multiplayer games.

  • I would suggest predicting where the ball and the opponents paddle will go using interpolation, and fixing any discrepancies whenever the next bit of information comes in. The ball should follow some pretty straightforward rules of motion and bouncing, so the predictive algorithm wouldn't be too complex. I think most action internet games have some form of prediction.

  • I would suggest predicting where the ball and the opponents paddle will go using interpolation, and fixing any discrepancies whenever the next bit of information comes in. The ball should follow some pretty straightforward rules of motion and bouncing, so the predictive algorithm wouldn't be too complex. I think most action internet games have some form of prediction.

    FPS games, for example, try to have very good netcode to limit the effects of lag.

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