Small freezes / fps drops with increased frequency when speeding up game

Started by RayZoar-Z, July 10, 2019, 06:05:10 PM

Previous topic - Next topic

Kaelen Mosar

Iam happy that i found this thread.
I recently returned from a rimworld break since spring 18.
Back then i used like 150 mods and had no stuttering.
I used fps monitor to visualize frametime spikes and even in an unmodded vanilla new game i get them on 3x speed like every 40 seconds?
if i load 2 mods - mod manager and combat extended the frametime spike at 3x speed occur more frequent and it is also visible to the human eye as a micro stutter.
guess what the more mods, the more insane the stutter.

I reverted to b18 and loaded some b18 mods, no stuttering <3
Don't get me wrong but something must happen. I don't understand how people are able to play these days. I even see up to date let's plays with stutters :D and these guys like they dont recognize it.

Specs i7-8700k and a nvdia 1060 first i thought my cpu crapped itself and testet it on another machine with identical specs, same results.
So any ideas, any fixes? I want to enjoy my old rimworld again but i can not stand this stutter.
Thanks

ReZpawner

Quote from: Tynan on November 10, 2019, 08:05:58 PM
Quote from: ReZpawner on November 10, 2019, 10:56:37 AM
This is a bit of a shot in the dark, but during my own development in Unity, I came across someone mentioning that strings could cause stuttering and tiny lagspikes due to garbage collection, and that the way around it was to use stringbuilder instead of strings. It just stuck with me since it describes the problem that a lot of people are having in Rimworld at late game. Could this be relevant?

Building complex strings with repeated string allocations is one out of a thousand things that can spew memory and make GC spikes. Vanilla doesn't do it, but some mods probably do.
I have to disagree there. Very late game (we're talking 10-20 years in), the game slows down considerably. Some of it can be attributed to job-spam for cleaning\hauling, but it still has the microstutters when those jobs are turned off. I can't be certain of what actually causes it, but it would make sense if it had something to do with string garbage collection, since the number of excellent artpieces\weapons\gear are sure to generate a LOT of names. It could also be the history\events that are stored, but I can't be sure of this. Others have theorised that too many storage areas are to blame.

Some useful things I have found to help are:
When setting up crafting tasks (until X), specifying storage helps, so the game doesn't have to check every single storage area.
Have 1-2 pawns do cleaning, remove the rest.
Have 3-4 pawns do hauling, remove the rest. (these numbers will obviously vary depending on the size of the colony).
Using a cleanup mod to remove the dead pawns also helps significantly, but this requires modding (in a modded playthrough I had literally thousands of these taking up resources, responsible of about 50% of the savegame size, which at the time was 70+MB. ).

None of this is meant as criticism btw, I absolutely love the game and the work you've done, from kickstarter to post release. I just would really love it if the lagging would go away, as it diminishes the enjoyment we get from the game.

Tynan

If you've got a vanilla savegame with performance issues can you just email it to me? [email protected]

It'd be useful to be able to take a look; these cases are hard to reproduce in-house.
Tynan Sylvester - @TynanSylvester - Tynan's Blog

ReZpawner

I tend to delete the saves when starting new colonies, but I did start a new unmodded game yesterday, so I should have one in a day or two that I can send to you. Hopefully it'll help!

Tynan

Quote from: ReZpawner on November 12, 2019, 04:53:59 AM
I tend to delete the saves when starting new colonies, but I did start a new unmodded game yesterday, so I should have one in a day or two that I can send to you. Hopefully it'll help!

Much appreciated :)
Tynan Sylvester - @TynanSylvester - Tynan's Blog

ReZpawner

Quote from: Tynan on November 12, 2019, 10:24:59 PM
Quote from: ReZpawner on November 12, 2019, 04:53:59 AM
I tend to delete the saves when starting new colonies, but I did start a new unmodded game yesterday, so I should have one in a day or two that I can send to you. Hopefully it'll help!

Much appreciated :)
No problem. It'll take a few days I think, since I'm only at around day 450  now, and real life is interrupting the playthrough a bit. The good news is that there's no stuttering to report yet.

atewithouttabIe

Quote from: ReZpawner on November 14, 2019, 08:36:53 PM
...The good news is that there's no stuttering to report yet.

..thats actually bad news in that context here.

My "Story" w the game regarding performance / stuttering is kinda vanilla as well...
Played the game through A16-17-18 and some B19 before meh, sorta burned out and let it rest for a year - my biggest colony during that time had 25 Colos, some 100+ Animals on top of 50+ Hauler Huskies and aside from the Idle Pawn stutters, which were fixed by setting day/night shift schedules the game ran fine, that is with mods of course, at that point i had some 150 installed because its just too enticing "Ohh, i need that...and that...i WANT this OMFG...givegive!"

Imagine my surprise when i finally started to get back into it w 1.0 and with a culled&updated modlist down to about 80 of the same mods i had before, just some superfluous stuff removed or stuff i never actually used before either and - once you hit like, year 5 and between 12-15 Colonists (im picky...) the game becomes a Stutterfest - no matter how you set up schedules, no idle pawns, NO animals whatsoever and i couldnt figure out why considering pre-1.0 i had much more going on and it was smooth-ish sailing...

The funny thing is this tho - when you load a save, after starting the game, obviously...and just let it sit there and run on normal speed stuttering along and all - after about 20-30mins of this stutter festival it clears up and becomes somewhat smooth-ish again for a few mins - OR something "big" has to happen within those 20-30mins like a Raid or mech ship crashing or whatever..all of a sudden the game runs w/o stutters for like 10-15mins, like the game engine has to take a shat first before its ready to go temporarily and then gets constipated again

Anyway - the base game has a problem somewhere - Mods can and do matter obviously, esp the ones adding simple Walls w "tickertype-NORMAL" for every segment of wall / pipe placed or some other nonsense like that BUT the problem is the base game, considering that even before those aforementioned mod hitches were fixed on my end ie before 1.0 the game was smooth-ish w much larger colonies and modlists

Kaelen Mosar

thank you for your 2 cents on this,

its pretty the same situiation i expirienced, played b17-b19 builds, even earlier ones
burned out

Came back installed game
grabbed all mods i wanted (was used to)
started playing and it took me a few minutes to recognize that something is wrong, it became so obvious that i discontinued to play the game in this state.

i mean vanilla is ok, but it becomes really pretty with this nifty mods out there.
Maybe tynan can tell what he changed from b19 to 1.x versions
And what changes can affect this, maybe he can find out whats makin our pretteh game lag

And i appreciate your long time test very much.



Check these,
look at the top left frame time bar

https://www.youtube.com/watch?v=uhO8aVsqT4E

https://www.youtube.com/watch?v=iMPiV6-OXY8

https://www.youtube.com/watch?v=NBd1DhsBc9o

Pangaea

There are clearly very different experiences about this. But one thing I don't get is the people who claim there are lag problems, and the proof is a tiny spike in a graph from a third party program. Meanwhile, the videos show that the actual game runs smooth as a baby's bottom. I'm sure others experience observable lag, otherwise so many people wouldn't write about it, but unless you actually see/experience lags...?

I don't have a vanilla game either, but run with relatively few mods. The colony is almost 10 years old, has 44 pawns and over 200 animals. And some exceptions aside (huge raids spawning for instance), I don't experience lag. There may very well be spikes here and there if I used a third party program like that, but if I don't actually see lags, I honestly don't care.

Unless there are big lag issues with pure vanilla games, it's not necessarily something that has changed in the vanilla game that causes these issues either (the real ones). Perhaps one or more mods that many people use have changed or expanded in ways that cause (more) lag.

For those who experience lags, I suppose the best suggestion is to send those save files to Tynan and let them check it out themselves. If there is an issue with the vanilla game, that will help them track it down.

thejazzmann

Another one reporting in.

1080ti here, stutters on both vanilla and modded. Obviously more severe with modded, but still extremely frustrating with vanilla.

atewithouttabIe


thejazzmann

Quote from: atewithouttabIe on November 18, 2019, 01:51:57 AM
Who is using Win10 here - pre 1809 version please if anyone?

Windows 10 here, but currently on the 1809 version.

Kaelen Mosar


atewithouttabIe

Hmhm....

Alright story time:

Yesterday, working, futzing around w Mods (adding, not removing because, game runs rather...not optimal anyway so pfht) in between real-life stuff, restarting the game like 20 times back and forth, restarting windows and all that...
Always the same: game runs, max FPS 27-30, GPU at idle speeds, same FPS when forced to max, Windows + game total memory usage hovering between 4.2-4.6GB etcetc..it was playable, sure but something seemed to throttle everything despite the fact nothing else was running cept windows (..doh)

So at some point, after i was done w the whole work / Mod futzing / rebooting windows and such stuff i say FINE, lets start it and just let it chug along for a while...and now it runs w 55-60FPS again / 50-60TPS, 3.2GB total phys memory usage and all peachilily to the point im loathe to turn it off if it werent for that nagging voice as well as a wet towel on head sometime around 1am from a certain female whom shall remain anonymous.

So, remember, i save the game w everything running fine sans the obligatory 1/3sec microstutter every 6-9secs alright...

A few hours later, turn PC back on do the usual stuff emails/work etc - alright, lets restart windows and then load Rimworld...load my save from 1am, the 55-60FPS/TPS 3.2GB usage one...and back to crap again - 27FPS/20-60TPS* and 4.3-4.5GB mem used,  no matter what - NOTHING had changed between 1am and NOW - wtf?

So..what now? Remember the "game has to take a dump first" thing i mentioned above?

Ya, on account of being a tad "irritable" at this point, i decide to make a save using words not repeatable here and then spawn a mild 4000 point raid - wait 5 mins - still 27FPS/20-60TPS and 4.3GB memory usage total (windows and game combined)...

...then the Raid spawns (aka the Game takes a "DUMP"...) and instead of the FPS going down further as well as the TPS...
...both go back up to NORMAL instantly ie 60/60
...the GPU finally starts to use something other than P5 state (324Mhz)
...total MEMORY usage drops instantly by 1GB down to 3.2GB (900MB Windows - 2.3GB Rimworld) despite there being 30 pawns more on the Map pathing, snorting flake, telling dirty jokes, getting attracted to each other, hashtagging selfies ("#RAIDYOLO #metoo #tablesrock") etc..

Is Windows10 / Memory / Resource management etc being doofy?
Is the game being a nimrod?
Are both working in concert to purposefully display a level of incompetence usually only associated w public servants or uncoordinated preschool children trying to "wahs ur car w rocks, daddy LOOK!!"?

What...?

* Ticks Per Second - 60 being normal

thejazzmann

Quote from: atewithouttabIe on November 18, 2019, 03:52:05 PM
*snip*

I'm curious if you were to do the same thing and let the game take its dump then load a previous save, would it be running smoothly still? My assumption would be yes, since it's still the same instance running, thus it would continue to run as it should. I might do some testing myself later today and see what happens.