OpenLoco v24.06 is out! It’s been a little quiet this month, as many of the team members have had holidays. This has led to a short changelog, but there have still been a good number of changes under the hood.
For a complete summary of changes, please find the changelog on GitHub.
Game Commands: Remove Road Station (#2422), Remove Airport (#2454), Vehicle Place Water (#2482)
Aaron and myself continued the game commands project this month, implementing the remove road station and airport commands. There wasn’t anything too noteworthy we found from implementing these functions, but it does take us ever closer to the completion of the game commands project. There are now only 17 of 80 game commands left to do!
Paint Surface (#2459)
As mentioned in previous posts, the paint functions set up the drawing of tile elements. One of the largest paint functions left to do was the surface elements. Fortunately, it wasn’t overly complex, just a very long function. The code was mostly similar to (Open)RCT2, but a couple areas had been completely reworked for Locomotion. Cliff edges, for example, work very differently, and are considerably more complex compared to RCT2.
Along the way, I found an interesting bug in Locomotion. If for some reason you manage to put more than 8 tunnels in the same surface element, all facing the same way, you might crash the game! It seems at some point 8 tunnels was meant to be the limit, but later on it was increased to 16. However, not all of the checks were modified. This issue has now been fixed.
Implement Final Graphics Engine Functions (#2485, #2487, #2489)
@ZehMatt and myself finished off the graphics engine this month. One of the functions, drawImageMasked
,
is quite an interesting function. This function takes two input images, and uses one image to mask the other image,
e.g. if the pixel value is 255 on the mask image, then the pixel in the image is drawn.
This function existed back in RCT2, but wasn’t used anywhere near as often as it is in Locomtion.
For example, all cliff edges on surface elements use masking in Locomotion to achieve a much better look
compared to RCT2.
Refactor Graphics Engine (#2479, #2480, #2495, #2496, #2498, #2507)
With the graphics rendering functions complete, @ZehMatt could start refactoring and work towards splitting out the engine into a standalone component. There is still further work left to do, but this will greatly improve the layout in the code and allow us to improve test coverage.
Implement the Map Generator’s generateMiscBuildingType1 function (#2356)
This function deals with placing electricity pylons from (coal) power stations to neighbouring towns. In vanilla Locomotion, the Coal-Fired Power Station object is the only industry that uses the Electricity Pylon object in this way. It had us stumped for a while, because these are the only vanilla objects that use these, but they are not selected by default in the scenario editor!
Music improvements (#2337, #2371)
Contributor @ilmoro93 decided to improve the way music is paused and unpaused in the game. A bug we introduced last year prevented paused music playback from resuming automatically when the game is unpaused. Moreover, the title screen music is no longer interrupted when you load a save game on the title screen!
The fact that this went unresolved for months reveals that the dev team usually plays without music. We’d hear the same part of the same music to no end, driving us (more) mad in the process.
Standardise Function Names (#2503)
New contributor @ShuraxN has been helping to improve the codebase by standardising a couple of functions names.
This PR was focused on rotation
and sequenceIndex
which we had called direction
, unkDirection
,
multiTileIndex
in various places. It’s a little change, but should simplify things for any contributors.