Friday Dev News #46 - Bugs & Balance

Hello everyone!

Changelog for this week’s update

  • Save loading time improved by ~20%
  • Balance: Buildings can now store more iridium. Was necessary so they don’t have to wait for deliveries after completing an item
  • Balance: Immigration rate is higher in mid-game
  • Balance: Adamantine mine requires less red science packs, but takes a little longer to mine one unit of admantine
  • Balance: People waiting in a space port move in twice as fast once habitat requirements are met
  • Balance: Fewer parks and arenas are necessary
  • Fixed issue where road would collide with the access road of an unbuilt building and would not start working again
  • Fixed issue when you erased a district with export rules still applied to it
  • Fixed issue where districts weren’t correctly handled at world border
  • Added safeguards so that bugs are less likely to break the game (just some strategic try-catch statements, errors are still logged)

Road Performance Experiment

Behind the scenes we’re thinking about the endgame and how large cities are supposed to grow. A big factor is what city simulation size are we able to handle with decent fps?

Now, parts of InfraSpace are quite optimized already, but there are many things that can be done. The reason it’s not fully optimized yet, is that fast code is harder to write and harder to maintain, so we started with a simple version first.

However, when we think about how large cities are going to get, we’re interested in the maximum performance we could achieve with reasonable dev time. There are different performance categories to take into account:

  • Graphics
  • Building simulation
  • Road simulation
  • Miscellaneous simulation

Of all these categories, roads are the most difficult to optimize because cars have to deal with their neighboring cars so much - this means the computer has to load different parts from the memory chip to do the necessary calculations. Most buildings can be simulated in isolation quite easily, requiring only data pertaining to that specific building.

I spent some time this week replacing the core of the traffic simulation with better data structures and measuring the difference. Previously, a large city took around 1.73ms per thread to simulate 10k vehicles. With the new optimizations, we can do the same calculations in 0.27ms, which is about 6.4 times faster.

I’m quite happy with the results, but I have not included these performance improvements in today’s update yet. Since it required changes deep inside the traffic engine, there is a risk of significant bugs, so we’ll work on it some more first.

What you can look at however, is the new performance report. Press F2 to see some stats about your city and how much time your computer is spending on which parts.


(screenshot without the mentioned road optimizations)

Unfortunately, our artist was sick this week, so no new pictures to check out this time! More news on trains in the next update :slight_smile:

Happy playing!
Daniel

1 Like