Self-clocked station loading

Got an idea for OpenTTD? Post it here!

Moderator: OpenTTD Developers

Post Reply
Posts: 1
Joined: 13 Aug 2019 03:44

Self-clocked station loading

Post by ybungalobill » 13 Aug 2019 04:24

Hi All,

I came with the following idea out of frustration of using the timetable feature: I wish a vehicle would wait as "Full load all/any cargo", except that when there's no more cargo left at the station, and there's another vehicle at the station that's ready to take over the loading, the first vehicle will leave the station. Let's call it "Sync load any cargo" -- vehicle A leaves the station if for any of A's cargo types there's a vehicle B at the station that can load that cargo, and "Sync load all cargo" -- A leaves the station if for each of A's cargo types there's some vehicle B at the station that can load it. I assume here that OpenTTD already has some kind of FIFO loading order on vehicles that load the same cargo, so for the sake of the above definition they would be handled in that order (A is the one that loads first in that FIFO order).

For those who are familiar with TCP: this is in essence how a basic TCP implementation works -- it sends the next packet when an acknowledgement to a past one arrives, thus the network self-regulates the timing between the packets without any need to fine-grained timers. In OpenTTD terms -- packets == vehicles.

Rationale: it will work as self-regulated, self-adapting, timetables. No micromanagement required (e.g. no need to reset the start date when adding vehicles to the group, or redoing the entire timetable when replacing with faster vehicles, optimizing routes, etc...). It automatically minimizes vehicle round-trip time while still preventing vehicles from 'clumping' together.

Limitations: in its straightforward implementation, for stations that can handle at most one vehicle at a time (e.g. one platform train station or a helipad), vehicle A won't know that B might be waiting for it just outside the station. In principle it should be possible to fix that later with a more complicated logic.

So what's the community's opinion about this suggestion? Regardless of that, can somebody who's familiar with the code give me some pointers as to where's the vehicle loading and waiting logic is? (I could tinker with it but I'm not familiar with the codebase :lol: )


L. Spooner Inc
Posts: 21
Joined: 22 Jul 2019 08:13

Re: Self-clocked station loading

Post by L. Spooner Inc » 13 Aug 2019 12:25

I just ran into a similar problem with truck depots. I had two trucks heading to the depot to drop off rubber, and two heading to pick up the goods to deliver them to a nearby town. Unfortunately the goods trucks got there first, blocking the rubber trucks from dropping off their load and sitting at 0% with their "load all" orders. I tried to turn the goods trucks around, but the rubber trucks had them blocked in and wouldn't move. Even adding a second truck depot wouldn't clear the logjam. I ended up having to pause the game, clear all their orders, and send the rubber trucks to their vehicle depot so I could back up the goods trucks.

Post Reply

Return to “OpenTTD Suggestions”

Who is online

Users browsing this forum: TopTechDreamer and 3 guests