Subject: "Weather update code and skipping game loops." Previous topic | Next topic
Printer-friendly copy Email this topic to a friend CF Website
Top General Discussions Gameplay Topic #72187
Show all folders

TacThu 29-Nov-18 12:21 PM
Member since 15th Nov 2005
2050 posts
Click to send email to this author Click to send private message to this author Click to view this author's profile Click to add this author to your buddy list
#72187, "Weather update code and skipping game loops."
Edited on Thu 29-Nov-18 12:25 PM

          

My base assumption is that CF still runs on the 1/4 second loop as the code it's based off of. All of my testing indicates this is still the case, however...

I set up some precise timing stuff in my client, and noticed that when the weather is updated, the game misses at least one game loop almost every time. If it happens on a tick (which I think it always does) and that tick includes an autosave, it can skip more than one game loop.

I think this can cause some weirdness with skipping violence pulses (basically missing rounds of combat) and is generally just weird results. It shouldn't, as far as my understanding goes, affect the ordering for lag effects since the order there is based on decrements of the wait state which happens as part of the loop.

So it won't account for a lag "bug" if one exists (I remain unconvinced though some of the logs do look funky), but will have undesirable behavior.


I'd suggest moving autosaving off of the tick, and probably weather update as well, but also maybe taking a look at the weather update code to see if it can be optimized better to not take so long. I have no idea how easy or hard that would be.


FYI: Worst case I've come across was 7.6118 seconds between a two round lag skill/spell execution, which happened at the day/night transition. Following executions were back very near to the 6.25 second average, so something like 5-6 loops were skipped.

  

Alert | IP Printer Friendly copy | Reply | Reply with quote | Top

Thaedan (Anonymous)Thu 29-Nov-18 02:52 PM
Charter member
#72189, "RE: Weather update code and skipping game loops."
In response to Reply #0


          

This isn't exactly the same as what you're talking about, but the last time I did some testing I noticed some pretty variable latency when running simple minimal-lag commands (e.g. socials). Pretty sure it wasn't my network connection, so "something" was happening on the mud server to cause some small % of my social commands to take "longer than usual".

  

Alert | IP Printer Friendly copy | Reply | Reply with quote | Top

    
TacThu 29-Nov-18 04:06 PM
Member since 15th Nov 2005
2050 posts
Click to send email to this author Click to send private message to this author Click to view this author's profile Click to add this author to your buddy list
#72190, "Yeah... It's noticable on a lot of things..."
In response to Reply #2


          

Most of the time if a given command takes .3 seconds or whatever the next pulse comes faster and executes immediately and the next one takes .2 seconds and evens it out, but if it goes beyond .5, then the missed pulses are never made up.

  

Alert | IP Printer Friendly copy | Reply | Reply with quote | Top

    
KstatidaFri 30-Nov-18 02:48 AM
Member since 12th Feb 2015
2214 posts
Click to send private message to this author Click to add this author to your buddy list
#72199, "He's talking server processing time with spammed comman..."
In response to Reply #2


          

So network is half-irrelevant here.

  

Alert | IP Printer Friendly copy | Reply | Reply with quote | Top

        
Thaedan (Anonymous)Fri 30-Nov-18 03:50 PM
Charter member
#72201, "RE: He's talking server processing time with spammed co..."
In response to Reply #4


          

That's what I was talking about too. Subtracting network latency, in an ideal world, every "laugh" social I input should take approximately the same amount of time to execute and generate a response. Unless there was something wrong with my testing, that seemed not to be the case.

  

Alert | IP Printer Friendly copy | Reply | Reply with quote | Top

JhyrbianThu 29-Nov-18 01:32 PM
Member since 04th Mar 2003
917 posts
Click to send email to this author Click to view this author's profile Click to add this author to your buddy list
#72188, "RE: Weather update code and skipping game loops."
In response to Reply #0
Edited on Thu 29-Nov-18 01:33 PM

          

So can this potentially explain the lag bug people have been whining about?


edit: oh missed that line where you mention it

  

Alert | IP Printer Friendly copy | Reply | Reply with quote | Top

Top General Discussions Gameplay Topic #72187 Previous topic | Next topic