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&mesg_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.