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

This forum is currently in read-only mode.
From the Asset Store
[C3] Banner ads, Interstitial ads, Rewared video ads, Rewarded Interstitial Ads
  • Well the good news is it's working, somewhat more...

    Bad news is, I'm an idiot xD;

    I've been playing a few games online just recently where you either

    chose to be the host and play through that, or the person connecting.

    When the host button sent you in-game, I thought this must have worked

    the same, I didn't expect it to be as you just mentioned in this last

    post, one host, one client, and then the other person connecting to you.

    Hence my confusion.

    I've now gotten it functioning, both connecting, however it's quite confusing?

    However yeah, the 'GameOn' is constantly being sent.

    Also the characters wildly move about without me controlling them,

    and when I was shooting the enemy on this screen, I watched my own

    character get shot completely randomly on the other computer.

    Is that just an issue of major lag?

    (I've run other games without any lag so this could just be a result

    of the 'GameOn' being sent constantly across, maybe that is the root

    of that problem).

    Players ID's synched up? You mean for the server to identify who is

    using which character?

    So rounding the characters positions into an int before sending the

    update would reduce the lag? Thanks for the advice :).

    If you have any more tips/or ideas on why these problems are occurring

    I'd really appreciate everything you may be able to mention.

    Now understanding that the host acts alone to the 2 clients that should

    help understanding more of this as reference while starting another test

    based on it.

  • >> Players ID's synched up? You mean for the server to identify who is

    using which character?

    Yes, it is admittedly not the best way so important that step be done right first. Once that is good then you can move to telling everybody that the game is starting ("GameOn" Message). IMPORTANT: While folks are getting/processing the GameOn message you don't want position packets to flood the network.

    Finally, once everything is stabilized (dont see gameOn packets flooding) THEN start sending position packets. One way to do this is to delay start by a several seconds once. Also, the example is poor in that it sends the position packets every tick..not good for over the internet. Change that to every couple ticks.

    If I get a chance to test this I'll send an updated example .cap...but hope that makes sense.

  • hmmm. those suggestions probably wont help, I think I introduced a new bug into the latest version that makes things unstable. Looking at it now. :-(

    If you want to mess with the older version of the plugin just to see if it is bug free.. here it is:

    box.net/shared/jaxkj9skkmkdc12p8nim

    Edit: Just tested the first version of the plugin and it isn't working. Very odd I never encountered this bug before. Not sure how it is computer dependent! argggh..

  • Darn :O, hope your able to get things functioning properly soon D:.

    Also, though it isn't the weekend yet so I haven't been able to

    concentrate on testing that/experimenting with it, I discovered some

    things while testing/trying to fix it that might help you get closer

    to where you need to be working on.

    With the 'GameOn', I added a condition that a global variable must

    be equal to 0.

    • 'hassentGameOn' = 0

    And then at the end of that code I added 'add 1 to [hassentGameOn]'.

    Even though in the debug the global variable 'hassentGameOn',

    was in fact only '1', meaning the script should have only run once

    (otherwise because it was adding 1 each time that number should have

    been growing), both clients kept receiving the 'hassentGameOn' message.

  • >> both clients kept receiving the 'hassentGameOn' message.

    I discovered something similar myself. Couldn't figure out why the GameOn message kept being sent even after the group was disable. The fact the group is disabled means for sure the computer processed the event which means it should stop sending!!

    I then tested with a reliable packet to send the GameOn message. SOmething like "GameOn:1". Because reliable packets expect a ":" and something else. This test worked just fine and the flood of game on packets stopped. So only using reliable packets instead of messages is one workaround for that part.

    That still didn't help with the buggy position/other updates...and to be honest this whole thing baffles me as it isn't even working right on one system or my LAN computers. I have no clue how it could have worked perfectly on my old test laptop and not now! More to follow.....

    EDIT: To help me figure this out. For all those who have used the network plugin please post saying if it works perfectly, works off and on, doesn't work at all, and your system specs/Construct version.

    For me, I had an HP Envy 14 laptop (Win7 64bit using CC1.1) which I developed it on(since sold) that it worked perfectly on. Have since tested it on a Win7 Pro and Win7 Home Premium both 64 bit (CC1.1 and 1.2) and it is very buggy...

  • Well, we've tested together already, but it worked perfectly when latency between all players was small.

    Had a Windows XP 32bit OS at the time on a Dell Optiplex Gx280

    Edit: With CC1.2

  • Thanks Jayjay...I know I just need to implement the update to see if that fixes it, but still kinda baffled that it isn't even working on localhost on my new computer.

    Surely somebody else who downloaded it has tried it out??????

  • Folks,

    Good and bad news. Good news is I'll be starting a new job and moving in a month so it will be exciting. Bad news is I wont have reliable internet for awhile and need to focus on new work.

    So in light of that I'm going to open source this plugin. I've only had a few hours to spend on it over the last couple months and feel that surely somebody can help move it along faster than me...

    If for some reason, nobody does I'll pick this up again end of next summer when the initial job contract is over.

    Network plugin source (Visual Studio 2010 Project file/ and source):

    Network Plugin Source

  • Oh wow, I'll take a look into this and see what I can do to help. Thanks a tonne SciDave! =D

  • I know nothig about network programing. I found the extension difficult to understand.

  • You are welcome. Hopefully somebody with come C++ skills and time can add to it.

    Do you mean the source code? If you no nothing about C++ then it might be difficult, if not then it isn't too hard to understand the source if you visit the ENET website. If you mean the plugin, then don't know what to say as it is about the most basic network plugin possible. You just host and receive or connect and send.

  • Damn sorry to hear, goodluck with the job!!

    I hope someones able to pick this up, you'd built a great ground for this scidave :)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Oh I'm happy for your name and sorry for us ^^. Well it was really good project. I hope someone take flag and project lives. And we can make nice multiplayer games.

    Is there any way for getting our real ip number ?

    Beceause if there is, I can use mey host as a master server always. I have dynamic ip, so it changes time to time. I don't want clients to write my ip adress always. If there is a way to get my real ip so I can send that number to mysql database. And clients can get that number on application start. So without knowing the address they can connect to my server.

    Is it possible ?

  • I can use mey host as a master server always. I have dynamic ip, so it changes time to time. I don't want clients to write my ip adress always. If there is a way to get my real ip so I can send that number to mysql database. And clients can get that number on application start. So without knowing the address they can connect to my server.

    Late, but try this instead: no-ip.com it's a program that runs on your computer that automatically updates your IP as it changes. Then just point your game to connect to the domain name you choose.

  • Hey, I've picked up the source code for the Network project.

    It won't build 'cause of no 'atlstr.h' ...This seems to be avail. in non-express 2010. Any known work-arounds? (Aside from buying VS.)

    Thanks! &Sorry to be brief. Gotta get to work...!

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