Train stuck: depart condition "empty of [] product" blocks sequential unloading?

Fixed Trains
felisarcanus [discord] · 1 year ago

With this departure condition, my train gets stuck after unloading at its first position. Without this condition, or changing it to a material the train has none of, the train scoots forward to sequentially unload all its ore hoppers at the unloading stations, then departs.

The behavior I expected is for the depart empty condition to instead be either

  • not checked before all wagons attempt unloading once or more
  • checked based on the train's current position, so that the train can scoot forward iff the condition is currently true about the wagons it has attempted unloaded so far.

Screenshot_From_2025-06-04_01-08-49.jpg

Files not imported: 28_train_on_land_bridge.save

eryk500 [discord] · 1 year ago

Your siding is waaay to short.

Check the UI of the train when it leaves early.

Trains will stop unloading early, if they end up coming in contact
with a fork/diverging switch (from the perspective of the station)
while re-positioning to unload.

I mean, how can it know which way it's ok to proceed?
Each "stop" can have multiple stations, so this can't be checked in advance.

felisarcanus [discord] · 1 year ago

that's true but also doesn't prevent the system from working with everything else identical except for this departure condition

there's nothing actually to the left except a turnaround loop, so it hasn't gotten in the way of anything yet lol

wait no sorry I just reread that: the train definitely does continue forward into the "no stopping" junction

the train isn't stopping unloading when it hits the junction

it's oneway track so it doesn't have a choice which way to go, if that affects anything

eryk500 [discord] · 1 year ago

That's ok, because that's a "merging" switch after the station itself,
but if you have more stations in either direction on independent sidings,
then their switches would be "forking"/"diverging" ones, which would cause the problem.

felisarcanus [discord] · 1 year ago

oh I see what you mean, gotcha that makes sense

but yeah the train doesn't leave early: it parks forever in this spot lol

Screenshot_From_2025-06-04_01-14-42.jpg

until i delete the departure condition or change it something like this

these are what the station modules look like

Screenshot_From_2025-06-04_01-11-51.jpg
Screenshot_From_2025-06-04_01-11-37.jpg
Screenshot_From_2025-06-04_01-11-29.jpg
Screenshot_From_2025-06-04_01-11-22.jpg

eryk500 [discord] · 1 year ago

Yeah, that's an another problem.

Probably if you would be explicit about which products
need to get unloaded, it could possibly work.

But yeah, this should be fixed.

felisarcanus [discord] · 1 year ago

I'm pretty sure I tried changing it to iron ore or to sand, and that also didn't work

sand I would expect not to work, of course

just checked with iron ore and with sand, and the train stayed parked as is

Screenshot_From_2025-06-04_02-47-22.jpg

and I changed the station to now requesting trains "unrestricted"

swapping to acid, the train immediately changed to "Arriving" and scooted forward

but yeah it was worth a shot! thanks for offering ideas to help

eryk500 [discord] · 1 year ago

I'm curious, what happens if you swap the assignment
of the second to last wagon from Iron ore to Sand
(this could be caused due to the odd car alignment)?

Other that I have no idea. Maybe the train is too long for the siding?

Captain Jeremy Captain Jeremy · 1 year ago

I think this is a bug/bad implementation yes: we don't progress the alignment if the current set of wagons could be active and the condition is not yet met. I think your solution sounds like the right one: if the condition is met with the current set of aligned wagons, we should progress.

felisarcanus [discord] · 1 year ago

Working great /as expected for me in v7.5 b445 thanks, and great work as always! Hopefully this way works better for most people 🙂

eryk, the odd car alignment is actually what the train cleverly did itself. It's an odd wagon count, so it first scoots forward four wagons, then scoots forward only three, presumably because that's the closest available position every wagon could be matched to a loading port.

felisarcanus [discord] · 1 year ago

In my case, swapping the wagon's intended material probably I couldn't test lol because I think trains prefer to unload front to back and I wasn't using sand very quickly. I don't see a unity-dump train wagon contents.

Perhaps unwanted/mismatched wagon contents should be prioritized first for unloading? Because like in my case, I'd have to manually prevent it from loading sand in the front if I wanted to swap the materials, because two wagons of sand would always fill the unloaders before we reached the end of the train.

Prioritizing unloading unwanted materials would probably mean the train would have to back up in some cases, which idk if it's currently allowed or not? but personally I think that'd be cool. Not sure how useful it is though, especially if a unity-teleport is being added later (which idk)

felisarcanus [discord] · 1 year ago

STUCK AGAIN but in a more complex way.

TLDR: should the train scoot based on other materials it currently has, or only materials currently matched up to an unloader? How about materials that the train might have, but ran out of? What should "accepted product" mean?

How this happened: I'm not filtering hoppers, partly because I'm curious how smart the train will be about changing what it loads if something runs out, and partly because it takes too many clicks (or I'm missing something). My train seems to have loaded the first four wagons all with sand, probably because the mine ran out of iron ore. The train does still have iron ore, but in a later wagon, so that only material currently matching an unloading is sand, but that's full.

But if my train scoots forward, it could unload the iron ore, at which point it would satisfy the depart condition. I think it should probably do this, because I see the depart condition and "accepted products" as a rule about the train as a whole.

Of course I can manually assign hoppers and separate platforms etc. to avoid this, but just sharing to help with the cool intelligent trains.

What also works now is changing "Empty of Any Accepted" to "Empty of Iron Ore", but my initial thought is that perhaps it should include all materials that

  • this station has a non-paused unloading station for
  • this train line has a non-paused loading station for, at any other station it visits

The odd case I forsee with that is that if your train can load iron ore and coal but the coal runs out, it would be willing to immediately leave a station requesting iron ore and coal. I think this is probably best, or else it might never refill on coal. But perhaps if someone stops supplying coal that way, maybe the train should forget about the coal if it's only carrying ore recently.

Anyway lol sorry I write a lot, but maybe that's helpful for your train design thinking. I'll continue enjoying CoI either way, thanks!

Screenshot_From_2025-06-07_05-58-41.jpg
Screenshot_From_2025-06-07_05-38-35.jpg
Screenshot_From_2025-06-07_05-38-13.jpg

felisarcanus [discord] · 1 year ago

just noticed a tiny bug in the pics: I renamed the stations to show you what it was accepting, but it didn't also update in the trains' windows (but it did once the train arrived at the station)

Closed as ✅ Fixed

7 Showing 1–13 of 13