Make Simutrans speak your language.

Road Line Builder Tool

Started by robp94, January 06, 2019, 05:00:19 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.



It has always taken me too long to create many simple bus lines (and in my opinion, it's pretty boring in the long run).
That's why I've created a dialog tool, which can / should do much of the work.

Here is a simple gif which demonstrate the tool

In short:

  • you mark your desired line with all border points (start/end/curves)
  • and the tool places stations in between and creates a line with the stations
In addition, you can determine the name of the line and, if desired, let a counter be added to the name.

Possible todos:

  • place stations underground or at bridges; use a path search or something like that, at the moment it just takes the road on the ground
  • let user select station building, at the moment it is random like the ai would build it
  • make it smarter; note already existing stations ...
That was my first time programming with c++ so the code could probably be better :).
Suggestions for implementing the todos are welcome or if you have other ideas.

Try it under windows
and add for example this line to the of the pakset, then you can open the tool with 'i'

Let me know what you think.


AT least in my simutrans games, I never have neat roads like this. I usually work with the roads I get from the city AI. I am not sure you tool can do a good job there as well. Because sometimes it is much better to skip a place or use a double stop to connect a single extra tile.


Yes, my problem with building bus lines is dealing with the chaotic street networks generated. Stuff like figuring out which streets are best to use to get best coverage without too much overlapping, how to space and adapt the stops (like putting the mail stop into a side street) when intersections ruin the ideal spacing, and when and how I really need to reshape the streets. (Sometimes I do reshape streets even when not building bus stops because the game has been too keen on building intersections, since intersections right next to each other is bad for through traffic as well, and looks silly.)

The average distance between intersections is in my experience around two tiles, whereas the example looks like it has more like four tiles. Building bus lines with a regular street distance of four would be a dream even without the tool!


Looking through old stuff: Should be this a task for a squirrel script?


Not entirely sure if the question is "I'm making scripted icons possible, should this be one of the examples" or "should this be implemented as is or as a script". If it's the later:

Say it would be implemented as dialog tool 32. Naturally, it would be unavailable to the player until the point where paksets add it to their menuconfig. But would they? The few comments suggest it's not a particularly useful tool in most situations, so why clutter the menu or use up keys that could be used for more useful tools?

Now if it was via a script, what the game needs is a way to access them. If the menuconfig could use scripts as target for buttons and shortcuts, this means it's functionally identical to the hardcoded version (with the same problem of "will there be a button defined"). Additionally, there could be a dialog that simply lists all available scripts - which means while inconvenient, there would always be a way to reach them for the player.

If the question was the former: I don't think this is particularly useful to be used, but the elements the script would contain (how to let the player choose several points on the map, how to place objects on the map belonging to a player, how to access, create and manipulate schedules) seem to be prime examples of what one would try to do with such scripts. So if the code is commented well, it might count as documentation.


I agree, that sometimes it is a little bit annoying to build a city bus network.
First you have to set waypoints, then you have to place stops at the waypoints, then you have to think about how many vehicles you need, or equivalently, what the frequency should be and calculate (or trial and error) setup this.
For rail transport this is fine but fir road transport this is sometimes a little bit too much of micromanagement, as the number of city bus lines is much higher than the number of train lines connecting the cities.

However, I don't think this tool is a good solotion. In many situations one will have to manually modify lines and stops by hand, leading to nearly the same or even more time required than it would take to set the line up completely manually.

What I would suggest instead is a "create stops" button for road transport, which would simply place the default (maybe configurable) bus stops at the waypoints, where possible. Warnings should be given for waypoints that can't be created, e.g. because these are on a crossing or in a tunnel when no tunnel stop is available.

Maybe this could also be useful for rail transport. In that case, for sure, the button should be greyed out/unusable as long as there are no vehicles assigned to that line because these are required to determine the platform length. In some rare cases, there are also road vehicles that are longer than one tile, so this should maybe also be considered when setting up road lines.

The second issue ia a completely different one, which is often even more time consuming than setting up the route and stops.
I suspect that a simplified semi automated variant of schedules could work well here.
One simply assigns "wait for time" at a station, but leaves departures per month at 0 for that station.
In that case, the game could guess travel times and internally use schedules according to this. When a vehicle arrives at such a station, frequency should be recalculated based on the given actual travel times.