Captain of Industry

MaFi Games · Simulation

Captain of Industry patch notes · Sep 15, 2022

Experiment

CD#31: Up to 3x more FPS and 2x faster loading!

What's new in CD#31: Up to 3x more FPS and 2x faster loading!: 32 changes to Captain of Industry, released Sep 15, 2022.

Balance · 1

  • Clinic now prefers a higher tier of medical supplies when it has multiple types stored.

    clinic medical supply selection

System · 17

  • Game loading is now 2-8x faster.

    game loading speed
  • Ports were simplified by removing their Events, reducing load time since ports outnumber entities.

    port overhead
  • GPU instancing with cube data handled in the shader gives about 2-3x FPS increase when many construction cubes are present, keeping FPS near 120 instead of dropping to 7.4.

    construction cube rendering
  • Level of detail models are used for the most important buildings, reducing rendered triangles at distance, e.g. the rainwater harvester from 3734 to 698 triangles.

    building level of detail
  • Rendering of common buildings was optimized, resulting in up to 3x more FPS.

    common building rendering performance
  • Saving and auto saving became faster as a side effect of the load optimizations.

    save and auto save speed
  • Terrain designations and their backing data structures were simplified to speed up loading.

    terrain designation data structure
  • Rendering of construction cubes was optimized so they no longer cause any FPS drop.

    construction cube rendering performance
  • UI initialization was sped up by avoiding costly re-parenting of Unity objects, using Object.Instantiate with a parent instead of new GameObject().

    ui initialization time
  • Save files are now about 3 times smaller on large factories, partly due to fixing a stats leak.

    save file size
  • Game load is now 6.5 times faster on large factories and about 1.7 times faster on compact ones.

    loading time
  • Static non-animated buildings are rendered via GPU instancing, giving 2-3x more FPS on very large factories.

    building rendering performance
  • Overall game load plus UI initialization dropped from 12 seconds to 2 seconds across all the improvements.

    game loading time
  • Added a ChangeConfigs method to the IMod interface allowing mods to change configs; this is not backwards compatible.

    mod config change
  • Unity Sprites caching was added to avoid duplicates during UI build, saving time and memory.

    ui sprite duplication
  • Separate per-category toolbar panels were merged into one shared UI view to reduce build time.

    bottom toolbar build time
  • Save data structures were optimized, making save files 2-3x smaller.

    save file size

UI · 5

  • Building ghosts, construction cubes, and ports are now colored based on construction state.

    building ghost, construction cube, and port color
  • Blueprints and construction cubes are colored by construction state: blue for under construction, gray for paused, and red for deconstruction.

    construction state coloring
  • Building ghosts now have a subtle texture to make them more recognisable.

    building ghost texture
  • Icons marking paused construction were removed in favor of gray ghost coloring, which reduces scene clutter.

    paused construction icon
  • Building blueprints now show the entity texture subtly, making them easier to recognise.

    building blueprint visualization

Fix · 9

  • A loud sound when quitting the game was fixed.

    loud sound on quit
  • Subsequent loads that were slower due to a memory leak from misused Unity native object disposal are fixed, with GC run before loading a new game to avoid heap growth.

    slower subsequent game load
  • A special case where the cargo depot did not allow assigning a product was fixed.

    cargo depot product assignment
  • Cargo depot no longer gives free fuel when adjusting sliders.

    cargo depot free fuel exploit
  • Cargo depot now only accepts diesel as fuel instead of any fluid.

    cargo depot fuel acceptance
  • Top bar no longer jumps between single and double row when date length changes.

    top bar jumping between row
  • Flipped buildings are split into a separate set with its own back-face culling setting so they no longer render inside-out.

    flipped building rendering
  • Consecutive loads no longer consume more memory or run slower.

    consecutive load memory use and speed
  • Files with special characters such as '[' now load correctly.

    loading files with special character