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

Post and try out addons that are currently in development.

Post » Thu Aug 18, 2011 3:59 pm

[QUOTE=SoldjahBoy]Other than that, I'm having some fun with this... it has huge potential and the speed seems fine! I had a friend from Malaysia connect (and his internet is pretty slow) with a ping of only 112ms! :D[/QUOTE]

I've noticed it works great long-distance as well =]

[QUOTE=SoldjahBoy]
*EDIT*
Also I have discovered that if you have conditions on an event "On packet type X" it does not seem to work.

Example:
On Packet Type X   -   Do something (this works)

On Packet Type X
PlayerObject.Count = 0   -   Do something (does not work)

It seems I solved this by using SUB EVENTS

~Sol[/QUOTE]

Hmm, Pixel People Online uses many of these and works fine. However, I often do comparisons to data from the network packet data.

Edit: Just checked and there is one event where it checks against a non-packet value, and it still works as expected. The Network plugin gets really weird with objects being created and destroyed it seems.Jayjay2011-08-18 16:02:37
"Construct 4 lets YOU make advanced games! (maybe)" Construct Classic - Examples Kit
B
86
S
28
G
13
Posts: 2,092
Reputation: 15,009

Post » Thu Aug 18, 2011 4:59 pm

Thanks for the reply Jayjay.

I have also noticed when making calls from packets, I get varied results.

Example:
On Connect -> Send Packet "RemoteJoin" & ":" & global('PlayersConnected') & ":" & global('PlayerName')

Sends a packet when a player connects...


Then to receive the packet
On packet type -> "Remote Join" Set Text.text "global('PlayerName')"
This works fine

however...
On packet type -> "Remote Join" Set Text.text "GetToken(Network.PacketData,1,":")"
This does not. It returns a "0" for some reason.

What the hell crap?

~SolSoldjahBoy2011-08-18 17:00:50
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 » Thu Aug 18, 2011 5:09 pm

[QUOTE=SoldjahBoy] Thanks for the reply Jayjay.

I have also noticed when making calls from packets, I get varied results.

Example:
On Connect -> Send Packet "RemoteJoin" & ":" & global('PlayersConnected') & ":" & global('PlayerName')

Sends a packet when a player connects...


Then to receive the packet
On packet type -> "Remote Join" Set Text.text "global('PlayerName')"
This works fine

however...
On packet type -> "Remote Join" Set Text.text "GetToken(Network.PacketData,1,":")"
This does not. It returns a "0" for some reason.

What the hell crap?

~Sol[/QUOTE]

It sends that when it connects itself as well, so when it first sends it the value of PlayersConnected is 0. However, when another player joins they also send this message out. So rather than the server saying how many people are online, the clients are telling everyone they don't know who's online.

At least, that's what I think is happening.

Edit: Ah! Also, token 1 is the PlayersConnected, 2 is the name of the player.Jayjay2011-08-18 17:10:47
"Construct 4 lets YOU make advanced games! (maybe)" Construct Classic - Examples Kit
B
86
S
28
G
13
Posts: 2,092
Reputation: 15,009

Post » Thu Aug 18, 2011 5:17 pm

[QUOTE=Jayjay]

It sends that when it connects itself as well, so when it first sends it the value of PlayersConnected is 0. However, when another player joins they also send this message out. So rather than the server saying how many people are online, the clients are telling everyone they don't know who's online.

At least, that's what I think is happening.

Edit: Ah! Also, token 1 is the PlayersConnected, 2 is the name of the player.[/QUOTE]

Oh my bad, I meant to have PlayersConnected in the example to match the top call. I must have copy/pasted the wrong line.

The weird thing is though, about what you mentioned first is that in the server events I can make that call either way, and it works fine. In the client, if I don't use the direct call (global command), and try to use the GetToken call... it fails.

I am pulling my damn hair out. D:

~SolSoldjahBoy2011-08-18 17:18:35
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 » Sat Aug 20, 2011 4:25 pm

Hey SOL, can you post or PM me a .cap that shows the problem? The example you showed seems odd since one of them has nothing to do with Network data..it is just a global variable kept local to the client. Also highlight the difference between which server events and client events are different.

One of the challenges with a network plugin is that we are piecing together all of these code parts and some might not be meant to use together (as I've written it now). Sounds like I have a few bugs to workout. :-)
B
8
S
3
G
7
Posts: 835
Reputation: 5,313

Post » Sat Aug 20, 2011 5:44 pm

It's ok scidave I have figured it all out now, thanks to Jayjay's help.

I have not had a repeat of the issues, pairing network conditions with other conditions. I'm not sure what the problem was at the time but I must have had something so arse-backwards it just failed to work as expected.

If I come across any more problems like this I'll be sure to send it your way though.

Big thanks, lastly... to Jayjay for giving me some much needed guidance on his knowledge of the plugins functionality and usage to date. I now have a nice working model for multiple connections and data flow control.

Thumbs up.

~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 » Sat Aug 20, 2011 9:18 pm

[QUOTE=SoldjahBoy]Big thanks, lastly... to Jayjay for giving me some much needed guidance on his knowledge of the plugins functionality and usage to date. I now have a nice working model for multiple connections and data flow control.[/QUOTE]

No problem SoldjahBoy, glad to help Can't wait to see what you make of your game though

Edit: Hey SciDave, if you ever want to make a condition/action of your plugin highlighted, I think you just need to put a * at the start of its name.Jayjay2011-08-22 02:00:56
"Construct 4 lets YOU make advanced games! (maybe)" Construct Classic - Examples Kit
B
86
S
28
G
13
Posts: 2,092
Reputation: 15,009

Post » Mon Aug 22, 2011 2:48 pm

OK so, I know this plugin is still in early stages etc, but I just wanted to ask some questions regarding performance, scidave.

I notice that with only a handful of players connected (4-6) that there is a fair bit of lag when transmitting x,y position and angle of each player, as well as a Name and UID for each player.

Distance doesn't seem to be a HUGE issue, though internet speed seems to play a larger part... but even then it seems to get super laggy after only a minute of people being connected, and that lag seems to stack.

Am I doing something wrong or is this just the way it works as of now?

If the former, what is the best way to send packets? Is an always command a bad thing?

If the latter, can we expect to see performance increases over time? How do you plan on tackling this (if at all)?

Cheers in advance :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 Aug 22, 2011 3:08 pm

@Soldjah: Sending a couple of values every tick is something i wouldnt recommend, its better to send it, maybe every 5 ticks or even 10 and use lerp to smooth out the movements. It all depends on how fast the game is, so for a fast-paced game, say a shooter, you'd need to send a lot more packets in a short time, but for a slower game, less packets and more lerp.

I'm pretty sure there are other people who have said the same as me, and im sure there are people with better methods than me, but those are my recommendations ;)
B
3
G
1
Posts: 4
Reputation: 483

Post » Mon Aug 22, 2011 3:18 pm

Sounds like what you need is something like timedelta for lag.
Image Image
B
161
S
48
G
91
Posts: 7,359
Reputation: 67,273

PreviousNext

Return to Work-in-progress addons

Who is online

Users browsing this forum: No registered users and 0 guests