SSPP Logistics Train Mod

by jagoly

A logistics train mod that aims to be as pleasant to use as possible, even when knee-deep in byproducts. SSPP stands for Source-Sink-Push-Pull.

Content
3 months ago
2.0
739
Logistics Trains

g Crash when trying to send to refuel

4 months ago

Hi. I'm getting a crash in this save of my latest game:

https://drive.google.com/file/d/17UiFgWNXywWuuOQhvOFxEukVs8dC_ary/view?usp=sharing

Here's a screenshot of the error:

https://drive.google.com/file/d/19REjl3mytH5hVBVKKUiRknlwkSnaYhQZ/view?usp=sharing

You'll need to let the game run for about a minute for the crash to show up.

Contextual info:

I'm swapping my steam trains to electric trains, so there's a lot of batteries to make and a big queue at the refuelling station as each train that I've created uses up its initial supply of 25 batteries. The production line of stations for building batteries is mostly set to priority sink (except for copper and iron, which I have plenty of at the moment); so most of the game is sitting "on hold" waiting for me to add more trains - I've removed about 100 steam trains from the supply.

Thanks

4 months ago
(updated 4 months ago)

The issue seems to be with this fella https://imgur.com/a/2uHDyN8

When you renamed the original train class, this train should have gotten disabled and there should have been no way for it to switch back to automatic again, but because of a bug somewhere, it did. It's then trying to go to it's class depot, which it obviously can't because it's class doesn't exist any more.

I'll try and figure out what caused it to get into this state, but in the meantime, just destroying or switching this train to manual makes the problem go away.

4 months ago
(updated 4 months ago)

Ah, I think I can guess what happened. First, you changed the class of some item from the old one to the new one. This didn't cancel deliveries, because I thought it'd be best if trains are allowed to complete their jobs so you don't have to clean them up yourself. Then, while this coal job was still active, you renamed the class. Then, because coal was no longer assigned to that class, when the code goes to disable trains for each item using that class, that train didn't get disabled.

I'll have to decide if it's best to just cancel jobs if a train is no longer the right class for an item. It's probably best to keep things in a more consistent state. Either way, this issue will be fixed for the next version.

4 months ago
(updated 4 months ago)

Ah, thanks for finding that!

I decided to rename the old class to make the steam ones all stop, because it was becoming too difficult to distinguish the old ones from the new ones, after a while. Cancelling the job instead sounds like a sensible solution.

Something that you might want to consider, but may be too much effort, is to have another type of station, similar to the depots, that such trains go to when they are not in a consistent state, e.g. have the wrong cargo for their class / have an unknown class. Something like a "Repair Station"?

4 months ago

Hmm, that is an interesting idea. But, I think that a better option though would be just adding a way to make finding those trains simpler. A way in the network GUI to show a list of all currently disabled trains. I don't think most players would want to bother setting up a special repair station, and I think that they'd also have the potential to be more annoying then helpful (often the player would prefer the train stay at the place that something went wrong).

There's also something simple that could be added to to make the process of switching classes much smoother - each item in the network gui could have a "disable" toggle. This would work the same as the disable toggle in the station GUI, in that current deliveries would complete, but no new ones would be started. That way, the player could just disable whatever item they want to change, wait for deliveries to finish, and then change the class.

4 months ago

I think that adding disable buttons would also solve the problem, as long as it was easy to know when the item is no longer being considered for a shipment. Will it simply be a case of waiting until the train counts drop to zero?

New response