Register FAQ Search Today's Posts Mark Forums Read
Go Back   JazzJackrabbit Community Forums » Maintenance & Feedback » JJ2+ Issue Tracker

Bug Report Accurate JJ2 pings

Kyro Kyro's Avatar

JCF Member

Joined: Jul 2013

Posts: 6

Kyro has disabled reputation

Jul 7, 2018, 05:38 PM
Kyro is offline
Reply With Quote
JJ2 pings

JJ2 pings are not accurate, its increased by more than 10 ms

__________________
Code:
A7a

Last edited by Kyro; Jul 7, 2018 at 05:50 PM.
Seren Seren's Avatar

JCF Member

Joined: Feb 2010

Posts: 800

Seren is a name known to allSeren is a name known to allSeren is a name known to allSeren is a name known to allSeren is a name known to allSeren is a name known to all

Jul 8, 2018, 03:17 AM
Seren is offline
Reply With Quote
Ping is a program meant specifically for testing network delay between two hosts. It performs next to no other actions besides sending and receiving ICMP packets and as such is an idealized environment capable of performing this measurement very accurately.

JJ2 can for the most part be considered a single-threaded program and it does not process packets immediately when they're received. Instead, it queues them up and processes them at one point in the game loop. This is unavoidable for packets that modify the observable state of the game, i.e. most packet types.

The JJ2 game loop runs about 70 times per second. It needs to do so in order for all game objects to be processed at the intended pace. This means that it runs approximately once every 14 milliseconds. On average, the delay between receiving and processing a packet will thus be about 7 ms. The server has to process an echo request packet in order to send an echo response, which will last about 7 ms, and then the client has to receive and process the response to determine the delay, which amounts to another 7 ms. On average, the delay added to network delays should be about 14 ms. When I host a local server and join it with a local client, my ping fluctuates somewhere around that value. Your results appear to be similar.

I haven't dug into the code, but I believe it should be possible to create a special case for the ping packet that ensures it's processed immediately. However, I question the utility of doing so. The currently shown values of ping indicate the expected processing time of packets sent between the server and the client, and in that regard it is accurate, because all packets undergo the same delays as ping packets do. If ping packets were processed separately, they would more accurately reflect network delays between the hosts like the ping tool does, but they would be the only type of packets for which those values are meaningful.

As such, I'm leaning towards declaring this wontfix.
__________________

I am an official JJ2+ programmer and this has been an official JJ2+ statement.
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT -8. The time now is 02:55 PM.