User Tag List

Results 1 to 5 of 5

Thread: Lacewing Ping

  1. #1
    Forum Moderator Multimedia Fusion 2 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export ModuleXNA Export Module
    DizzyDoo's Avatar
    Join Date
    Oct 2006
    Location
    South England
    Posts
    718
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Lacewing Ping

    Hey, I have two ping related questions I'd love to know the best solutions too.

    1) I have a player connected to the server, to show the connection speed every second I send a UDP stack at the server, and it sends one back, and the time between them is displayed in a counter. However, since my MMF2 app only updates 50 times a second, this means I can only display a ping in multiples of 20 milliseconds. The minimum ping one can have is 20. Is there any better method? Sounds like a thread is needed.

    2) I have a Master Server, written in Python, that contains a list of IP's running Lacewing Servers for my game. A player can get this list to see all the games they could join. I'd like to display the time it takes for a ping from that player to an individual server. Is there a method to send a UDP packet to a Lacewing server and have it reply, without that player having to go through connecting, setting a name, and then sending a message? For a list of 100 servers, to do that for each one would take a while.

    My current method (for both issues) is to be using the Python object to open a socket connection and do pinging on a different port. I don't think this is as pleasant as using the Lacewing objects and just using one port, hopefully I'm just missing some feature buried somewhere.

    Thanks!
    Cranktrain - Currently finishing a new game called The Cat Machine!
    @MattLuard on Twitter.

  2. #2
    Clicker Fusion 2.5 MacFusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export ModuleUnicode Add-on
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)Firefly 3D Module (Steam)
    Phi's Avatar
    Join Date
    Jan 2010
    Location
    England
    Posts
    1,964
    Mentioned
    25 Post(s)
    Tagged
    0 Thread(s)
    No, seems quite accurate, although Darknet object records ping in a similar fashion, Lacewing object is single-threaded basically because you don't need it to be otherwise.
    You can game the system by bumping the frame rate, but frankly I've never got better than 400 fps, which gives me the minimum ping of 2.25ms.

    For idea 2, I suggest having a time-based ping update process instead of a message-based process. You can do this in a thread, but I'm not experienced enough with Python to go into detail, but I did use threads in the Anaconda ZlibStream port.

  3. #3
    Forum Moderator Multimedia Fusion 2 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export ModuleXNA Export Module
    DizzyDoo's Avatar
    Join Date
    Oct 2006
    Location
    South England
    Posts
    718
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by SortaCore View Post
    No, seems quite accurate, although Darknet object records ping in a similar fashion, Lacewing object is single-threaded basically because you don't need it to be otherwise.
    I meant for counting the ping, it needs to be outside the MMF2 loop, since that's too slow. Python scripts can be run outside of this ('non-blocking') anyway, but it'll hang while it waits so I could use a thread. Actually, now think about it I could just save the time and compare afterwards.

    Quote Originally Posted by SortaCore View Post
    You can game the system by bumping the frame rate, but frankly I've never got better than 400 fps, which gives me the minimum ping of 2.25ms.
    Setting the frame rate way up just isn't good enough, though I did contemplate it. It makes the rest of the game coding more complex (since you want that to run at 50fps) and where as I can get 500 or so on my main machine, my laptop can only get about 300.

    Quote Originally Posted by SortaCore View Post
    For idea 2, I suggest having a time-based ping update process instead of a message-based process. You can do this in a thread, but I'm not experienced enough with Python to go into detail, but I did use threads in the Anaconda ZlibStream port.
    Not sure what you mean by this, but I'll just keep going for now with what I have in Python so far.

    It would be nice to have a pinging/check-server-is-alive feature in Lacewing, but not completely necessary.
    Cranktrain - Currently finishing a new game called The Cat Machine!
    @MattLuard on Twitter.

  4. #4
    Clicker Multimedia Fusion 2 DeveloperSWF Export Module

    Join Date
    Jun 2006
    Posts
    6,773
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    1) Sorry, no (it's a limitation of the MMF event system that everything has to happen in the gameloop).

    2) You can send a server message as soon as you connect, no need to set a name. But you do need to establish a connection before blasting anything (so using a separate server might be the best you can do).

  5. #5
    Clicker Fusion 2.5 MacFusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export ModuleUnicode Add-on
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)Firefly 3D Module (Steam)
    Phi's Avatar
    Join Date
    Jan 2010
    Location
    England
    Posts
    1,964
    Mentioned
    25 Post(s)
    Tagged
    0 Thread(s)
    Doesn't liblacewing automatically mange pinging to check that server is alive?

Similar Threads

  1. Ping Pong
    By Looki in forum Released Extensions
    Replies: 11
    Last Post: 31st December 2013, 11:50 AM
  2. ICMP Ping?
    By pinacoladaxb in forum Lacewing
    Replies: 3
    Last Post: 7th February 2011, 03:22 PM
  3. Lacewing Ping fail
    By DJFuego in forum Lacewing
    Replies: 7
    Last Post: 29th March 2010, 08:53 AM
  4. Lacewing Ping example.
    By DJFuego in forum File Archive
    Replies: 3
    Last Post: 26th March 2010, 10:16 AM
  5. Ping
    By BrandonC in forum Lacewing
    Replies: 7
    Last Post: 9th April 2009, 11:13 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •