Help with Network Coding

This forum is currently in read-only mode.
From the Asset Store
Game with complete Source-Code (Construct 3 / .c3p) + HTML5 Exported.
  • Hi there guys,

    I am currently learning to make a side scrolling multiplayer shooter with Construct, and I found the great plugin by scidave

    I was making progress with it, and managed to replicate it and make a chat program on local and also a test with two players controlling a cube each (nothing fun yet).

    The first version I made was to avoid the way scidave coded as I want to leave the code as future friendly as possible (the game will have 2 players, but looking to support up to 6 players).

    The first versions basically have two Avatars both with 8 direction behavior and depending on the pNumber assigned by the server, pNumber1 will control the redbox and ignore bluebox's control, and vice versa with pNumber2. It works fine and all, but I noticed that even on local testing, there's a slight lag on both players.

    The next version was done by a friend where he follow's scidave example, and surprisingly his version played much smoother. The only problem with this version is the that players, regardless of pNumber1 or pNumber2, will always be the redCube while the 'enemy' will always be blueCube. I hope this is not too confusing.

    My question is that which method is better? I really liked scidave's method, for it seems to make the lag disappear almost entirely. Is there any other alternative that will be better to code for a multiplayer action game?

    Here's the two cap files for both versions, in case you guys would like to see the mess I made :D. I appreciate any help or insight on this.


    Scidave style



    Sorry, I noticed I made an error on the link for the first one. It's fixed now.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hi guys, just a bump for help on this matter.

    I also noticed that someone is developing a network plugin for C2. Seems like a good choice to migrate, as it seems Scidave is busy lately.

    C2 Multiplayer

  • Yes, unfortunately I'm not going to be able to do any work/help on this for about 6 months. Have intermittent computer/internet access.

    You might be able to look at the Pixel People online source that was posted for help. Besides that, C2 might be a better approach because more people are active on that project in relation to Networking. Although the benefit of CC is that the Server and Client can be written entirely in Construct.

    You might also explore Podsixnet, but I found the performance to be lacking for action games compared to my beta plugin (because it used TCP vs UDP). Cheers!!

  • Thanks for the suggestion, scidave! I hope you can work on this again sometime in the near future, it's truly a brilliant plugin. I tried Podsixnet could not get it to work at all no matter how I want to.

    I will looking into the Pixel People source as you've suggested :D

  • I will looking into the Pixel People source as you've suggested :D

    I haven't touched it in a few months, but feel free to ask me if you have any questions about how I made it =] It's my first real attempt at network multiplayer, so I'm sure lots of things I did can be improved or done more efficiently <img src="smileys/smiley11.gif" border="0" align="middle" />

  • Thanks for the offer, Jayjay. One question I have in mind is so far, from my testing in local network, it seems to be quick and stable enough. But in your opinion, would it be suitable for making suitable fast paced shootemup multiplayers? Thanks!

  • It depends, the plugin has a strange bug over the internet where (it looks like) once a packet is dropped the whole system starts re-sending packets to everyone, and really breaks the game.

    However, if you mean over a LAN, or where ping between players is around 100ms or less, then it should work fine I think.

    I'll be trying to edit the plugin code that SciDave nicely open sourced, but until then a workaround might be to create a system to ignore repeat packets (store a list of the most recent 100 messages received?)

  • Would that mean like maybe position of each player, we store that at 100 and constantly update it, eliminating the oldest data, and compare and update it to the player's on position?

    Hmm...seems like multiplayer for your first game is kinda out of the pictures :P.

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