Skip to content

0.4.17 preview

Pre-release
Pre-release

Choose a tag to compare

@kramsey458 kramsey458 released this 22 Sep 01:59
· 6 commits to main since this release

Preview of Late Game Performance for Timberborn 1.1.2.4. Not yet played. The latest release is still 0.4.14. Four changes on top of 0.4.16, all outside the simulation, all from the same 35-minute Performance Log recording of a 354-beaver colony. (The zip was replaced once, a few minutes after first publishing, to add the fourth change; if you downloaded the first one, download again and check the SHA-256 below.)

Multiplayer: every player installs this same version. Nothing in this version changes which ticks run or what they compute; memory, sound and the interface may differ between players anyway.

The memory clean-up after a save moves into the save's own frame

A save allocates a lot: the snapshot of the world, then the JSON tree and the compressed bytes. In the recording every autosave was followed by a garbage collection within about ten ticks, so each save was two hitches: the save frame, then a collection frame of 100 to 190 ms a second later. From 0.4.17 a collection runs right after the save's main-thread part, inside the frame that is long anyway. The allocation budget then starts over, and the rest of the save's garbage should no longer tip it over on its own.

  • One SaveCollect: line per save says how long the collection took and how much it freed.
  • Whether the second hitch is gone shows in the Timing: line, which counts the save frame with its collection separately from ordinary collections. Please send a few of those lines.
  • Also runs after the save BeaverBuddies writes for a joining player (one hitch on the host at join).
  • CollectAfterSave = false in LateGamePerformance.cfg switches it off.

The audio listener is placed only when needed

Every frame the game casts a ray from the screen centre against the terrain and against every block object to find what is under it, then moves the audio listener a tenth of the way there: about 0.3 ms per frame and 50 KB/s of garbage in a large colony. Now it runs when the camera moved, while the listener is still gliding towards its target, and otherwise once every ten frames, so something built under the screen centre is picked up within a fraction of a second. Sound only. SoundListener = false switches it off; the SoundListener: stats line says in how many frames it ran.

Two interface systems stop redoing their work every frame

  • The status aggregator goes through every status in the colony every frame to fill the alert lists the top bar reads, about 0.35 ms per frame. It runs every fourth frame now; a status that appears or clears reaches the alert count a few frames later. Removing a subject still updates the lists at once.
  • The selected entity's panel refreshed every fragment every frame, the largest single source of garbage among the game's systems at about 120 KB/s. It refreshes every second frame now, and always on the frame a different entity is shown.

Neither is read by the simulation. UiThrottle = false switches both off; the UiThrottle: stats line counts them.

Animated objects off screen keep their time but skip the pose

Every frame the game advances every Timbermesh animator in the colony and writes its pose: node animators move child transforms, vertex animators set a material time. In the recording that was about 1.1 ms per frame, and twice that in the working day when every beaver is out walking, whether or not the object was on screen. Now, when none of an object's renderers is visible (shadow casters count as visible), the mod runs the game's own time-keeping and leaves out only the pose writes. Time, the finished flag, the animation-changed event and the wonder's saved animation time are exactly what they would have been; when the object comes back into view its pose is written again from the time it would have had anyway. On the single frame in which it first reappears it can show the pose it had when it left the screen.

Rendering only: the simulation reads animator time (the wonder, the clutch, particle triggers, the character model), never a node transform or a material. AnimatorCulling = false switches it off; the AnimatorCulling: stats line counts the updates left out.

What was tested

244 checks pass against the installed game's assemblies, including all 84 patch targets.

  • Save collect: one collection per save, never from inside itself, off for the session after a failure.
  • Listener rule: runs on the first frame, while gliding, at once on a camera move, and one frame in ten with a still camera.
  • Interface rule: 25 status and 50 panel updates in 100 frames, and a newly shown entity on its first frame.
  • Animator culling: the patch target and every private accessor it needs resolve against the game's assembly; the visibility rule itself needs a running game.
  • Not tested: the game running with any of the four. The test harness cannot apply patches. If the alert counts or the entity panel look wrong, UiThrottle = false is the way out.

Install

  1. Close Timberborn. Delete any older LateGamePerformance folder, then extract LateGamePerformance-0.4.17.zip into Documents/Timberborn/Mods.
  2. Requires the Harmony (2.4.1+) and Mod Settings Workshop mods.

SHA-256 of the zip: a6f123a7e525c16bbf6f39ef854485d120a9e2883df8e326ce72d9b3e696f45c