Devblog #3: Refactoring Multiplayer and Optimization

Art of the Rail

Spiritual remake of the classic transport tycoon games. Build a profitable transport network and grow your worlds economy, either on your own in singleplayer or in multiplayer whether cooperatively or competitively.

Over the past six months things have been busy for both the project and myself. Petr and Paul (our two artists) have been hard at working making lots of new content for the game, slowly chipping away at the industry tree for the game. I've been focused on a mixture of running our studio and setting the groundwork for Art of the Rail's tech architecture. [h2]Multiplayer Performance Improvements[/h2] One of my biggest concerns prior to release was the performance of multiplayer. I just wasn't happy with where it was at, I was already encountering serious bugs and I didn't have anywhere near the number of vehicles I wanted. So I focused on a major rework. It was really very substantial. This resulted in me redoing entirely how updates are sent to clients. As part of this I also did a lot of optimization and bugfixing, improving how clients connect and files are transferred. Overall - I'm very happy with the result. [img]{STEAM_CLAN_IMAGE}/38883601/d0dca1da74f337088449c32448519eac0dfe83fc.png[/img] [h2]Optimizing Rendering/Movement for lots of vehicles[/h2] Additionally I wanted to further improve the rendering, to ensure that I really could display lots of vehicles. I don't feel like many games really achieve the level of scale I wanted from the title. This involved improving how vehicles are rendered, removing how trucks calculate whether to stop or not, and also how garbage collection (an issue with C#/unity games) was handled. I achieved great results in most of these, although the truck collisions, while now very performant, have some edge cases I need to deal with. I also changed how vehicles move along the splines, making it more performant while solving some jittering issues. There's still a little jitter, I think related to a mismatch between timing of my thread (which moves the vehicles) and the game thread (which draws them). I'll ask some of our super programmers at the studio to give me advice on this. [h2]Assigning Allowed Cargos[/h2] [img]{STEAM_CLAN_IMAGE}/38883601/53a7664b838eef3c00a702d7693a50e9b824d5ff.png[/img] I also played around with new mechanics. One I am very pleased with is bay and cargo assignments. I started with the vehicles, allowing you to restrict what can be loaded. Let's say a wagon takes all kinds of ore, you can say "only accept coal". These settings are copied when you clone a vehicle. Then I expanded it to bays, making it really great to micro where you want road vehicles especially to go - allowing you to have a dedicated bay. I need to work on the UX for it a bit, but overall I think that direction really fitted well with wanting to make the stations more a "thing" in this game than others in the genre. [h2]Next steps[/h2] [img]{STEAM_CLAN_IMAGE}/38883601/86fc9e9214a8ed627364b491b79271503998ed75.png[/img] The big next focus is going to be layering in cities. This will also include work on alternate transport options such as trams. I also want to work more on the multiplayer bugs, such as jerky vehicle movements. I've been testing mostly with dedicated servers, trying to improve how it runs to make it really easy to host.