Railcraft

Railcraft

34M Downloads

[Feature Request] Multi-Route Tickets and Route Consuming Tracks

ssotangkur opened this issue ยท 7 comments

commented

It would be pretty cool if there was support for a multi-route ticket and a route consuming track.
This way you could say I want my train to goto: 1) TreeFarm 2) Charcoal Factory 3) PowerPlant. After it gets to the TreeFarm, the route consuming track removes route (1) TreeFarm and now the train will start heading towards the Charcoal Factory.
This allows you to give the full routing instructions from one location. Currently, you would have to re-route the trains after each "leg" of the journey and that can get complicated if the information that's needed exists at the starting location.

commented

@ssotangkur Just use routing track and detectors. That's what I do. You can set the 1st rout on the train. when the train gets done at the 1st stop. Use a routing detector to read the trains current ticket. and use a routing track to change the trains current ticket and send the train to the next rout.

That's what @Forecaster showed me how to do it. and I think there's a video on this.

commented

Another way to do it that might require less and shallower modification of the existing systems would be to implement Ticket Books, these would be a container item which you put tickets in and then you use the book in place of individual tickets. Inside the ticket book the tickets would be ordered, and whichever is top or current is the ticket shown to any routing devices encountered by the train. Certain kinds of tracks would then pop tickets off the book, or increment the current position.

The advantage of popping tickets off the book is that it's very simple, and it could be made such that trains have a slot for books and a slot for tickets, and as tickets get disposed of by track, the next ticket in the book pops off and fills that slot; in this way the only changes that would need to be made would be allowing trains to accept books as well, adding the ticket disposal function to some tracks, and adding the book GUI systems. The disadvantage is that this does not easily accommodate the concept of golden tickets, but it would constrain handling of golden tickets to the book's operation.

The advantage of advancing index books is that there would not need to be any special handling for golden tickets, and trains would not need a separate slot for the book. But also this would permit used tickets to be kept as receipts so the train's previous path could be checked, perhaps only by ops. The disadvantage is that everything which looks at tickets would need to be changed to understand ticket books.

However neither of these would require user built routing networks to understand that there are ticket books in play, the train would always be directed based on the Dest of the current ticket and other details about the train.

I'm uncertain which direction is more work, but I'd lean towards fewer special cases.

commented

So, because @ssotangkur made me comment on this - some ideas how this could look ingame:

  • new mode for the Routing Track "add ticket" in addition to the "replace ticket" we have so far.
  • new track or as third mode for the Routing Track "remove first ticket"
  • Adding and removing tickets with this method can be either stack or queue like, but be consistent about it. I think a stack would be more intuitive.
  • Internally the locomotives will use some kind of list to store the destinations
  • add a way to display the full list of destinations
  • make sure routing motors only consider first (current active) ticket for routing decision

Optional features

  • add a way to craft a Ticket Stack to set multiple destinations with one track or directly in the locomotive.
    • normal variant
    • golden variant
  • a ticket in the remove track (or routing track in remove mode) acts as a filter. I.e. it only removes the ticket if it is the same destination.
commented

What if "Dest" had support for multiple destinations, like: "Dest=Factory,Farm,PowerPlant".
Make a queue and a route consuming track will move it to the next element.
When the queue is empty, it starts from the beginning.

commented

I'm not sure I like to use the word "ticket" to refer to cyclic route. If it was called a "route" or "plan", I think it would be okay, but just not ticket.
I would also like to be able to craft a multi-route using something like the crafting table. I think that would open up a lot of interesting possibilities. We could also make a ticket have multiple "Dest" lines so we wouldn't screw up ppl's existing networks.

I guess my proposal would be:

  • Convert tickets to have multiple Dest rows
  • Allow a paper multi-dest ticket to be crafted by placing any combination of : a golden ticket and a paper ticket in a crafting grid. Depending on their placement relative to one another, the golden ticket's destination(s) will be append or prepended to the destination(s) on the paper ticket
  • Alllow a golden multi-dest ticket to be crafted from 2 other golden tickets in the same way.
  • Locomotives will maintain a queue/stack of destinations. Placing a ticket in the loco's GUI will replace all its destinations with the one(s) in the ticket. Only the first destination will be considered the current or active destination. The label displayed when you look at the loco will be a slash separated list of the destinations ending with an ellipse (...) for labels that are too long.
  • Routing tracks will have the following options in its GUI (select one): Add First, Add Last, Remove First, Remove Last, Clear, Replace. The operation will only take effect if a redstone signal is applied.
commented

I'm kind of against the easy infinite loop thing. I think once a dest is consumed it should not magically pop back up. So if you want to make the locomotive go in a loop, you set the starting point as last dest. once the loco. is back, you can just apply the same route again.

commented

@ssotangkur sounds pretty solid, though I'm not sure about the ability to add to a ticket from a track.