Project Cybersyn - Logistics Train Dispatcher


Creates a feature-rich train logistics network through cybernetic combinators. With just this mod you can coordinate the economic inputs and outputs of your entire megabase.

Content
3 days ago
1.1 - 2.0
25.5K
Logistics Trains Circuit network

b Trains not refuelling

2 months ago

Hello All,

I'm running a pretty large base, based on bobangels' mods, where the main logistic is handled by Cycbersyn, currently with 718 stations.

Today, withou any prior sign, many locomotives started stooping because they ran out of fuel, even if I have 7 refueler stations around my base, all filled with fuel. It looks like locomotives do not go to the refueler stations. I also tried to tweak the threshold for refuelling in the mod settings, setting it to 1 (i.e. locos always refuel), but without any help, I still get trains running out of fuel.

Any help?

Thanks in advance,

Nerby

2 months ago
(updated 2 months ago)

Hi, I've had the same issue, spent hours trying to debug it, but could not work it out. Only way I could fix it was to delete me trains and rebuild them all! Stumbled across this Reddit Post.

The key take-away copied here:

"I’ve had this issue before using cyber syn. What happened in my case was that I destroyed a pickup station that some trains were already assigned to. The trains did the same thing, just driving around until they ran out of fuel. Even when I thought I replaced the problem trains, they always seemed to come back in an hour or two. I ended up replacing every train on the network because I couldn’t figure out what was going wrong and that fixed the issue in my case. I suspected that syn stored the destroyed stations information somewhere and whenever a call for say copper plates came through, it would try to send a train to that station to pick up copper plates which was resulting in a train getting “lost” every few hours."

So with your large base, you're not going to like it, but the only way I could fix the problem was to destroy/remove the trains and rebuild them, it seems there's some kinds of logic deep somewhere, that bugs the trains when something happens to break the connection to their depot or refuelling station. It's not something you can see by looking at the Train schedule.

I'm speculating only, so if someone else has more info please chime in to correct me.

2 months ago
(updated 2 months ago)

I may have found a solution, but if there's someone else around who has the same problem, please check if what I explain here is applicable to her/his situation as well.

I had a look at Cybersyn global variable, as explained here: here, i.e. running the command:

    /c __cybersyn__ log(serpent.dump(global))

and the variable to_refuelers had seven entries, exactly seven like the number of my refuelling stations. This made me think that as a consequence of a bug, Cybersyn thinks all refueler stations are occupied, so it doesn't send other trains to refuel. To make a long story short, I went to a refuelling station, then deleted and recreated the train stop. Immediately all trains in need of fuel came to this stop. So I proceeded replacing the other refuel train stops, and now things are working again.

BTW, I grew tired of looking for all locos that ran out of fuel to fill them again, so I developed this microscript to achieve this goal (beware, it will disable further achievements):

    /c for _, loco in pairs(game.player.surface.find_entities_filtered{type="locomotive"}) do
    if loco.burner.inventory.is_empty() then
       loco.burner.inventory.insert({name="solid-carbon", count=40})
       end
    end

Of course, you need to use the correct fuel, or ... if you really want to cheat use nuclear fuel!!

New response