Jump to content

Late game FPS drop


Recommended Posts

Paused the game and saved about  a dozen times in a row. Did not see additional memory bloat.

Spoiler

image.thumb.png.6306c2510e4ea81fdfe1fd0613334361.png

However, when I quit to the main menu, memory was not freed.  Re-loading the game increased the footprint by another 400mb.  Without continuing game play, saved the game again.  Resulted in another bump in memory.  Strangely, even though NOTHING gameplay wise changed, the save immediately following the load was about 0.1mb smaller than the save immediately before.

I should also point out that exiting to the main menu at this point takes approximately 40 seconds, while loading the save takes about 35.  Anyway, I repeated the pattern 5 more times: Quit to main menu, resume, save, quit to main menu, etc.  Each save added to the memory footprint, as did each load.  The save file size remained unchanged.  At this point, my RAM was nearly full so I unpaused the game and let it run.  FPS was now averaging 31 to 32 for a significant drop of 5fps.

Spoiler

image.thumb.png.0c1b20142a3cc7420918c454266aeccb.png

 

So we've got a couple problems that I can see: There's a memory leak when quitting to the main menu and returning to the game.  There is also a memory leak associated with file saving.   There does NOT appear to be a connection to the reports, as disabling autosave but letting the reports build up did not affect game play.

Link to comment
Share on other sites

This has been pointed out before, but there's a rather large difference in loading time between loading on a freshly launched game versus loading while already in the game.  Personally, I always close the application before loading, as it's significantly faster overall.

Link to comment
Share on other sites

10 hours ago, miauly said:

For me game went laggy on cycle ~200, and I have most of the map and space undiscovered yet, and not that much of a developed base. Maybe the reason is that I like to ranch shine bugs just for nothing and they fly all around the base in numbers.

Alright, I loaded your save.  I'm running Linux Ubuntu Mate (18.04) on an Intel i5-4690S (low power) running at 3.2GHz.  I have 16gb RAM (currently, though I could have up to 64GB).   My graphics card is a GeForce GTX 750 Ti (also low power).  Its a desktop, but while running your save on turbo speed, my system was drawing an average of only 80 watts of power -- so I don't exactly have a performance system.  That said...

Your save is running between 40 and 55 fps.  It is fluctuating wildly.  When paused, FPS jumps to 60, which suggests that much of your FPS hit is the pathfinding algorithm.  Getting rid of about 20 shinebugs made the FPS stabilize around 47.

 

I'm currently putting together a system with embedded graphics, but it would have a higher-speed processor. 

Link to comment
Share on other sites

8 minutes ago, KittenIsAGeek said:

 

yep on qol mk3 loading any map and then going to main menu doesn't dump the memory, loading another map just increases memory. even just loading a map while in game doesn't dump the memory. wow! that's a pretty nasty memory leak.

Link to comment
Share on other sites

18 minutes ago, Nitroturtle said:

This has been pointed out before, but there's a rather large difference in loading time between loading on a freshly launched game versus loading while already in the game.  Personally, I always close the application before loading, as it's significantly faster overall.

Usually I close the application as well, but that's generally because I rarely drop to the main menu after I've started playing.  When I'm done, I just close out.  

I let @M.C.'s Darkest Citadel run for another 50 cycles on turbo speed, with autosave disabled.  Absolutely no FPS drop or memory bloat, even though reports continued to be generated.  While the reports DO add a little to the save file size, I'm fairly confident at this point that they aren't the cause of the problem. 

However, every time I saved, there was a little bit of memory bloat.  Saving at autosaves introduced memory bloat on a logrithmic curve -- the first save hit the hardest, with each following save affecting the running memory a little less.  After 100 cycles, it was only noticeable when looking at a change of 10 cycles or so.  Multiple saving didn't affect FPS, but multiple reloading did. Reloading SIGNIFICANTLY increased memory bloat.  Each load consistently increased the memory footprint by roughly the same amount that the initial load of the save did.

As has been pointed out before, ONI is very heavy on single-core processing.  You can change FPS dramatically by changing autopathing permutations, how much gas interaction there is, how you use your storage containers, etc.  

So, currently, here's how I see the state of things:

  1. Reports do not directly affect game performance.  They do impact the save file size, but this is minimal per cycle -- though it does add up over time.  Still, it doesn't affect the FPS or the save time.
  2. Saving the game introduces a small memory leak that does affect game performance.  I saw a drop of 5 or so FPS over 60 cycles where nothing in the game changed other than providing for the dupes survival.  This same drop did not occur when autosaves were disabled.  Additionally, the memory footprint steadily increased with every save, resulting in a significant performance hit once the main memory was full.  Quitting to the desktop and restarting the game removed the 5 FPS performance hit.
  3. The game does not clear out its memory space when you quit to the main menu.  Resuming the game re-loads it from the save, creating a new memory space.  This means that after only a handful of quit/reload combinations, your memory will be full and you may have a harsh performance penalty or a system crash.
  4. Pathfinding significantly affects overall FPS. 
Link to comment
Share on other sites

6 minutes ago, JohnFrancis said:

Oh can you test out my old map, it's a cycle 2000+ map and took an age to load and my fps was about 10-15. I'm curious if there is a difference in performance between  the different OS's and hardware.

Deadly Factory cycle 2112

It took about 2 minutes to load.  On turbo, I'm getting about 25 FPS.  Changing some of the pathfinding gave me another 2fps.  Dropping to normal speed put me at 33 to 35fps.  Saving took about 9 seconds and the first save added 1.4gb to the memory footprint with the first save.  Which is quite significant, since the total memory footprint for the map when freshly loaded is only 3.7gb.

Link to comment
Share on other sites

4 hours ago, KittenIsAGeek said:

It took about 2 minutes to load.  On turbo, I'm getting about 25 FPS.

My computer is a bit below average so that tracks. I wonder if it's my DDR3 memory that is the bottle neck.. Thanks for testing the map it nice to know that late game slow down is unavoidable. Also that huge loading time is a annoying, the price of playing late late game.

Link to comment
Share on other sites

10 minutes ago, JohnFrancis said:

My computer is a bit below average so that tracks. I wonder if it's my DDR3 memory that is the bottle neck.. Thanks for testing the map it nice to know that late game slow down is unavoidable. Also that huge loading time is a annoying, the price of playing late late game.

Memory DEFINITELY helps a lot.  I see a significant difference between 1600mhz DDR3 and 1200mhz.  There's also a huge difference if my game causes my memory to hit the swap file.  You have to remember, this is a huge number-crunching simulation.  There are multiple calculations run on every cell of the map, plus calculations for power, gas and liquid piping, etc.  This is far too much information to hold in the CPU, so it has to constantly swap data between the CPU  and RAM.  

Link to comment
Share on other sites

5 hours ago, KittenIsAGeek said:
  1. Reports do not directly affect game performance.  They do impact the save file size, but this is minimal per cycle -- though it does add up over time.  Still, it doesn't affect the FPS or the save time.
  2. Saving the game introduces a small memory leak that does affect game performance.  I saw a drop of 5 or so FPS over 60 cycles where nothing in the game changed other than providing for the dupes survival.  This same drop did not occur when autosaves were disabled.  Additionally, the memory footprint steadily increased with every save, resulting in a significant performance hit once the main memory was full.  Quitting to the desktop and restarting the game removed the 5 FPS performance hit.
  3. The game does not clear out its memory space when you quit to the main menu.  Resuming the game re-loads it from the save, creating a new memory space.  This means that after only a handful of quit/reload combinations, your memory will be full and you may have a harsh performance penalty or a system crash.
  4. Pathfinding significantly affects overall FPS. 

1. I should have probably been a bit more clear on this. I never thought reports affect FPS. They do, however, affect both save and load time, making the game appear more sluggish than it has to be.

2. The effects you are describing don't sound like a memory leak. They are more consistent with excessive garbage creation. It's nice to know the effect is limited, though.

3. I appreciate your looking into it, but I don't think your conclusions are entirely accurate.

4. I know, but... being forced to play the game in a certain way to maintain high FPS is very distracting. I don't want to worry about pathfinding algorithms or memory management or memory leaks or garbage collection when I am playing a game. I do have to agree with you here. Klei's (painfully naive) pathfinding implementation is hot garbage.

In any case, thank you for spending your personal time looking into this for me.

Link to comment
Share on other sites

Yea- I really hope this game improves/fixes the game performance problem.
I can see this being the negative issue in the reviews when people post their reviews on the game.

Currently, the game just drops in performance with each passing cycle.  The auto-save time, lags over time the longer you play. And the save files bloat and increase incrementally per cycle.   The load time for save files becomes a massive pain.  Trying to save scum care package (or Neutrel Vasculator) and you will know what I mean,   it can take 3-5 minutes to just load the game.  And that's before it even starts processing the data it loads, because  it starts paused and it doesn't show you all the inventory items or what not, so its basically just loading the data before even doing calculations.     Could be because its uncompressing the large save file before reading the data.

And then there is the performance (drop in frames per second) while playing.   Gets worst as you uncover the map.   I did notice what others have described here.   If you dig out stuff and reveal/uncover stuff, the game lags more!      

It's kind of a running  joke now  that the endgame = game over when your computer blows up where you can't do anything anymore because of the performance of the game.      it probably needs some sort of real end game before the game just dies on you.

Link to comment
Share on other sites

I kind of given up playing ONI  or having less desire to continue playing past  100-200 cycles knowing the game is going to start lagging.

There really isn't a whole lot of challenge to the game   once you can just sustain yourself with oxygen and food.
After that you could just clear the entire map with an exosuit.     Going to space is just optional.   
The game is basically over once you get pass the initial   Oxygen and Food problem.   Anything after that is just  going to add to your lag problem. with no real final end game goal.

I suppose the only other challenge is getting Steel production to stop the asteroid from getting wiped out by the meteors destroying your biome/base.
Once you have enough to just fill a row of bunker tiles across the top of the map- that's pretty much it.

They need to add in a reach the final planet as a goal-  and to do that requires obtaining materials from other planets that can't be found on the existing asteroid you're on.    Then it's basically just  Get to the final planet before the LAG MONSTER gets you. 

Link to comment
Share on other sites

I don't really feel the need for an end goal.  I'm constantly changing things within my base, trying different ways of doing things.  "Oh, I don't like how that looks.  What if I rebuilt it like so?"  Or, "Can I make this boiler more efficient?"  Or, "is liquid hydrogen a viable coolant for smelting?"  Turns out, weird things happen when you pipe it into the smelter...

Anyway, you get the idea.  In my mind, there's no end point other than the goals I set for myself as I play.

Link to comment
Share on other sites

9 hours ago, KittenIsAGeek said:

I don't really feel the need for an end goal.  I'm constantly changing things within my base, trying different ways of doing things.  "Oh, I don't like how that looks.  What if I rebuilt it like so?"  Or, "Can I make this boiler more efficient?"  Or, "is liquid hydrogen a viable coolant for smelting?"  Turns out, weird things happen when you pipe it into the smelter...

Anyway, you get the idea.  In my mind, there's no end point other than the goals I set for myself as I play.

That's fine and all.   And that can just be 'sandbox mode'.   Or it can just be a optional continue sandbox if you want.   

It's like how Anno 1800 works.  They have a campaign, that ends.  And after the campaign, it just goes into sandbox.

Even in Thea Awakening, after you won the game,  you can choose to continue the game via sandbox if you just want to keep playing.

The general idea, is for those who need an end goal.   Like in Don't Starve, while it's sandbox,  there's the Adventure mode that is somewhat like the end game.   If there's no end game, its just basically, when the game starts to lag and you don't feel like dealing with it anymore.   The End.   (which is kind of anticlimactic/lackluster imo.)

Link to comment
Share on other sites

As I enabled my FPS counter on laptop to find out I even start the game on 14 FPS, I got really sad about playing further as I now started to notice all the lag. So I thought I can add yet another data point to this thread to attract more attention to the issue.

I have tested my save and other two here on the following setup - CPU AMD Rizen (16 cores, 3.4GHz), 32 Gb RAM, RTX 2080 Ti (screen resolution is 2560*1440 if that matters for performance). To start off, this one is able to run Sekiro and Dark Souls III on 60 FPS (which is the locked max value), with all settings maxed out. Dota II AutoChess runs on 120 FPS which is also locked max.

For ONI the results are as follows:

  • 30 FPS flickering - my own save with shine bugs
  • 30 FPS dropping to 20 if I scroll the map - Darkest Citadel
  • 16-17 dropping to 15 if I scroll the map (and more than 2 minutes to load the map) - Deadly Factory

This setup is actually not geared towards gaming but for running some computations on it, but it is still way more than ONI system requirements are. Still, ONI demands more than graphics-heavy recent games.

I should also note that on 50 FPS (which are there when I start a new game) ONI feels like a totally different game. Everything seems to happen so quickly even if I know that in fact it should be the same speed. Way better experience as it feels for me.

Link to comment
Share on other sites

1 hour ago, miauly said:

As I enabled my FPS counter on laptop to find out I even start the game on 14 FPS, I got really sad about playing further as I now started to notice all the lag. So I thought I can add yet another data point to this thread to attract more attention to the issue.

I have tested my save and other two here on the following setup - CPU AMD Rizen (16 cores, 3.4GHz), 32 Gb RAM, RTX 2080 Ti (screen resolution is 2560*1440 if that matters for performance). To start off, this one is able to run Sekiro and Dark Souls III on 60 FPS (which is the locked max value), with all settings maxed out. Dota II AutoChess runs on 120 FPS which is also locked max.

For ONI the results are as follows:

  • 30 FPS flickering - my own save with shine bugs
  • 30 FPS dropping to 20 if I scroll the map - Darkest Citadel
  • 16-17 dropping to 15 if I scroll the map (and more than 2 minutes to load the map) - Deadly Factory

This setup is actually not geared towards gaming but for running some computations on it, but it is still way more than ONI system requirements are. Still, ONI demands more than graphics-heavy recent games.

I should also note that on 50 FPS (which are there when I start a new game) ONI feels like a totally different game. Everything seems to happen so quickly even if I know that in fact it should be the same speed. Way better experience as it feels for me.

My system, by comparison, should be faring a lot worse.  Its a 4-core i5 at 3.2ghz with (currently) only 16gb RAM.  Yet maps with 2000 cycles are still in the 30fps range.

The discrepancy you're seeing between ONI and graphics-heavy games is that most games are bottlenecked by your GPU.  Rendering 3d textures is fairly computationally intensive, but your graphics hardware is designed to handle it and in this era it is all multi-threaded.  ONI, on the other hand, has almost zero GPU overhead.  The vast majority of the game is spent in single-thread CPU calculations.  The Rizen is built around multi-threading, and excels when you've got multiple things going at once, which is an advantage with modern operating systems.  However, when it comes to pure number crunching on a single thread, the Rizen doesn't fare quite so well -- it wasn't designed for that.

Link to comment
Share on other sites

My experience with a 2000, 3000 and 5000 cycle base is that the save file increases linearly and the auto-save time gets slower. I've read in some posts that it is likely the compression of the save file itself. I'm not sure how much the reports are part of the save file inflation though. I begged the devs for a config option for auto-save frequency with never being an option. I've attached a 40Mb save file if anyone is curious.

I did notice that debug mopping the magma at the bottom gave me about 10-15 fps boost. Most of this magma was trapped by nutronium.

r166.sav

Link to comment
Share on other sites

@KittenIsAGeek , I can understand what may be reasons why this setup does not make ONI fly. And you are right, Rizen is there exactly to run multi-threaded computations. I tested this setup not because I was thinking it would go way better than yours. There's no reason for it if everything is single-threaded and I have no reason not to believe you that it is single-threaded. What I thought is that there's still a difference in how arguments are perceived, even valid ones, and how a tested fact is perceived. So I wanted to present here a data point that shows that even pretty heavy gear can't keep ONI up to speed.

Being a programmer, I can understand that it's not as simple as it sounds to utilize more than one core when they are available. But then if the game stays single-threaded, what is the expected hardware to run it? CPUs single core clock rates don't get that much higher. Not to mention that nowadays laptops are really popular even for gaming, and their clock rates are lowered for better battery life.

Link to comment
Share on other sites

Right.   I do believe that with most of the core game done, focus will be spent on refining the various algorithms to reduce system impact.  We've already seen the pathfinding task become multi-threaded, so I'm sure Klei will do the same with other tasks.

I apologize for misunderstanding your post.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

×
  • Create New...