OpenLoco v24.04 is out! We’re releasing this one a little earlier than you might have expected; a little over a week after v24.03. However, besides quite a bit of behind the scenes work, many bugfixes made it in. We think that warrants a new one! Let’s take a look at what’s new.

Reimplemented create track and create building game commands in C++ (#2329, #2330, #2368)

Our quest to reimplement the game commands continues, with @duncanspumpkin finishing his work on two very important and difficult game commands: the two dealing with track creation and building construction. These continue to pave the road to functional multiplayer games. Nice work!

More work on map generator functions (#2383, #2408)

The landscape generation window allows specifying the terrain type around certain surface topography. For example, you could specify areas far from water to be a desert, and areas close to sea to be grassland. Each of these is handled by a particular terrain generator function. This month, we implemented five of them. Slowly but surely, we’re paving the way towards extending the map generator to different topography styles.

Work on ‘No Locomotion’ executables (#2395)

As most of you know, OpenLoco has been a long-running project, reimplementing the game in C++ one function at a time. Earlier this week, however, @marijnvdwerf asked the question: how far are we from making builds that no longer depend on the original executable at all? While we didn’t have an answer, @duncanspumpkin soon came up with one. Interestingly, for a build that does not immediately crash on start, the one thing left to do was to reimplement the game intro! The game intro had been craftily disabled in all versions of OpenLoco, so no-one had thought to reimplement it until this week.

Please note that these ‘NoLoco’ builds are mostly a proof-of-concept at this point. They do crash at some point, after loading and rendering the title screen. We still have our work cut out for us, but this is a very encouraging sign regarding our progress!

PNG heightmaps being mirrored when generating terrain (#2382)

When importing a PNG heightmap, the heightmap data is inferred and stored in a temporary data structure before processing it into map surface tiles. Turns out we were saving it in the wrong order, leading to a mirrored map. @LeftOfZen had actually spotted and addressed this when he was implementing it, but an overly-eager reviewer (*cough*) thought the reversed coordinates were a mistake. Glad we corrected that.

Error messages appearing below the window after cloning a vehicle (#2403)

After a recent change to the game command structure for cloning vehicles, a mistake slipped in: the error state was not being checked properly anymore! First-time contributor @Sebazzz noticed what was going wrong, and quickly came up with a patch for it. Thanks!

Crash due to the station limit (#2396)

Our shiny new station limit checks, which we presented in v24.03, introduced a classic off-by-one error. In spite of the more flexible limit checks, stations can still only occupy 80 tiles. However, our implementation checked for 80 tiles inclusive, which meant players were allowed to place an 81st tile. Unfortunatly, this lead to surreptitious corruption and eventually crashes. Sorry about that.

Crashes around vehicle (order) deletion (#2397, #2400)

Vehicle order tables continue to haunt us. This time, we were alerted to an issue that stumped us. The game would suddenly crash while leaving a vehicle window open in the route/orders tab! After some debugging, @duncanspumpkin discovered the crash actually happened due to an AI company deleting one of their vehicles in the background, shifting the order table. Good to have that taken care of.

On a related note, @Sebazzz noticed an edge-case where the game could leave a reference to a deleted vehicle, which could cause a crash when read. Nice work!

Address some oddities around text rendering (#2379, #2380, #2389)

Last month, we changed the signature of some of our text rendering functions, aiming to make them more flexible eventually. However, our tests turned out to be incomplete, and some bugs slipped in. Text input should once again look fine, as should the cargo labels when constructing new stations. Finally, the new ‘Number of smoothing passes’ label in the landscape generation window now actually shows up as intended.

Updated: