Friday Dev News #47 - Rail Building

Hello everyone!

In this week’s update we’re releasing mostly bugfixes, but also a road building convenience features as well as the Hungarian translation.

Changelog

  • If two neighboring roads are too close to each other at an intersection, they now auto-bend instead of going red and complaining about it
  • Elevated roads now also snap to road angle + length and respect the auto-curve button
  • Fixed an issue where the research queue number wasn’t properly displayed
  • Fixed an issue where in cities with over 6k population you couldn’t get a “high” immigration rate
  • Fixed an issue where every second a small lag appeared on some computers when the tutorial was active
  • Fixed an issue where a part of an overpass would snap to the ground when connecting a road to it
  • Added Hungarian
  • Added support for Thai characters

Rail Building System

After a bunch of weekly updates since release, we’ve begin to shift our focus towards the next big feature: Trains. You’ve already seen some art, but until recently the 2 programmers on our teams have been busy fixing stuff and adding QOL features.

This week, we implemented the rail building system. Check out the results:

Rail building works similar to road building with some minor differences. However, we couldn’t simply re-use the road code since the traffic simulation of trains works a lot differently. Instead, we had to go through the road code and carefully separate the road construction logic with the road traffic logic. This took a bunch of time since we had to deal with a couple thousand lines of code. Now that we’re done, we can use most of the road construction logic for rails as well and just replace the traffic logic part.

How trains will work

A big question when implementing trains is how complex will they be? We sat down and came up with the following plan:

  • Trains will not collide or pass through each other and have to wait for the next part of rail to be free.
  • You will not have to deal with train signals, the game will handle that automatically.
  • You will however have to set up train lines from station to station.
  • The traffic simulation will give train lines a higher priority than all road types so cargo will use train connections if the stations are not too far from the start and destination
  • All rails are one-way. If you want to go back and forth between train stations you need to use 2 rails or make a loop (this makes auto-signaling way easier)

Roads will remain the most convenient type of transportation (just connect them), but they are more susceptible to traffic. The ideal use for trains is connecting industrial districts that ship a lot of goods between them and take traffic pressure off the roads.

Finally, I just wanted to say that I read all forum and discord posts even if I don’t answer every time. We have plans for stuff that’s frequently requested like grids or grid-like systems for building, but we’ll focus on the the trains first :slight_smile:

Until next time! Happy playing!

10 Likes