Go back to previous topic
Forum Name Gameplay
Topic subjectWeather update code and skipping game loops.
Topic URLhttps://forums.carrionfields.com/dcboard.php?az=show_topic&forum=6&topic_id=72187
72187, Weather update code and skipping game loops.
Posted by Tac on Wed 31-Dec-69 07:00 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.
72189, RE: Weather update code and skipping game loops.
Posted by Thaedan on Wed 31-Dec-69 07:00 PM
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".
72190, Yeah... It's noticable on a lot of things...
Posted by Tac on Wed 31-Dec-69 07:00 PM
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.
72199, He's talking server processing time with spammed commands
Posted by Kstatida on Wed 31-Dec-69 07:00 PM
So network is half-irrelevant here.
72201, RE: He's talking server processing time with spammed commands
Posted by Thaedan on Wed 31-Dec-69 07:00 PM
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.
72188, RE: Weather update code and skipping game loops.
Posted by Jhyrbian on Wed 31-Dec-69 07:00 PM
So can this potentially explain the lag bug people have been whining about?


edit: oh missed that line where you mention it