Stencyl 3.4.0 is now out. Get it now!

UDP Extension : Near realtime online multiplayer network communication

letmethink

  • *
  • Posts: 2530
Sorry for being awkward, but still no ping is showing.
~Letmethink

mdotedot

  • *
  • Posts: 1232
Hi LetMeThink,

I'm not sure what you mean with ping.
Is it telling 'Not Connected' with a speed of -1? And how long did you run it? Are you on WIFI or on cell?
UDP can be blocked by firewalls so it could be that you experiencing something like that.

I did see the Not connected with one of the android devices on some  occassions but after I made the change to check for connection each 0.5 second I re-connected and the app worked in the end.

Being awkward is not the issue. It is good that everybody knows that making a multiplayer game will give you far more troubles than anything else! People should be warned to be prepared by faillures in connection and especially that you can't control everything so there will always be some people that will not be able to play multiplayer games. Due to terrible network connections or security measures in between the sender and receiver.

Best regards from
M.E.

Best regards from
M.E.
Hanging out in the Chat:  http://www.stencyl.com/chat/

letmethink

  • *
  • Posts: 2530
All that shows up is this:

I'm guessing it is an issue with scaling perhaps.
~Letmethink

mdotedot

  • *
  • Posts: 1232
Ha Ha LetMeThink,

There is nothing wrong with your TV-set. Do not adjust it ...

But serious: When another connection from another device is made you will see another eye (or eyes when there are multiple connections) The aim is to push the other actor into the ring so you can score :)

It is not an actual game and more of a tech-demo. The letterbox setting I used for publishing could be influencing your device.
But I understand that you want to see the actual speed. I will make a version with the text in the middle to satisfy your need!

I'm online with my android phone for a short while so if you are still on-line and give it a go we could fight :D

Best regards from M.E.
Best regards from
M.E.
Hanging out in the Chat:  http://www.stencyl.com/chat/

Donni11

  • *
  • Posts: 2174
Hi mdotedot :). Um how exactly do install this extension ? The normal way you install all extension ?
The Stencyl Discord Channel , Where the real Stencyl work happens ;).

Donni11

  • *
  • Posts: 2174
Okay I found out how to install it . But I curious what is the difference  between this extension and this one you created ?
The Stencyl Discord Channel , Where the real Stencyl work happens ;).

mdotedot

  • *
  • Posts: 1232
Hello Donni11,

The online scoreboard extension uses TCP communication and is too slow to provide near realtime coordinates.
TCP is slower but it provides more data communication per-cycle, all packets are send and received in order and there is some error-correction. This makes this communication ideal for turn-based systems where you want to be sure about the communication.
Also sending/receiving database kind of data like a scoreboard is perfect for TCP communication since you can rely on the communication rather than the UDP connection that this extension is using.

Hope I explained it a little bit.

Best regards from
M.E.
Best regards from
M.E.
Hanging out in the Chat:  http://www.stencyl.com/chat/

Donni11

  • *
  • Posts: 2174
Thanks :) ! Are you planning to build a online scoreboard extension using UDP ?
The Stencyl Discord Channel , Where the real Stencyl work happens ;).

mdotedot

  • *
  • Posts: 1232
I don't think you understood what I was saying. UDP is only necessary for near realtime communication.
Scoreboards don't need realtime communication and can wait a second before downloading the content.

Best regards from
M.E.
Hanging out in the Chat:  http://www.stencyl.com/chat/

Donni11

  • *
  • Posts: 2174
Oh , so is it possible to create multiplayer with the Scoreboards ( possibly ) ?
The Stencyl Discord Channel , Where the real Stencyl work happens ;).

Could this be used to auto connect to a server on the same LAN? I am looking for my app to automatically obtain an IP address from the host computer which will change. I need the app to auto discover where the server is on the network and define that servers IP as a variable in the app. Could this achieve that?

mdotedot

  • *
  • Posts: 1232
Hello theCloudMediaGroup,

That is not something that this extension does.

If I understood you correctly you want the app to know about a server who's address can change? Usually that is done through DNS which allows you to use a name and it will look that name up. If the IP address change the address is changed in the DNS record.

BUT ... if you really want an IP address and don't have access to the DNS records you could use a public location that is NOT changing. For instance a dropbox/google drive location. Use a textfile on that service with the IP address of the server and once it changes you can adjust the text file and the server can be found.

If you have access to the server and can put scripts on it you could make a schedule that automatically updates that dropbox/google drive file with its IP address so that you don't even have to bother afterwards.

Hope this helps.

Best regards from
M.E.
Best regards from
M.E.
Hanging out in the Chat:  http://www.stencyl.com/chat/

Bhoopalan

  • *
  • Posts: 982
Great idea. I will try this in my current game.
If I helped you at anytime, help me back build my twitter followers :)
https://twitter.com/imbhoopalan

Wesxdz

  • Posts: 80
I've  managed to setup a basic LAMP server and connect to it, however, I haven't managed to send any data between two clients yet.  The udp IS connected. I DO get a speed returned when I send data.

When I connect I get this error:
PHP Notice:  Undefined index: 10.0.0.31_55789 in /home/wesxdz/Downloads/udp_server.php on line 71
Remote IP: 10.0.0.31 Appid:0 RoomID: 0 Level: 1 UserID: 1 Echo: 1
corresponding to this line: if($heartbeat["".$AppID]["".$RoomID]["".$Level]["".$remote_ip."_".$remote_port] < 1){

Afterwards, every time I send data I get these errors:
PHP Notice:  Undefined index: 10.0.0.31_55789 in /home/wesxdz/Downloads/udp_server.php on line 116
PHP Notice:  Undefined index: 10.0.0.31_55789 in /home/wesxdz/Downloads/udp_server.php on line 118
and corresponding to:
$userid=$userID["".$AppID]["".$RoomID]["".$Level][$datakey];
if($datakey == ("".$remote_ip."_".$remote_port) && !$isEcho[""

I'm running the PHP file from ~$ php -f /home/wesxdz/Downloads/udp_server.php
I have portforwarding setup. I'm not sure if there's something more complicated I need to do.

Basically, any help would be greatly appreciated. It's difficult to use this extension because there are no .stencyl examples.

I eventually just want to communicate mouse coordinates.


« Last Edit: April 08, 2016, 03:46:46 pm by Wesxdz »

mdotedot

  • *
  • Posts: 1232
Hello Wesxdz,

The error messages come from PHP when you access indexes that are not there (yet).
I should have checked the indexes before accessing the array but as this is on the server-side I didn't really bothered.


I will send you the .stencyl file via your private mail on Stencyl.

Check out the chat room during non-working-hours on CEST since I frequently visit it to discuss in-depth issues you might have.
Best regards from
M.E.
Hanging out in the Chat:  http://www.stencyl.com/chat/