UDP Online Network Connection - Sample Project

This forum is currently in read-only mode.
From the Asset Store
[C3] Banner ads, Interstitial ads, Rewared video ads, Rewarded Interstitial Ads
  • Hey guys!

    As i've told before, i was messing around with UDP code stuff. Never programmed in Python before, but after some research, i could adapt MasterMind UDP library (that's on Pygame site) to work with Construct.

    So, It's a simple program, where server will move the red player, and client will move de blue one. Connection is done via UDP as said, but there is no optimization or prediction or etc here, just studying socket stuff. It's rough, but works. You can connect to external ip, if port is properly forwarded.

    I will try to advance on my experimentations and refine this thing a bit more. At the end of post, the source code for Construct is attached. And below, some links about UDP in Python and in general gaming:

    http://www.pygame.org/project-Mastermind+Networking+Lib-859-.html - Mastermind Networking Lib on pygame.org, from wich my code is based uppon.

    http://gafferongames.com/networking-for-game-programmers/ - To me, this one is a must-read article series. It covers the basics about game networking. take a look!

    http://gafferongames.com/game-physics/networked-physics/ - From the same guy, it covers aspects like client prediction, and i think it's focused on a FPS approach

    Cap file attached. Used Constructed 0.99.84.

    [attachment=0:1f8h547j][/attachment:1f8h547j]

  • Excellent work! Just downloaded it and it worked well. I like how you in-lined the library code so folks don't have to mess with custom Python builds.

    Used Constructed 0.99.86.

    I think this should be .99.84.

    btw.. I stumbled upon pysage today which is a Python tool on top of pyraknet. May be worth a look.

    http://code.google.com/p/pysage/

  • Excellent work! Just downloaded it and it worked well. I like how you in-lined the library code so folks don't have to mess with custom Python builds.

    Besides that, It's easier to debug , since it's directly attached to Construct itself.

    My code is pretty much novice friendly (at my point of view), maybe someone could understand the UDP connection basics just reading that (maybe not )

    btw.. I stumbled upon pysage today which is a Python tool on top of pyraknet. May be worth a look.

    http://code.google.com/p/pysage/

    Pretty interesting stuff. The actor's system seems interesting for applications that demands high levels of data traffic (thinking in games like battlefield, that support 32 or more players across the net).

    I think this should be .99.84.

    Thanks, fixed. Now I've put some interesting links regarding UDP network gaming that worth a look!

    • FRP -
  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • nn.nn.nnn.nnn PORT: nn

    nevermind, router doesn't want to play along

  • Doesn't appear to do anything.

  • nn.nn.nnn.nnn PORT: nn

    nevermind, router doesn't want to play along

    You can test locally on same machine if you want to, just open two program instances, in one you click on start server, and on another you put your lan address to connect.

    Arrow keys doesn't work after clicking on buttons or input fields, I have to switch to desktop or another window and then switch back to program. It's a focus issue i don't know if it could be avoided.

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