[PLUGIN] Network v0.3a update***

This forum is currently in read-only mode.
From the Asset Store
Meta Audience Network
$7.84 USD
20% off
[C3] Banner ads, Interstitial ads, Rewared video ads, Rewarded Interstitial Ads
  • Hey SciDave, how's that packet loss bug looking?

  • Hi Jayjay,

    Am I correct that it only affects when initially establishing a connection? If that is the case, I think it can be solved with updating how the server assigned player numbers and also smartly not sending a flood of packets to all incoming clients when they are trying to join up. I've run into an odd bug where I can't get the server to send an update to just the current client...haven't had time to troubleshoot yet. I'll give it an hour or so this weekend and see if I can't find a solution. :-)

  • My additional suggestion:

    • function to send binary data.
  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hi Jayjay,

    Am I correct that it only affects when initially establishing a connection? If that is the case, I think it can be solved with updating how the server assigned player numbers and also smartly not sending a flood of packets to all incoming clients when they are trying to join up. I've run into an odd bug where I can't get the server to send an update to just the current client...haven't had time to troubleshoot yet. I'll give it an hour or so this weekend and see if I can't find a solution. :-)

    Nope, this will fling any information sent back and forth once a packet has dropped. This may be a packet dropping occuring each time, but it still happens to all subsequent data.

  • My additional suggestion:

    - function to send binary data.

    How would you propose using this? How would you expect the data be read in?

    Jayjay - I'll make the update and test it out..hopefully it solves the problem..if not I'll have to dig deeper with wireshark and maybe do another testing session with you.

  • Binary data is used, for example, by image files. Useful feature would be sending the data.

  • Jayjay - I'll make the update and test it out..hopefully it solves the problem..if not I'll have to dig deeper with wireshark and maybe do another testing session with you.

    Okay, good luck SciDave.

  • and change the category from game to internet!

  • Hi scidave, just though I would see how things are coming along. Glad to see you are still able to make progress on this.

    Good luck with future releases... I am still looking forward to them as the plugin becomes more powerful and streamlined. Too bad to hear about this packet loss bug... could explain the latency issues I have been having with seemingly very simple things.

    Keep it up!

    ~Sol

  • Hey Soldjah! Alas..I have been so busy with work I haven't look at it for the past two weeks. I'm going to have to just throw up a network analyzer and do lots of packet captures to see what might be the problem.

    Until then I would highly recommend not sending floats across the wire (in my example I'm not casting to int before sending which I should) and not sending updates every frame. Both of these, but especially sending every frame suck down mega bandwidth.

    In the next release I might turn on rate limiting control. Right now it is auto controlled..I might have it configurable for the user so if they know that clients only have 56Kbs you can limit it to that.

    Other things you can do to help...make your states as short as possible. For example, when sending a player position update.. Call the position "p" and check against this vs spelling it out. That will save 7 bytes of data per frame, etc...

  • All good scidave :)

    You have been awesome enough to make it this far. I can wait patiently for the updates! :D

    ~Sol

  • Looks great,

    however as for your demo, it's brilliant that you took the time

    to make one and very grateful for that, though it is extremely buggy?

    I had to set the global player value to 1 instead of 0 which it was

    so that when the second player joined, it's value would reach the

    'max players' and the client/host would connect.

    Now, after connecting only the person connecting to the host seems

    to actually make it in-game, and there's also the problem of the

    'GameOn' message being sent continuously resulting in massive lag

    after a few minutes of it being sent.

    Do you know how to/have any fix for these issues? Or at least any

    suggestion as how I might go around fixing them?

    Again great!! plugin, hope you keep up the epic work :)

    Just without a functioning demo it's difficult to work out how to use this.

  • Hey Sparkfeather!

    Yeah, sounds like you ran into the bug that JayJay found. It seems to be triggered by laggy connections (as I haven't heard about it happening over a LAN). I believe I have a fix, but haven't fully implemented it yet. It involves the server handing out ID #'s instead of the clients sending who they are.

    Until then might I suggest you try using Hamachi? secure.logmein.com/products/hamachi

    It is free and sets up a virtual LAN. It might reduce lag enough for allowing use over internet until I implement a fix. Try the demo as-is with Hamachi and see if it works (shouldn't have to modify anything).

    Thanks for trying the plugin out!

  • No worries, thanks for such a fast and informative reply :).

    Problem is, this was actually with me using Hamachi, so...?

    Welp I've been trying to work out some kind of solution with what's

    available but still haven't gotten it functioning for me yet.

    Goodluck working on that fix for it, hope it works for you :)!

    And goodluck with all your efforts into this plugin, it's already

    a great asset for those wanting multiplayer but unable to understand

    the difficult manual setup programming with python, look forward

    to future releases :3.

    ---

    edit:

    Not sure how it was able to work with others, or if it's just something

    strange occurring with me but, I've made some sort of progress.

    The user hosting the game only gets group 'ServerGame' enabled,

    because it's locally enabling the groups.

    So where as the person connecting to the host get's group 'ClientGame',

    which set's the lights to the players and has all of the gameplay script

    running, the host has none of that.

    I've just added in the 'trigger once' in 'ServerGame' to enable 'ClientGame',

    and sure enough I can now see the players. though the positions are

    screwed up and other bugs, etc, this at least explains why it wasn't

    displaying anything for the Host.

    Though as you mention that people haven't had this trouble over LAN,

    I'm not sure why I require enabling ClientGame to see anything at all?

    It shouldn't have worked for anyone if this was the problem.

  • Sorry it isn't working over Hamachi. Problem is definitely something to do with lag..as it works fine for me over internet as well (but I have fast connection).

    On the ServerGame vs ClientGame. The server should never act as the client (or in the example display client locations)...it is simply a dumb terminal passing packets back and forth. You need two clients and the server running.

    I have had requests to let the server also act as a client, but that is low on priority list compared to fixing this dreaded bug. :-)

    One potential fix/workaround is to add more checking/time for players to get their ID's all synched up. I think perhaps switching layouts combined with a laggy connection might be putting the game into a bad state. If you look for a workaround it would be to make sure that everybody gets their IDs and gets the GameOn message without sending ANY additional packets around to minimize lag problems. Also, in my example I was sending positions as floats (which is very bad).. you should correct that by casting any position as an int before being sent.

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