NIMBY Rails devblog 2024-08

Schedules

After trying and testing some design ideas in July, a new scheduling system was implemented in August. To recap, the design ideas that pass the filter of soundness and compatibility were:

  • Schedules as a top level object, on par with lines or trains, rather than being a configuration detail of trains.
  • An explicit shift system, rather than the very limited “auto copy” system of previous versions.

The first task was to implement the new Schedule model and editor. Schedules can be intricate and time intensive to craft, plus they are a very unique feature of NIMBY Rails, so they deserve a highlighted and central spot in the game design, rather than being a half hidden tab two panels deep in the train editor. Schedules should be able to exist without any train assigned to them, and they should be “owned” by no other object, remaining impervious to train or even line deletions (with the corresponding error message if required). To this end the changes in the game model were implemented, and then a new top level editor UI was created for them:

The basic schedule attributes are a name, a color and a time zone. These last two can be made automatic, so they are picked from the line of first order in the schedule. Schedules can also be tagged to use as categories in schedule listings.

The meat of schedules is their list of orders:

This is essentially the same as the former Order tabs in trains, with some improvements. The most visible of them is the redesigned order listing. It has been changed so it easier to visually scan an order for a certain time, by making the time appear always in the left margin. The 3 letter day names are now gone and instead orders are separated by a day title (this is purely cosmetic). And the text and icons have been rearranged to hopefully make them more readable.

The order attributes themselves have a couple changes too. The group dropdown allows to set the group of the order, which are explained later in this post. And the loop setting is gone. It has been replaced with an explicit repeat counter, so it is now possible to tell an order to repeat an exact amount of times, with the last run being padded:

The game logic will only create enough runs to fit until the next order, even if you ask it to create more than that. So it is not considered an error to input too many repeats. And if you don’t want to deal with this feature, you can just use the “Max” checkbox at the right of the input text. It works exactly like the former loop setting, and it will change the repeat number to 1 when it is unset.

As mentioned earlier, schedules and their orders are independent of trains being assigned to them. The “glue paths” timing will now always use the reference train of the line under said glue path occurs.

Schedules by themselves do not correspond to any train. Indeed, the list of orders in a schedule might end up not being run as-is in any way. You can also create schedules without fear pax will assume they can use them, because by default pax ignore all schedules.

Shifts

So, how to make pax consider your new schedules? Or to make a train run them? By creating shifts:

Shift basics are just a name and one train. A train can only be assigned to a single shift. If you try to assign a train to a shift while it is already assigned, it will automatically unassign itself from its former shift. Shifts can be in an unassigned state, without a train assigned. They are fully editable in this state but they are completely ignored by pax. Any train assignation change implies a timetable rebuild, so shifts become visible or invisible to pax always after a timetable rebuild and always after a direct player editing action, thereby fixing the major problem in this design detected in July.

A shift conceptually contains a copy of the schedule orders, with zero or more changes:

The order editor features for shifts are very limited compared to the base schedule orders. This is on purpose, to avoid reducing schedules to a category name where anything goes into the shifts. But the 2 editing tools in shifts are very powerful. First, it is possible to disable orders:

This means that the different shifts in a schedule can enable or disable individual orders, on a per-shift basis. For example to disable some orders only in some trains during the weekend. Or create multiple orders with the same start time in the base schedule, and selectively enable them in the shifts, to make trains take a different line, without having to create separate schedules.

The second feature is to override the order start time:

This allows to change a particular order start time individually for a certain shift. This way the base schedule can contain a general version of the orders, and shifts can tailor them to particular subsets of orders at particular times, without having to redo the entire schedule.

Groups

The most common per-shift change compared to a base schedule is to offset its orders by a certain amount of time, to create servicing intervals. Players can do this manually with the tools already introduced, but a new feature, Groups, helps to automate this. This feature is similar to the interval feature present in train groups in 1.13, but much more powerful.

Groups are a way to automatically add time to a shift orders start time. Its basic usage is to modify all the orders for a certain group in the shift with a manually input value:

In the screenshot all orders of group 1 and 2 are being offset by 14 minutes, without having to edit them one by one. This is the basic usage of groups and it is already very powerful, allowing to batch edit orders without creating individual exceptions for each of them. This also means any order editing in the base schedule is independent of the group offset value too. With this change, the per-order setting, and the fact there’s now 8 groups to use, I expect groups to be of more use to experienced players.

When using the auto group mode, it is not necessary to input the offset value in the shift. Instead it is automatically calculated for you, at the schedule level:

This is a way to distribute time over one or more shifts. The schedule level configuration allows to set a time distribution policy: a fixed interval, an interval calculated from a duration input by the player, or an interval calculated from the duration of a line. The divisor for these intervals is always the number of shifts which have enabled the group in auto mode.

Groups are an optional feature, and in their default state in a newly created schedule and shift, they change nothing in the orders. You can incrementally enable them, on a group by group basis, then with manual shifts, and then by auto interval if desired.

Importing 1.13 saves

1.13 saves should be very compatible with 1.14. There’s 3 major cases or train orders in 1.13:

  • Auto run lines: there’s zero changes to auto run lines, including keeping the auto run settings in the line editor, and being able to add and change trains into auto run lines at the exact same spots in the train editor. Players who don’t want to engage with schedules should see zero changes in their gameplay.

  • Manual trains without copiers: a new schedule will be created for each manual train, containing all its orders. This schedule contains a single shift with zero editing or group settings, so it exactly copies the base schedule orders. The single shift is assigned to the manual train.

  • Manual trains with copiers: a new schedule is created for the main train, identically to the no copiers case. Then each copier is added as a new shift, and one or two groups are used to replicate the copier interval settings of 1.13.

The design of the new Schedule system in 1.14 has been heavily constrained to make sure 1.13 saves are imported as perfectly as possible. But even after this effort there’s a couple changes to keep in mind.

  • Glue paths are now based on the line reference train, not the shift train. This might produce different timing if you often mix very different trains in your lines and orders.

  • Copier trains might have been reordered. It is possible to manually order shifts in 1.14 with the arrow icons in the schedule listing, so you can restore the old ordering if it’s important.

The development of the new schedule system is quite advanced at this point but testing has been limited. I still have some development left to do and a lot of testing, and it is possible I might find new issues while testing imports with player saves, so the design could still be in flux.