1. City Game Studio
  2. News
  3. Optimization From 2300ms to 44ms!

Optimization From 2300ms to 44ms!

Hey folks!

Another excellent week just wrapped up!
I worked hard, but not on saves. As the v1.26.0 release date approaches, I took the time to do a pass on bug reports. And I'll tell you all about it right now

[h3]This Week's Recap[/h3]
To sum up, there weren't that many bug reports, barely 5 over the last 30 days. But each of these bugs was valid and needed my attention.

First, the in-game gauges. I'm not talking about gauges for making a game, but gauges for adjusting sound, microtransaction prices... Well, I made fixes so they work better and respond better. But I introduced a few bugs, which are now fixed.

There's a fairly complex bug that was affecting the studio director, and it's fixed. Actually, if you were developing a game manually but the studio director was handling the port, then the game would have a bug. The price wouldn't have been set correctly. But as I mentioned, it's fixed.

Another small change, but one that'll please you I'm sure, concerns changes in the number of fans. Before, this number stayed at 0, and now it changes correctly and it's nice to watch I think.

I made a few more fixes on missing fonts or even a crash (fairly rare) when launching a game while keeping hints from previous games. But I'd rather talk to you about optimization.

V1.26 is dedicated to saves, but I spent a non-negligible amount of time doing optimization. In a previous RC I was optimizing game launch, and now I took the time to optimize the game itself.

Actually, more and more of you have large companies. With many employees, so I took the time to optimize this part. Previously, when you had over 1000 employees, you could notice regular slowdowns. This was due to a single function that handled balancing your employees' happiness.

So I worked on that and reviewed a few small things. First, the way the function is called. Instead of being called in the middle of other functions, it'll have its own dedicated cycle. Which will allow the game engine to do other things in the meantime. On top of that, I did caching, simple calculations that saved a few milliseconds. But the biggest thing was changing data access, which previously meant this function could take 2300 milliseconds to execute. And that's noticeable. Your game literally freezes for a few seconds. But with all the changes I made, we go from 2300 milliseconds to 44 milliseconds. Let's just say you're going to notice the difference!

Otherwise there's another small change concerning the employee panel - from now on, you'll see the number of employees and available offices directly in the studio names.

[h3]What's Coming[/h3]
Given that I haven't worked on saves at all, I plan to tackle it. It's high time you could at least load your games even if you're already in-game. I know that just that alone is going to require quite a bit of work. Because the game isn't designed for that. So I don't know yet how I'm going to approach it, but I'm going to have to rip out and rewrite quite a bit of code!

Well well, it was a long post for not much in the end, mostly fixes and optimization, but at least you know what I did this week!

See you next week, in the meantime take care of yourselves
Xavier aka Binogure