Blog

CD#29: Performance, Balance, and Quality of Life, out now in experimental!

Hi everyone, Captain Zuff here and in today’s Captain Diary #29 post we have yet another patch full of improvements so let’s get to it.


Patch v0.4.10 (experimental)

Today we have released a new patch to the experimental branch where we focused our efforts on some major performance improvements, balance changes, and some much needed quality of life improvements. Full patch notes are at the end of this post.

Discord user ProfitX10 shared this amazing factory with a comment: "Made a colony that is sustainable, I believe mostly indefinitely.". We use it for performance testing since it is vast!

We have also uploaded new strings for translation into our translation tool. Thank you all for your amazing contributions!


First, I will let Captain Marek tell you all about the performance optimizations (it’s gonna get a little technical).


Performance optimizations of ports rendering

As people build larger and larger factories, the game slows down to the point where it is not fun to play. We have analyzed the game on such large factories kindly provided by the community and identified three major offenders. 1) Buildings, 2) transports (conveyor belts and pipes), and 3) ports (transport attachment points on buildings). We have decided that ports will be the ones to tackle first since they were taking 20-50% of the total frame time.


These transport attachment points are called “ports”.

Ports have quite small models but the issue is that there are many, many of them. We have seen factories with more than 30 thousand. Turns out that Unity, our rendering engine, is not that good at handling huge amounts of small objects.


We have had similar issues with transport pillars before and by employing a technique called GPU instancing we were able to increase game performance by 2-3x, this was discussed in Captain’s Diary #15. To briefly recap what GPU instancing is, basically you can ask the GPU to draw a 3D model multiple times by providing the model once together with a list of 3D transformations (position + rotation). The GPU will then “clone” the model for each given transformation, all in parallel and super fast. We were hoping to employ the same technique for ports and be done with it in a few days. Unfortunately, ports are way more complicated.


Ports have not only their 3D models, but also icon + arrow + highlight that can be toggled on or off, independently for each port. This just adds more complexity and we have to apply the similar optimization techniques to each component separately and be able to filter what is being shown.

Additionally, ports need to be able to react to the mouse cursor for starting and snapping while building transports. Unfortunately, GPU instancing cannot solve mouse interactions so other techniques have to be employed.


In addition to GPU instancing, we have also implemented chunk-based rendering. All ports are grouped to chunks of 256x256 tiles and if a tile is not in the camera view, we don’t draw or update it. Based on the camera distance we also switch to simplified port models with much less triangles (this technique is called LOD, or Level of Detail).


An example of how port models get simplified when the camera is far enough.

Long story short, all these optimizations combined reduced the time needed to render all ports by 99%! Seriously, it’s that good! Before the optimizations, ports took around 5-15 ms to render, depending on the size of your factory. Now, they take less than 0.1 ms! Considering that ports took 20-50% of the frame time, now the game is 20-50% faster! Take a look at the benchmark data below.

Before (98,917 game objects)
 19.0 FPS - Without ports
 15.6 FPS - With ports (baseline)
 13.6 FPS - With port highlights
After (75,790 game objects)
 19.0 FPS - Without ports
 19.0 FPS - With ports (baseline)
 19.0 FPS - With port highlights

And that’s not all! Alongside this, we have also removed the FPS drop that occurred when opening the inspector window of any transport where users were reporting 10+ frame drops when just clicking on a transport. Yay!


The best part of this is that many improvements done here will be reusable for future rendering optimizations. We are hoping to look at buildings and transports in the future. If you notice your game running faster, let us know! That’s it from me, back to you, Zuff!


Balancing with new recipes

We’ve added a couple of new recipes that should help with excess food products, more precisely Vegetables and Meat Trimmings.


Vegetables can now be refined into Fuel Gas via the Anaerobic Digester.


Meat Trimmings can now be processed from Meat


Arc furnace quartz fix

The Quartz recipe for the Arc Furnace now properly returns Steam lo instead of Steam hi, this may cause some issues in pre existing saves so make sure you adjust accordingly!


Other Recipe Balances

We’ve adjusted the rates of several recipes to make them more viable in your factories. Mechanical Parts from Iron in Electric Assembly II, Fuel Gas from Potatoes and Wheat, Animal Feed from Wheat and Corn, and others. Check the patch notes for specific changes!


Fuel Consumption Balances

Excavators now consume 80% less fuel while waiting for trucks.


Trucks no longer consume fuel while searching for dumping locations.


Research Searching

Quickly find what future technologies await you using new search functionality!


Clear stored products from recipes in production buildings

For a small Unity cost you can now have clutter free buildings!


When using the copy tool, building configurations are now copied by default (holding ctrl will prevent this)

No more accidently copying a plan without the same settings!


Increased Designation Areas

Another highly requested feature added today is the increased max size of mining tower and tool designation areas. With almost 4 times more area to designate you can save yourself a lot of micromanaging on big mines!


Art Contest Winners

I am happy to announce the winners of our fan-art contest! We have picked three winners:


First, player WIKUS with an AI-assisted picture of the captain in front of their factory. The captain figure reminds us of Thanos from the Marvel universe. We like to think that it was a play on COI and its balance: "Perfectly balanced, as all things should be".


Second, player Alaska with a hand-drawn piece called “A seed of hope”. We like this piece that captures the notion that players are rebuilding self-sustaining civilization in COI. Also, I can confirm that tree replanting is something we are working on!


Third, player ouTPhaze made a few an AI-assisted pieces but we liked the one below the most. It is quite amazing how AI-made pictures look quite realistic and have strong COI vibes. It is also funny that if you look closer, the picture does not make much sense.


All three winners will get a COI Supporters edition and merch such as a T-shirt or poster once we have some (later this year).


Thanks to everyone who submitted and feel free to keep posting any COI-related art.


Community Creations

Here are some awesome screenshots shared by our community.

Reddit user, AnxietyWeird1091, made their own Hydrogen Battery!
Devlyn’s ‘Factory Life’
Discord user, MrMurry, has used their space well!

Patch notes v0.4.10

Performance

  • Optimized rendering of ports (conveyor/pipe attachment points on buildings) and their highlighting, resulting in 10-50% more FPS!

  • Fixed a frame rate drop that was occurring when the transport inspector was open.

New recipes

  • Added a recipe to convert meat to meat trimmings (to enable making sausages out of meat).

  • Added a recipe to convert vegetables to fuel gas (to be able to get rid of excess).

Balancing

  • Fixed quartz recipe on arc furnace that incorrectly returned hi-pressure steam. It now returns low-pressure (IMPORTANT: you might need to fix your factory if you use this recipe).

  • Increased throughput of mechanical parts from iron in Electric assembly II by 2x.

  • Slightly increased fuel gas output from potatoes and wheat to catch up with energy produced from burning those as animal feed.

  • Significantly increases yield of animal feed from wheat.

  • Slightly increased yield of animal feed from corn.

  • Reduced exhaust produced in rotary kilns from the hydrogen recipe.

  • Added some starting coal to speed up the early game a bit.

  • Trucks no longer consume fuel when searching for dumping locations.

  • Excavators now consume only 20% of fuel when waiting for trucks whilst loaded.

UI, UX, and QoL

  • Add functionality to search in the research tree.

  • Added option to clear products from non-assigned machine recipes (costs Unity).

  • Added tooltips to all toolboxes explaining what individual tools do.

  • Port previews and transport start-by-hover-over-port ability is now available all the time when the build menu is open.

  • Added option to temporarily hide price popup when building (in case it is in your way).

  • Vehicle recovery is now always available.

  • Copy tools now also copy config by default when copying entities (Ctrl key now disables the config copy).

  • Clicking the lock icon in a locked recipe inside of the recipe book now opens the appropriate research node in the research tree.

  • Research for the settlement recyclables module was moved to a separate node behind household goods. It is now explained that recyclables come from household goods.

  • Increased max size of mining tower areas.

  • Increased max size of designation tools areas

  • Added description to the research for large vehicles to explain that glass can be also traded for on the world map.

  • Fixed obsolete description for tree harvesting tool.

  • Right-click on notifications dismisses them now.

  • Notification is now shown if a settlement food module has no product set.

  • Settlement food module now provides food even when being deconstructed.

  • Ship fuel buffer is now shown only after the shipyard is repaired.

  • Waste dump and burner have no longer disabled logistics by default but also they do not select all the recipes anymore. This makes the initial diesel chain easier to setup by allowing transportation of waste water.

  • Crushed slag is no longer dumped by default.

Other fixes

  • Trucks will no longer transport small cargo loads during deconstruction projects (unless they are high priority).

  • Increased distance tolerance for fuel trucks to minimize issues where fueling trucks cannot reach excavators.

  • Trucks will now prioritize refueling instead of getting rid of cargo. This will avoid stuck dump trucks alerting low fuel instead of going to refuel.

  • Fixed issues with concrete tiles appearing on the ground when constructing entities that were cut but not pasted.

  • Fixed edge cases in which port highlights did not appear properly when opening port overlay right after placing buildings.

  • Fixed layers legend view that was in the wrong position before the player opened the entities menu at least once.

  • Fixed incorrect maintenance production reporting.

  • Fixed consumer electronics edict that was incorrectly boosting household appliances.

  • Comma is now supported as a decimal separator in the calculator.

  • Ports on non-constructed building blueprints are now shown as a blueprint too.