OpenLoco v24.03 is out! It’s been a busy month with quite a lot of work happening in two key areas: landscape/map generation and game commands. Let’s take a closer look!

Landscape Generation Refactoring (#2314, #2328, #2353)

Often, when trying to add new features, we find that the existing code is not structured to allow what you need. You could try fix it in the feature branch, but it’s much nicer to review if you perform this separately. These refactors reworked the UI to make room for the new PNG heightmap loader, and prepared for further alternative terrain generators. Thanks @AaronVanGeffen and @LeftOfZen for doing that.

Implement Map Generation Functions (#2325, #2344, #2307, #2323, #2338)

Generating a custom map is done in a number of passes. The first couple of passes are purely for generating the rough landscape. Subsequent passes add trees, buildings, towns, industries, etc. This month, @AaronVanGeffen decided to tackle the industry, building and landscape generation. With these completed, we can start thinking about creating alternative versions for alternative generator options. Perhaps the community has some ideas for how initial industry distribution could be changed?

PNG Height Map Generation (#1941)

You can now use a square PNG image as input for the surface generation! This will allow players to take height maps of places in the real world, and bring it into the game with minimal effort! @LeftOfZen started this feature a number of months ago and it is now ready for use. Hurray!

Implement Create Road Station Game Command (#2317)

Last month, it was the train station creation game command, this month it’s the road station. There wasn’t a whole lot new that was found when implementing the command, but one interesting fact is that road stations, like train stations, have been designed codewise to work on multi-tile road elements (such as large turns and slopes). There are no objects that use this, and I don’t think there would be drawing code for this, but it’s interesting to see that the code for it was written.

Implement Station Allocation/Deallocation (#2315, #2352)

When we implement a function, we often leave sub functions for a later day. The station allocation and deallocation was one of those sub functions of the create station game commands. When @AaronVanGeffen implemented these, though, we noticed that suddenly there was a change in the deterministic replays we run. It turned out that the default station name was being generated differently, but we hadn’t even touched that bit of code! After much searching, we worked out that we introduced a bug last year in the station name code and when we implemented this function it fixed the bug. The bug would cause station names to incorrectly use the term ‘valley’ or ‘heights’. Not the most exciting of issues, but a bug all the same.

Make Station Size Limit Optional (#2306)

Yes, we’ve saved the most exciting bits for the last part of this development blog. One request we get a lot from the community, is to allow for larger stations. We’ve always said that we would increase limits when we had implemented the code that enforces the limit. Well, that day is today! You can now disable the 16x16 length limit on station size. Due to the S5 save format, stations are still limited to 80 tiles per station, but you can make that 80 tiles totally in a straight line if you so wish. As we tick off implementing more of the game commands, we can make further improvements.

Save Game Compare Tool (#2168)

@memellis has been working on a tool for development use so that we can compare save games. With this tool we can identify mistakes in our implementation of functions way more quickly than before. It has already been of great use just this month, helping track down the station name issue we mentioned, and helped resolve some very annoying issues in the road station creation code. Great work, @memellis!

As always, please find the changelog on GitHub.

Updated: