News Liste Art of the Rail

Devblog #3: Refactoring Multiplayer and Optimization
Art of the Rail
04.01.22 11:21 Community Announcements
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.

Multiplayer Performance Improvements



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.



Optimizing Rendering/Movement for lots of vehicles



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.

Assigning Allowed Cargos





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.

Next steps





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.