Removes work the game repeats every frame for no visible gain, which is what makes big colonies and their overlays slow. Each fix keeps the game looking and behaving the same; it only stops redoing work whose result hasn't changed.
Each fix keeps the game looking and behaving the same; it only stops redoing work whose result hasn't changed.
Measured on a cycle-875 colony (18k buildings, 180 critters): overlays went from 29–41 fps to 60–95 fps, the normal view from ~70 to ~85–90 fps, and garbage-collection freezes from ~370 ms to ~60 ms (with the optional setting below).
Recommended: use it with oni-moono
I now recommend running this mod together with
oni-moono
[github.com]
, a replacement engine for ONI. The two work really well together: this mod detects oni-moono, leaves the fixes it already has to it, and switches on a few extra fixes that only it needs. On my colony, running both gave the smoothest play I've had, with far fewer stutters (1% low fps went from ~59 to ~83).
Overlays
Temperature:
the game told every building and item in the colony to update its colour every frame, even those far off screen. Now only what's in view is coloured, a quarter of the view per frame, and only objects whose temperature actually changed.
Materials, Decor, Power, Gas and Liquid pipes:
these rebuilt their whole view every frame. Now they refresh when you move or zoom the camera, and otherwise 4 times a second.
Hovering a wire or pipe
still pulses the whole connected network smoothly, every frame.
Power:
each circuit's wattage is worked out once per frame instead of once per wire segment (hundreds of times), which also removes a large source of memory garbage.
Everywhere
Animations:
the game's animations run at 30 frames per second, but each one updated its graphics batch on its own frame, so batches were re-uploaded almost every frame. Animations that aren't moving now advance together, still at least 30 times a second. Anything that moves (dupes, critters, carried items) updates every frame as before.
Mouse hover over the UI:
the game checks which UI element is under the mouse by testing every UI element on screen, every frame, while the window has focus (about 1 ms each time in a big save). With the mouse still, the last answer is reused for up to 0.1 s; while it moves, the check runs 30 times a second (adjustable). Clicks, drags and scrolling always check every frame.
Rail items after loading:
a vanilla bug drew items riding a conveyor rail behind a building (Phosphorite, ores and more) in front of it after a save loaded, until they left the rail. Shortly after loading, those items are put back behind buildings, once per load.
Options
Mods screen → Colony Performance Fixes → Options. A restart is needed after changing them.
Batch animation updates
(on)
Reuse UI hover raycast
(on), and
Hover checks per second while moving
(30; 0 = every frame)
Keep rail items behind buildings after loading
(on)
Smoother garbage collection
(off). Turns on Unity's incremental garbage collector, which spreads each memory clean-up over many frames instead of freezing the game for one long pause. Unity only reads this setting at startup, so the mod writes one line into
OxygenNotIncluded_Data/boot.config
(a backup is kept as boot.config.bak-colonyperf). It takes effect from the next launch, and is re-added if a game update replaces the file. Turning the option off removes the line again. Not available on macOS.
Full speed when unfocused
(off). The game normally sleeps a little every frame while its window doesn't have focus. This keeps it at full speed while you're in another window.
Notes
Adds nothing to your save, so it's safe to add to or remove from an existing colony.
Gains depend on the colony: the bigger it is and the more you zoom out, the more the overlays gain.
Mods that replace the same overlay updates, the animation updater or the game's mouse input module may not combine with it. Gas Overlay and Pipe Flow Overlay were tested alongside it.
Mods stuck in an install loop?
If ONI asks for a restart on every launch, or mods never finish installing:
Close the game completely (check Steam no longer says "Running").
Back up your saves: copy
Documents\Klei\OxygenNotIncluded\save_files
somewhere safe.
In
Documents\Klei\OxygenNotIncluded\mods\Steam
, delete the folder of the looping mod (folder name = the number at the end of its Workshop URL). Not sure which? Delete them all, Steam re-downloads them. Settings inside those mods will reset.
Exit Steam fully (Steam menu > Exit), then delete
Steam\steamapps\workshop\appworkshop_457140.acf
so Steam re-checks every ONI Workshop mod.
Start Steam and let downloads finish (not in Offline Mode, downloads not paused).
Start ONI and restart once if asked.
Still looping? Unsubscribe, start and close the game once, resubscribe, and repeat steps 5-6.
Windows: check OneDrive first
The most common cause on Windows is OneDrive syncing your Documents folder. If your mods are under
C:\Users\(you)\OneDrive\Documents\Klei
, OneDrive locks or reverts files while ONI unpacks them, so it reinstalls them every launch.
Quick test:
OneDrive cloud icon in the taskbar > gear >
Pause syncing
> 24 hours, then do the steps above.
Permanent fix:
OneDrive cloud icon > gear >
Settings
>
Sync and backup
>
Manage back up
> turn off
Documents
.
Windows then uses a new, empty local Documents folder.
Copy the whole Klei folder
from
OneDrive\Documents
into
C:\Users\(you)\Documents
, or the game will start with no saves or mods.