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

Post and try out addons that are currently in development.

Post » Wed Oct 12, 2011 11:12 am

All good scidave :)

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

~Sol
Tired of crappy file hosts that are crappy? Get DROPBOX - https://db.tt/uwjysXJF
Moderator
B
45
S
17
G
37
Posts: 2,853
Reputation: 25,966

Post » Mon Nov 07, 2011 12:15 am

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.
B
3
G
2
Posts: 58
Reputation: 1,166

Post » Mon Nov 07, 2011 2:04 am

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? https://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!scidave2011-11-07 02:05:54
B
8
S
3
G
7
Posts: 835
Reputation: 5,313

Post » Mon Nov 07, 2011 2:50 am

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.sparkfeather2011-11-07 03:05:35
B
3
G
2
Posts: 58
Reputation: 1,166

Post » Mon Nov 07, 2011 4:11 am

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.
B
8
S
3
G
7
Posts: 835
Reputation: 5,313

Post » Mon Nov 07, 2011 6:53 am

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.
B
3
G
2
Posts: 58
Reputation: 1,166

Post » Tue Nov 08, 2011 2:58 am

>>> 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.
B
8
S
3
G
7
Posts: 835
Reputation: 5,313

Post » Tue Nov 08, 2011 3:35 am

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:
http://www.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..scidave2011-11-08 03:55:50
B
8
S
3
G
7
Posts: 835
Reputation: 5,313

Post » Wed Nov 09, 2011 12:11 am

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.sparkfeather2011-11-09 00:13:11
B
3
G
2
Posts: 58
Reputation: 1,166

Post » Wed Nov 09, 2011 2:31 am

>>> 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...scidave2011-11-09 02:47:44
B
8
S
3
G
7
Posts: 835
Reputation: 5,313

PreviousNext

Return to Work-in-progress addons

Who is online

Users browsing this forum: No registered users and 0 guests