OpenLoco v25.02 is out! We have a good chunk of fixes in this release from a variety of contributors. The main focus was on completely implementing the town growth function. With this milestone achieved, from next month we will be able to implement some community requested town features (like not upgrading buildings).

For a complete summary of changes, please find the OpenLoco changelog on GitHub.

Town Growth

The town growth function was one big sprawling function. This made it hard to implement in OpenLoco, as there was so much that needed to be implemented in one go before it could be tested.

In the end, I did work out a way to split it up into four main parts. The first part handled: placing buildings, upgrading buildings, upgrading road, upgrading street lights, taking over road. After testing this part and fixing my mistakes, it was onto part two, which handled inserting additional cross roads into existing road. The third part was adding road onto the end of any road ends. This third part was complex and had a number of original bugs in it. One bug causes the game to not flatten land correctly. Another bug I’ve not fully been able to determine what difference it will cause, other than it will try to place a road where it shouldn’t. The fourth part handled installing bridges.

Now that it’s all implemented (#2919), we are free to start looking at additional features. One feature that I know the community would like is to stop towns from destroying user-placed buildings. This happens when the building upgrading code decides that a building should be replaced. This could easily be made optional now.

Naming Unknowns

Often when implementing something in OpenLoco, we can’t immediately come up with a good name for a variable or a constant. This leads to a number of places in the code that refer to unk or flag. It’s not a great situation, as it makes the code base hard to read, but it is often the only way you can do it. @spacek531 and @shusaura85 have spent some time trying to rename some of these unknowns (#2894, #2885, #2872, #2871, #2869).

There are still more to address, though. It’s work anyone can help with, so feel free to pitch in. Some of these changes are in object definitions, so you will see the ObjectEditor being updated with this new knowledge. Hopefully this helps object creators to better understand what they are doing.

Road Placement Game Command

I worked on the road placement game command a few months ago, but there was an odd issue with it that I couldn’t find the cause of. After leaving it for a few months, I found the issue, which was that when placing trams on a road which has a station, it would break the order, causing the station to disconnect. With that fixed, it is great to finally have this merged (#2681).

The function is one of the last very complex game commands! We now only have six main game commands left to implement. Once all of the commands are complete, we will be in a good position to get multiplayer working properly.

Misc Implementation

@spacek531 decided to have a go at implementing a few vehicle functions. It is great to have some fresh eyes implementing functions. The functions were all related to adjusting the order/direction of cars on a train (#2949, #2946).

I finished off the last UI vehicle function (map route interaction). This fixed the issue from last month that prevented you from being able to place waypoints for boats. Other than that, the other functions were minor setup functions (#2944, #2943, #2942, #2847, #2843).

UI Refactoring

@AaronVanGeffen and @ZehMatt continued their reworking of the UI. We have now managed to port all of the widgets to a new system (#2900, #2901). The next stage is moving more of the custom UI code into standard widgets. Ultimately, we should be able to auto layout UI to get a more consistent look and save headaches whenever changes are need for new features.

Avid players might have noticed some problems with news(paper) drawing in the previous release. This was a result of our reworking of the panel widget types. To address the complications, we decided to go with dedicated ‘newspaper’ widget types, at least for now (#2868, #2934).

Of note this month is also a rework of how the mouse input is handled. Panning should work more smoothly now #2924.

Finally, there’s a bunch of minor bugfixes surrounding widget types. If you’re interested in what kind of visible and invisible changes happen around the UI, please take a look (#2920, #2921, #2922, #2928, #2929, #2932, #2937, #2938).

Updated: