Jump to content

FPS drop and CPU usage


Recommended Posts

Hi,

I am having some performance issues. When I run in "Fast speed" i am loosing a lot of FPS. Looks like the game is stuck at around 10FPS.

I have also started to experience those problems when my dupes started using Jet Suits.

 

What is strange is that my CPU (i7-6700K)  is at about 50% and my GPU (2080) is barley in use. I'm not sure what is the bottle neck.. perhaps it is some programming problem where the game has the proper speed but it skips frames deliberately?

4.PNG

Link to comment
https://forums.kleientertainment.com/forums/topic/97343-fps-drop-and-cpu-usage/
Share on other sites

ONI is CPU intensive.

There's an insane amount of math going on, calculating paths for every duplicant, mob, and object in motion, as well as gas interactions, liquid interactions, thermal exchanges, germ multiplication, etc.

There's far less GPU use compared to the CPU. I've heard that if you have a single core CPU running incredibly fast, ONI runs much better. One way to reduce the stress on your CPU is to clear all the floors, don't use jetpacks heavily, and limit pathing options for dupes.

1 minute ago, Saturnus said:

Use core affinity to lock it to one core, preferably CPU ID 1

I've heard people say this, but how is it done? I'm not incapable of changing BIOS options and CPU management, but I'd rather not screw around uninformed.

8 minutes ago, crypticorb said:

I've heard people say this, but how is it done? I'm not incapable of changing BIOS options and CPU management, but I'd rather not screw around uninformed.

Go to Task Manager -> Details tab, find and right click the ONI exe thread, select the Set Affinity option.

Unfortunately without additional software, and I don't know any that are freeware, there is no way to set persistent core affinities. Meaning you'll have to do it every time you start the game.

w8_processor_affinity-2-jpg.20635

4 minutes ago, Saturnus said:

Go to Task Manager -> Details tab, find and right click the ONI exe thread, select the Set Affinity option.

w8_processor_affinity-2-jpg.20635

Which CPU is ideal? You mentioned CPU ID 1, but wouldn't CPU 0 be closer to the main bus? Is there a way to determine which is best, or are they all the same?

Just now, crypticorb said:

Which CPU is ideal? You mentioned CPU ID 1, but wouldn't CPU 0 be closer to the main bus? Is there a way to determine which is best, or are they all the same?

Windows prefers to run on CPU 0, and every new thread starts there before being moved. CPU 1 is the first "free" core.

9 minutes ago, Sturm58 said:

using this only made the game even slower.

Still - with all cores they are on 50% - why not 100%?

Strange. It works perfectly for me but then again I'm on a threadripper so it could be different than a consumer CPU.

7 minutes ago, Saturnus said:

Strange. It works perfectly for me but then again I'm on a threadripper so it could be different than a consumer CPU.

I had similar results as @Sturm58, limiting it to a single core, no matter which one of the 4 available, made everything slower. Ordinarily it runs around 20-30 fps, and limiting to single core dropped it to 10. I'm only around cycle 300, with limited ranching and moderately developed power, gas, and automation systems, so there isn't that much going on. I also abandoned that automation storage system for the lag reasons, you were correct on that count.

ONI is a single core heavy physics calculation game, like Kerbal Space ( Kerbal can be crashing a lot with certain mods, its not really properly worked on anymore since years and its not as well maintained as ONI ). Sometimes players think ONI is a simple casual game, judged by their first impressions.

That there is no cpu multithreading support is sad, but thats how it is.

ONI gameplay: 1 jetpack currently can pull the same cpu load of 10-20 dupes by foot. You have got a very good cpu for the game, but there is ways of playing the game without draining the cpu load like hell.

Your turbo boost clock speed on your i7 6700k is the most important value, the default  stock max clock is 4.2 Ghz, so you are running the CPU with thermal throttling ( too hot ) and/or you have other things running next to the ONI game, so loading more than one core.

image.png.de170c3d47698d6e50fded1b1575fac6.png

How you play the game will help you much more in FPS terms then the following hardware changes, as you have a good single core performing cpu.

On all the following hardware stuff mentioned ( costs money and raises single core performance depending on the money spent by 10-30% ), you find a ton of How-To`s on Youtube.

Run your mainboard without case, delid ( crack open ) the i7 6700k, apply fluid metal to the cpu die - Which gets temp down by 15-20 Celsius, which increases the turbo boost frequency on one core and keeps it high. Then glue the cpu heatsink back on or be more risky and apply cooling directly on to the silicone die, which gives you superb low core temps, but you risk to damage the cpu die if all is not done careful and in an proper way. Add an BeQuiet or Noctua 1 kilo air cooler with large fans, or use a fully encased water cooler which has a high fluid pump rate and an large fan radiator unit :D If you've got an board overclocking chipset like the z270 you can get more much more out of your cpu core(s), in combo with everything mentioned above. Side effect: Single core games like Cities Skylines and lots of other single core titles will run superb on your system + multicore stuff will benefit too.

----

Maybe you can find something helpful in these threads. Happy ONI :)

https://forums.kleientertainment.com/forums/topic/96484-100-kw-200-kw-500-kw-powerline/?tab=comments#comment-1097668

https://forums.kleientertainment.com/forums/topic/95053-how-well-does-oni-multithread/?do=findComment&comment=1079798

https://forums.kleientertainment.com/forums/topic/95016-frame-rate-optimization/?do=findComment&comment=1079420

ONI scales exactly to this list, so the game runs best on the top 5, 10 or 20 fastest single thread cpu`s. So one can make a tradeoff between price and ONI FPS.
https://www.cpubenchmark.net/singleThread.html

ONI Low Budget CPU Tip, good single core performers:

"Old" Intel i3 6100 @3.7 GHz or newer i3 7350k @4.2 GHz - High base clocks, decent caches, but both have no Turbo Boost.

ONI Enthusiast CPU Tip, higher budget: i7 6700k 7700k 8700k 8086k, i9 Series . I rather recommend the i7 Series for ONI, as the i9 series has too many cores and too much shared resources. Howerever - Great cache sizes on the i9 series.

Wish I could recommend AMD for ONI, but not with their current low single core performance. ONI also strongly benefits from large CPU level1/2/3 caches and of course single core turbo boost, if supported by the cpu and with proper cooling.

Intel is getting a bit in to panic mode in view of current and upcoming AMD stuff - Good !

1 hour ago, babba said:

ONI is a single core heavy physics calculation game, like Kerbal Space ( Kerbal can be crashing a lot with certain mods, its not really properly worked on anymore since years and its not as well maintained as ONI ). Sometimes players think ONI is a simple casual game, judged by their first impressions.

That there is no cpu multithreading support is sad, but thats how it is.

ONI gameplay: 1 jetpack currently can pull the same cpu load of 10-20 dupes by foot. You have got a very good cpu for the game, but there is ways of playing the game without draining the cpu load like hell.

Your turbo boost clock speed on your i7 6700k is the most important value, the default  stock max clock is 4.2 Ghz, so you are running the CPU with thermal throttling ( too hot ) and/or you have other things running next to the ONI game, so loading more than one core.

image.png.de170c3d47698d6e50fded1b1575fac6.png

How you play the game will help you much more in FPS terms then the following hardware changes, as you have a good single core performing cpu.

On all the following hardware stuff mentioned ( costs money and raises single core performance depending on the money spent by 10-30% ), you find a ton of How-To`s on Youtube.

Run your mainboard without case, delid ( crack open ) the i7 6700k, apply fluid metal to the cpu die - Which gets temp down by 15-20 Celsius, which increases the turbo boost frequency on one core and keeps it high. Then glue the cpu heatsink back on or be more risky and apply cooling directly on to the silicone die, which gives you superb low core temps, but you risk to damage the cpu die if all is not done careful and in an proper way. Add an BeQuiet or Noctua 1 kilo air cooler with large fans, or use a fully encased water cooler which has a high fluid pump rate and an large fan radiator unit :D If you've got an board overclocking chipset like the z270 you can get more much more out of your cpu core(s), in combo with everything mentioned above. Side effect: Single core games like Cities Skylines and lots of other single core titles will run superb on your system + multicore stuff will benefit too.

----

Maybe you can find something helpful in these threads. Happy ONI :)

https://forums.kleientertainment.com/forums/topic/96484-100-kw-200-kw-500-kw-powerline/?tab=comments#comment-1097668

https://forums.kleientertainment.com/forums/topic/95053-how-well-does-oni-multithread/?do=findComment&comment=1079798

https://forums.kleientertainment.com/forums/topic/95016-frame-rate-optimization/?do=findComment&comment=1079420

ONI scales exactly to this list, so the game runs best on the top 5, 10 or 20 fastest single thread cpu`s. So one can make a tradeoff between price and ONI FPS.
https://www.cpubenchmark.net/singleThread.html

ONI Low Budget CPU Tip, good single core performers:

"Old" Intel i3 6100 @3.7 GHz or newer i3 7350k @4.2 GHz - High base clocks, decent caches, but both have no Turbo Boost.

ONI Enthusiast CPU Tip, higher budget: i7 6700k 7700k 8700k 8086k, i9 Series . I rather recommend the i7 Series for ONI, as the i9 series has too many cores and too much shared resources. Howerever - Great cache sizes on the i9 series.

Wish I could recommend AMD for ONI, but not with their current low single core performance. ONI also strongly benefits from large CPU level1/2/3 caches and of course single core turbo boost, if supported by the cpu and with proper cooling.

Intel is getting a bit in to panic mode in view of current and upcoming AMD stuff - Good !

seems like the price tag for ONI is severely understated.

4 hours ago, Sturm58 said:

using this only made the game even slower.

Still - with all cores they are on 50% - why not 100%?

This is more because of how Windows manages CPU resources in this day of age.  It will dynamically move threads around from one CPU core to another CPU core depending on the workload of your machine.  This keeps strategy evens out the workload of your processor and keeps it from favoring one CPU core over another core which can maybe possibly increase the lifespan of your CPU by reducing thermal hotspots on the cpu die.. maybe.  Because of this bouncing around and the fact that ONI only uses one CPU core, you can't get 100% usage out of it and what you see in Task Manager reflects this.  It doesn't mean that ONI is programmed wrong.

 

In either case, letting Windows manage where to put various process threads on which core is usually the best.  It isn't in all cases, but for most cases.  For instance, your CPU is hyper-threaded.  That means half the cores that are displayed in task manager are only 'virtual' cores.  Your 6700K technically only has 4 actual CPU cores to use, but the CPU tells Windows (And any other OS) there's 8.  The reason this works is because for many workloads, each CPU core has nearly the resources to share to allow 2 threads to work on one CPU core.  The key word is 'nearly'.  The hyper-threaded cores don't get priority to the main core's resources so they tend to preform less then the actual CPU core.

 

Why do I mention this?  Well, in Intel CPUs, the hyper-threaded cores are usually the odd number cores.  So cores 1,3,5,7.  You pretty much never want to set an affinity for a demanding workload like a game to those cores.  Those are best used for non-critical background tasks or for additional horsepower for encoding/decoding.  If you really want to set ONI to an affinity of one or two cores, then you're best picking 0,2,4, and 6.

Very well written post. I want to add that the system toggling from one core to another can be easily reproduced by installing core temp

https://www.alcpu.com/CoreTemp/

...which will then display all cores temperatures easy to see in the taskbar. One core will peak a bit and then the next core peaks a bit and so on, its a colorful temperature peak cycling through the cores.

My idle Windows10 cores run at 27 celsius as Im typing this

image.png.2f5873882192ab839251e21b35c8d78b.png

Full ONI load runs my i7 7700k core at 45 celsius with stock vcore at 5.1GHz Turboboost or 5.4GHz with a higher vcore at 55 celsius (cpu die and heatspreader covered with conductnaut fluid metal,noctua nhd15 1.3kg air cooler,no pc case). Running ONI with a map-from-hell, playing WorldOfWarships and having CitiesSkylines running on a big map with 2.5 million peeps - 60 celsius on all cores as all 3 games are running at the same time,all maxed out. My RAM speed is mediocre, 64gb ddr4@2400. Of course, the single core cpu turboboost speed drops away, getting all cores down their all-cores-used base speed as all these games are running at once...

PC Freaks :D

12 hours ago, babba said:

ONI Enthusiast CPU Tip

Well, I've a i7 8700k that runs at 20% load, the fps goes from 20 to 40(if I disable proximity priority). And i'm talking of a base on cycle 400 with 8 dupes, totally unplayable. Pretty sure I had the frame drop after opened a breach on the surface.

4 minutes ago, byterussian said:

How the pathfinding works? If I lock access to space with tiles and locked doors the game still take in account the zone for pathfinding?

 

 

Pathfinding = dupes can go there

Locking a door closes an area off to pathfinding.

I have 2 exits out of my base to space. One goes through atmo suits other through jet suits. There are only 3 jet suits. If i lock the jet suit exit off my fps rises drastically (basically no lag). For now i only enable that exit if i have a large build in space and don`t want to bother with ladders.

If pathing is really causing most of these problems then Klei could “fix-it” by reducing decision optimization.  Instead of picking the “perfect” path and the “perfect” priority they could use a simpler algorithm that finds an acceptable (but not ideal) solution.

Off-topic: I’m not looking forward to the inevitable day when this same issue happens to self-driving cars.  Lag will matter a lot more for that decision making engine.

One thing to consider is: If a dupe can not execute whatever it is supposed to do next, then this creates work queue`s. So if a dupe which can not instantly pee, go to sleep instantly, can not breath oxygen at the moment, has a blocked target path, the players commands or schedules can not be worked off etc. the queue memory gets bigger and bigger. Im just guessing, but I would not wonder if code is taking dozens or a hundred things into consideration what a dupe will do or try next.

I can recommend to built lots of ladders, fire poles, exosuits stations in various setups to figure out what works best for you. If all dupes can instantly execute everything they need to, by a finger snap - This keeps the frame rate up or stable.

8 hours ago, byterussian said:

Just tried, +30/40 fps by locking access to the surface. Probably more if I fine tune door permissions to oil biome.

@babbaThere is a bug report open for this or I need to create one? 

Oil biome isn't really as expansive or hard on the CPU for pathfinding as the surface, for two reasons.

First is dupes can suddenly get a huge range of options for pathing all across the surface, which causes some lag. This is greatly worsened if you have jetpacks, as all open air tiles are pathable.

The second is the shove voles. These suckers are broken as hell. They apparently can burrow through any tile (including doors and walls!) that isn't abyssalite or refined metal, including neutronium at the edges of the map, giving their pathing AI free reign to lag your game the instant you hit the surface. They're nearly impossible to kill or wrangle too, as they can burrow anywhere and cannot be lured.

Take a brief look at this:

 

Ok for Shove Vole that need random things to do/move to simulate AI but I don't understand why we need to take in account space tiles for dupes everytime, they don't move around random, right? They have a todo list of things to do and if nothing they stay still, no?  If a dupe is using an Oil refinery and needs to pee let's retrieve the position of evert latrine/lavatory and find the best path from current dupe location, no need to know that this dupe can go on space or in swamp biome, he just need to pee. 

 

PS: Now, i'm very curious to see how things works, hopefully the DLLs have something interesting inside. 

8 minutes ago, byterussian said:

If a dupe is using an Oil refinery and needs to pee let's retrieve the position of evert latrine/lavatory and find the best path from current dupe location, no need to know that this dupe can go on space or in swamp biome, he just need to pee. 

How would the game know going through the space biome is not the fastest way if it doesn't check it?

The shortest route is not necessarily the fastest in a game with transport tubes, jet packs etc.

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