Nullius


In this Factorio prequel, you're an android terraforming planets and seeding them with life. Replaces all recipes and technology. No life means no coal, oil, wood, biters, or free oxygen, requiring varied renewable energy sources. For reliability, you'll focus on abundant elements from the air, sea, or common minerals such as iron ore, bauxite, sandstone, and calcite. Advanced technology enables asteroid mining of rarer elements.

Overhaul
9 months ago
1.1
33.6K
Environment Mining Fluids Manufacturing Power

b unable to automatically charge batteries from train engines

2 years ago

i think this is a bug because of the inserter behaviour described. i'm assuming the bug is "inserters sometimes won't take batteries out of/put batteries into train engines" but i guess it's possible inserters aren't supposed to be able to do that, and the bug is that they sometimes DO. either way, behaviour is inconsistent so something's up.

the situation: one linear train track with loops at each end, one train. a single engine, a single carriage. the train is powered by one battery. by sheer luck, that one battery is just enough to get it from input station to output station with the tiniest bit of energy to spare. i think it can move literally one or two blocks before running out.

i have a priority electrolyser at each station and inserters positioned correctly to remove the spent battery, charge it, and return it to the engine.

the problem is, that doesn't actually happen when the train stops next to the electrolyser. in attempting to figure out what's going on, i've discovered some strange behaviour:

  • if i pick up the engine-to-electrolyser inserter and then put it back down, it will remove the spent battery
  • doing the same with the electrolyser-to-engine inserter doesn't trigger it to insert the charged battery
  • if i add or remove a carriage from the train while it's out of fuel, that will trigger both inserters to behave correctly
  • if the train runs out of power just BEFORE arriving at the station, it will roll to a stop at the electrolyser and the inserters will behave correctly

i plan to experiment further but i wanted to start this thread before i forget how this began.

i SUSPECT the inserters behave correctly when the train is set to manual (as adding/removing carriages set the train to manual), but obviously that doesn't help me automate the process of recharging.

the problem might be related to the train running out of power immediately after beginning movement again.

backing up my save file before i experiment further. i'm not sure what vector i would best use to upload it but, if it would help, i'll do so

2 years ago

You don't get the spent fuel result item back until the last bit of energy is used up. It seems extremely risky to try timing it so that it gets to the train stop with precisely zero energy. I'll see if I can reproduce what you're talking about, but it seems like the answer is going to involve having some spare batteries in the train.

2 years ago
(updated 2 years ago)

i have the electrolyser positioned where the train stops when it runs out of fuel immediately after starting to move again.

hopefully this save file will help clear things up: https://cdn.discordapp.com/attachments/309531942997721088/975950285212114944/nullius_train_battery3.zip
(hosted on discord, clicking this link should immediately attempt to download the file)

when you load the save you'll be standing next to a train with no fuel and one spent battery.

  • pick up the train > electrolyser inserter and put it back down. it will fire. (you can try the same with the other inserter, but it won't fire)
  • you will have to manually collect the charged battery and put it in the engine. i recommend riding the train because it's a long walk back with no speed upgrades.
  • when the train arrives at its station, wait for it to empty and begin to move. it will immediately run out of power. the inserters it's next to won't fire.
  • set the train to manual. both inserters will fire correctly

it's my experience that what i'm describing is fairly consistent, so you should be able to do several loops of the track to experiment with this odd behaviour.

also consider testing the following:

  • when the train is out of energy at the station, place a second cargo wagon (in inventory, you can just pipette it) on the train.
  • wait for the battery to be charged and replaced, then set the train to automatic and ride it to the next station
  • watch what happens when it runs out of fuel and rolls into the station

alternatively, here is a blueprint string for the length of track i run my train on: https://pastebin.com/T69by0vd if you want to try reproducing this in a sandbox.

my conclusion is that there's some odd inserter behaviour that happens specifically when a train runs out of fuel right next to inserters, but it is not stopped at a station

2 years ago

I think I see the issue. When in automatic mode, inserters will only unload or unload from a train if it's exactly parked at an official train stop. If it pulls out of the stop and then stops again due to a train signal, the inserters won't touch it. Or in your case if it runs out of fuel right after the train stop, it won't load or unload, because it's not quite at the train stop anymore. If it didn't do it that way, then imagine if the train stops for traffic with a cargo wagon lined up at your fuel station and it starts loading fuel into your cargo. It would make stations harder to design and use to make sure that doesn't happen.

In manual mode it's less picky. It will load or unload as soon as you stop the train, regardless of whether you're at a stop.

This of course, is not Nullius specific. The base game makes these implementation decisions about train behavior. The only Nullius specific aspect is that the fuel here has a spent result when its used up, which vanilla trains don't.

2 years ago

it did not occur to me that this could be down to the base game, because i was so focused on the spent fuel aspect. thanks for explaining.

unfortunately, i'm not able to make more batteries yet (i used one of the batteries out of my suit for this) so rather than be sensible and switch to hydrogen fuel, i'm going to add a tiny bit of length to the track so the train stops at the station when the battery runs dry.

New response