Captain's Diary #57: What's in the upcoming Update 4.3
Hi everyone, Captain Marek here. It's been a while since our last diary, but we haven't been idle (unlike some of your trains, as you will see later). We've been busy working on new features and improvements, which I will go over in today's diary. And I am happy to announce that all of them will be available in a few weeks in the upcoming Update 4.3! This update is quite packed, so grab something to drink, because I have a lot to tell you.
Full mixed materials support
It's finally here: full mixed materials support across the entire game. This means that mixed mined materials can be stored in storages, transported on conveyor belts, and loaded onto trains! This can have quite a big impact on how you design your mines or terraforming operations. For example, you will be able to have a centralized ore sorting facility. Or, mined materials can be transported and dumped elsewhere without sorting, making terraforming faster and easier.
The support for mixed materials may sound obvious now, but let me recap for you how we got here.
Some of you may remember that before mixed materials were a thing, trucks and excavators could carry only one material at a time. This worked fine, but it made mining very inefficient when more than one material was present. If a truck was half-loaded with ore and the excavator picked up rock, the truck had to be sent away only partially loaded. This was especially bad with tier 3 haul trucks, which were often seen driving around with a sad little pile of material in their giant beds, resulting in very poor utilization.
A screenshot from a bug report in 2022 where trucks are driving partially loaded and the player is not too happy about it. Who still remembers the old UI?
To deal with partially loaded trucks, we implemented mixed materials support for excavators and trucks. This solved the utilization issue at the mine, but new issues showed up. Trucks had to drop off each material separately at matching storages or machines, often travelling all over the factory partially loaded and delivering each material one by one, while the excavators sat idle in the mines.
So the third addition was the ore sorting plant, where trucks can drop off their whole cargo at once. This solved the delivery issues, but now every mine had to have a sorting plant and all of its outputs had to be transported separately. So each mine needed a rock storage, a dirt storage, an ore storage, etc. Also, to dump materials with a stacker, they had to be sorted first, even when they contained no useful ore at all. So yes, we made you sort rock from dirt just to dump them both into the ocean.
Before mixed materials support, every mine needed sorting plant with handling for excess dirt and rock at least.
Incorporating mixed materials to the existing systems and keeping the save compatibility was a really complex task, especially to make this work in a performant way as the system was already deeply optimized for single products.
It’s complex because each entity needs to keep track of the mix. This means that every storage, every wagon, and every pile on a conveyor belt now needs some extra data, which increases code complexity and memory footprint, and costs extra CPU cycles to work with. The good news is that we have optimized other parts of the game, so the net effect on performance should be minimal.
Ore sorting plants now have conveyor input ports, so mixed materials can be delivered by belts, not just by vehicles. Also, materials that the plant is not set up to sort can now be sent to an output port unsorted. And mine towers can be assigned mixed-material storages, so you don't need a sorting plant at each mine.
We are really excited we managed to pull it off before Update 5.
Ore sorting station that is being fed by vehicles and trains, sorts out just bauxite, and lets the rest unsorted for dumping.
Recyclables tracking
Thanks to the mixed materials support, we were also able to improve how recyclables are tracked. We spent some extra effort designing the mixed materials system to be generic, so it can mix not just ores but any materials (modders may find this useful). So what changed?
Until now, recyclables were tracked globally. When a recyclable product was made, for example in a research lab or in a maintenance depot, its split was recorded in a global register (regardless of where it came from). Then, when a waste sorting plant sorted the recyclables, the resulting scrap was created based on that global register.
This global management had some strange side effects. For example, recyclables from the production of Maintenance I, which only takes iron and should only return iron scrap, would also return copper and glass scrap, just because a research lab elsewhere in the factory was consuming copper and glass based products.
Another rather amusing side effect: players who added recyclables via cheats, hoping for some sweet free scrap, got nothing back, because the global register had no record of what those recyclables were made of. This was reported to us as a bug multiple times. So the moral of the story is: don't cheat (at least not before Update 4.3).
In Update 4.3, all recyclables track what they were made of along the way, the same way as mined materials, so they behave as everyone expects. This also means that local waste sorting plants that process only some scrap types are now possible.
One detail that may interest some of you: 1 recyclable product sorts into 2 scrap products. In existing saves, recyclables will be converted automatically and products on belts, in vehicles, or in sorting plants will be moved to storages to simplify things on our side. We have also fixed settlements ignoring the recycling ratio, so expect fewer recyclables from them than before.
Local soring plant taking recyclables only from maintenance 1 production and outputting only scrap iron and copper.
Overlays
As factories get bigger, it gets harder and harder to spot issues and prevent outages, or even death spirals. Nearly every update we add more tools to help with this, and in Update 4.3 we are introducing overlays!
An overlay shows information about entities directly in the game view by turning everything gray and coloring only the entities of interest. To get you started, we have added 8 new overlays:
- Productivity: the current productivity percentage
- Pollution: pollution sources, including radiation and landfill
- Priority: the primary priority of all buildings
- Electricity and Computing: production and consumption amounts
- Workers: the number of employed workers
- Maintenance: the amount of maintenance consumed
- Product flow: where the selected product is being produced or consumed
An advanced refinery with productivity overlay. Green means a machine is 100% busy, red means it is idle.
The overlay system is extensible, so mods can use it to visualize any information about entities they wish. I think many of you will find it very handy to finally see things like radiation pollution, which was otherwise "invisible" (as radiation tends to be).
Pollution overlay shows air pollution, landfill pollution, and radiation pollution (not shown).
Forgotten radioactive products in a shipyard is so much easier to find thanks to the pollution overlay. How the heck did they get there?
We have also added a train track max speed overlay to help you design efficient train tracks. This one is shown as a colored line over the tracks. One thing you should know: steep 25% tracks now have an 80 km/h speed limit, similar to medium R 22 turns. Shallower 12% slopes still have no speed limit.
Train speed overlay, red shows the 40 km/h limit, yellow 80 km/h, and tracks marked green have unlimited maximum speed.
Radiation-shielded wagons and stations
Talking about trains and radiation, many of you told us that managing radioactive materials can get hard and that there is no viable long-distance transportation option. Some time ago we had a bug where radioactive products could be loaded onto trains, which very quickly resulted in very high levels of radiation pollution due to the high capacity of trains.
Initially, we thought about just adding a recipe to pack and unpack radioactive materials, so that the packed variants could be treated as ordinary non-radioactive unit products. However, in our usual MaFi Games fashion, we decided to do it the hard way and made a completely new class of train wagons and stations instead. Our 3D artist worked on them for over two months, but we think the result was worth the effort. And in case you were wondering, radiation shielded wagons and stations will be part of the base game.
The new radiation-shielded train stations and wagons can store and transport any radioactive cargo without causing any radiation pollution. They have a smaller capacity of 240 units, and loading a full wagon takes about twice as long. Just make sure radioactive products don't back up on your conveyor belts.
As part of this change, we have also improved the way we track radiation in the game. It should no longer be possible to "leak" radiation by miscounting produced and consumed radioactive products. The game can now detect and self-heal such issues, whether they come from bugs in our code or in mods.
Fission product, a byproduct of running fast breeder reactors, being loaded on a train that will transport it to a safe long-term storage.
Activity statistics for trains
While overlays help you diagnose issues in your factory, we've also added activity and travel statistics to help you diagnose issues with trains. Besides per-train statistics, there are also per-line statistics available in the lines manager.
The activity graph shows a monthly and yearly breakdown of what the train is doing in 4 categories: idle, working, refueling, and not working. This can help you assess the overall utilization of a train or line. For example, when trains are never idle, you may need to add more trains. Or if trains spend too much time refueling, maybe it is time to reconsider the locations of your fueling stations.
Train line productivity statistics showing that the shown train line is working roughly 50% of the time, the rest of the time, trains are idle.
And we didn't stop there. Trains now also collect a second statistic about their travel efficiency. It shows 5 states: not traveling, accelerating/braking, traveling at full speed, limited by train track speed limit, and blocked by other trains. Reading this statistic can be a little nuanced. A healthy train network spends most of its time accelerating/braking or traveling at full speed, and as little time as possible limited by train track speed limit or blocked by other trains.
The new train travelling statistics showing how much time train spends doing useful work compared to being blocked or limited by the train track speed limit.
This feature was partly inspired by Charles Circle Gaming, who was optimizing a large train network together with ringgeest11 but sometimes lacked good diagnostic tools. If you are curious about their findings, check out their Reddit post, which links to the video and has a detailed TL;DW section about ringgeest11's findings. We hope that the new statistics and the max speed overlay will make optimizing train networks easier.
Improved product transfer visuals
If you have a sharp eye, you may have noticed that products at the start and end of conveyor belts pop in and out of existence rather abruptly. This has been in the game since the very beginning. It happens because conveyors end right at the edge of the tile where the machine starts, so each product appeared or disappeared while half of it was still visible.
This has bothered us for a long time, and Update 4.3 finally puts an end to it. Transports now simulate products half a tile inside machines, so the transition happens out of sight. Thanks to this, connectors no longer simulate delay internally, making them around 25% faster to simulate.
Web API server
I have had this idea for a few years now, and it's finally ready: Captain of Industry can now be a web server! You may be wondering whether I am taking crazy pills (which I can neither confirm nor deny), but hear me out.
It is now possible to start a web server using the web_api_start console command. Then, any global dependency in the game can hook onto a route (URL) and respond to requests. The setup is extremely easy: just define a method and return a response, which can be HTML, JSON, or binary data.
[WebRoute("/hello")]
private string hello(string name = "world") {
return $"Hello {name}!";
}
It is also possible to fully control the game by sending commands. For example, our demo dashboard shows how the game speed can be controlled and how a screenshot can be retrieved.
Demo dashboard allowing to control the game speed from the browser.
So what is this good for? Initially, we ported some of our dev tools to this new API, which simplified things internally. But the most exciting use case is modding. We envision that modders will be able to use the browser as a secondary game screen for presenting additional information such as dashboards, alerts, notes, etc.
When our dev Matt saw this feature, he quickly came up with a Google Maps-style minimap prototype where you can zoom in and out and watch the game live, including vehicles moving around. He even went as far as making them selectable and showing their location. This was just an internal prototype to test the functionality.
Dev Matt's demo of an interactive mini-map running in the browser and communicating with the game in real-time.
The officially supported APIs are currently limited to our demo dashboard and screenshot retrieval, but we will closely watch how this feature is used and expand on it in future updates.
Note: The web server runs locally on your computer and cannot be reached from the public internet.
Translations for changelogs and mods
We have some news for our non-English speakers as well. Starting with Update 4.3, all changelogs will be translated into all 20 supported languages and displayed in the language selected in the game.
Changelogs are machine-translated, and this was a deliberate decision. They tend to be long and technical, and their translations are time-sensitive and short-lived. We didn't think it would be worth it for humans to spend their time and effort translating them, but having them at least machine-translated still adds value for non-English speakers. The in-game changelog has an option to show the English original in case something gets lost in translation.
The rest of the game remains primarily human-translated via our online translation tool. Thanks everyone for your continued contributions and corrections!
New changelog window with a timeline on the left showing translated changelog.
Next, mods can now provide translations for their own strings, the same way the main game is translated. Just put the translated files into Translations/<lang>.json inside the mod directory. To get a translation template, run the export_mod_translations console command in the game.
We are also seeing lots of mods from non-English speakers, so mods on the Hub can now provide translated descriptions via the Hub UI, which will be displayed both in-game and online. We are also considering a semi-automated system to help mod authors with translations, but more on that later (if you are a mod author and interested, feel free to reach out).
New onboarding experience and language settings
If you are reading this and haven't bought the game yet, we have some news for you too, something that only you will be able to experience! We have added a new onboarding experience that makes the first game launch smoother.
When the game is launched for the very first time, instead of dropping you straight into the main menu, it will now show a language selection screen. There, you can pick your language with a single click, without restarting the game. If your Steam or OS language matches one of our supported languages, it is displayed prominently at the top, with all other languages listed below.
Onboarding language selection screen. As you can see, the game is now also localised to British English! Aluminium and sulphur are spelt properly at last.
Next, if your PC has more than one screen, you will see a screen and window mode selection where you can quickly pick the screen for the game. Gone are the days when the game launched on your secondary monitor and you had to navigate the settings with your head turned sideways to find the option to fix it.
Screen selection and window mode dialog during onboarding.
In addition to onboarding, the game language can now be selected from a dropdown in the main menu, and the change is applied immediately without a game restart. This should end the frustration of hunting for the language setting in a menu you cannot read.
New sound management
This post is getting long, so just briefly: we have completely rewritten how sounds are managed and played in the game. Larger factories have thousands of sound emitters and the default Unity system was not keeping up.
The main limitation is the number of sounds that can play at once. If you have, say, 20 assemblers nearby, they take up all the sound slots and you'd hear nothing else. Lovely if you are a big fan of assemblers' sound, less so for everyone else. We have implemented a clustering system that combines similar sounds, so you can hear more variety. There is also a new sound quality setting that controls how many sounds can play at once.
We have also added new ambient sounds, so for the first time in history, you can hear the ocean or the forest! This system is quite tricky: we have to dynamically detect what is on the screen to decide which ambient sound to play, because unlike in other games, in Captain of Industry what once was a mountain can become an ocean and vice versa.
Terrain collapses now have their own sounds too. They differ for soft and hard materials and get louder the more terrain comes down, so when you undermine a mountain, you will hear exactly how bad of an idea it was.
We are still tuning the new sound system and we plan to add more and better sounds over time.
The debug view for the new sound engine. Out of ~620 emitters only 34 are playing.
Simulation determinism
We have spent quite some time making sure that the game is deterministic. Even before Update 4.3, patches v0.8.7b, c, and d fixed many issues that caused the game to behave slightly differently between runs, or even depending on the CPU vendor. Thanks to OPOSTOL on Discord, who reported many of these determinism issues.
This work has three main motivations. First, to make bugs reproducible and easier to fix. Fixing issues that we cannot reproduce, or that happen only sometimes, is so much harder, and we cannot even be sure they are fixed properly. With a stable reproduction, we can not only fix and verify the bug, but also write a test so that it never comes back. Determinism even helps with bugs that are not ours: if the same save plays out differently twice on the same computer, the culprit is most likely the hardware, like a 13th gen Intel CPU that occasionally decides 2 + 2 = 5 (ask me how I know).
The second reason is replays. A replay is a list of player commands that can perfectly reproduce the entire history of a save. We are working on such a system right now.
The third and probably most exciting reason is that a fully deterministic game makes multiplayer possible, so all this effort brings us closer to that goal. The fact that we can even think about multiplayer goes all the way back to our initial game design decisions 7+ years ago. For all these years, we have been building the game so that multiplayer stays an option one day. We are actually so close that there are already mods implementing basic multiplayer features on top of our internal systems.
Conclusion
That's all the major news for the upcoming updates. There will be even more smaller changes but you can read these in the changelog once the update is released in a few weeks. If you'd like to try it out early, keep an eye on the experimental branch. Thanks for your interest and let us know what do you think on our forum!
By the way, if you don't want to miss a release or blog post, you can subscribe to our mailing list at https://coigame.com/Club.
PS: We are hiring!
We are currently looking for a full-time 3D artists and potentially a part-time video editors. If you think you or someone you know would be a good fit, let us know!