Smart Fuel


Furnaces, boilers, burner drills and inserters, locomotives, cars, heating towers, nuclear reactors and biochambers keep themselves fuelled: construction robots bring fuel from the logistic network (the hub on space platforms). Vehicles get the best fuel; machines get the most plentiful basic fuel and never your rocket or nuclear fuel.

Utilities
57 minutes ago
2.1
29
Trains Logistic network
Owner:
Crosstowndonkey
Source:
https://github.com/Crosstowndonkey/fa...
Homepage:
https://github.com/Crosstowndonkey/fa...
License:
MIT
Created:
a month ago
Latest Version:
0.1.2 (57 minutes ago)
Factorio version:
2.1
Downloaded by:
29 users

Everything that burns fuel keeps itself fuelled - furnaces, boilers, burner drills and inserters, locomotives, cars,
tanks, nuclear and fusion reactors, biochambers, captive spawners, heating towers (optional) and modded burners. Construction robots bring the fuel
from the logistic network; on space platforms the hub throws it across. No chests, no extra buildings.

Which fuel

Machine Fuel
Locomotives, cars, tanks The best fuel: biggest speed + acceleration bonus (nuclear > rocket > solid > coal; higher quality adds to it). Worse fuel is swapped out while the vehicle stands still - the new fuel goes in first, so a vehicle is never left empty.
Furnaces, boilers, burner drills and inserters The most plentiful basic fuel (coal, wood, carbon...), then spoilage, and solid fuel only when there is neither. Never rocket or nuclear fuel (an editable list).
Nuclear and fusion reactors A few fuel cells (2 by default); used-up cells are carried away.
Biochambers, captive spawners A small amount of nutrients (20 by default), because they spoil; captive spawners get bioflux.
Heating towers Like furnaces - off by default, because they burn about 40 MW.
  • Pick the fuel yourself: open a machine or locomotive and use the Fuel panel beside its window. A picked fuel is
    the only one used (it may even be rocket fuel in a furnace - a deliberate pick is allowed). Copy / paste settings
    copies the choice, and blueprints remember it.
  • Machines that inserters keep full never run low, so the mod never touches them.
  • Fuel the player put in by hand that the rules wouldn't choose is left alone.
  • Fuel that spoils (fruit, mash, jelly, eggs - eggs hatch!) and seeds are never chosen automatically, unless a machine
    burns nothing else. Quality fuel is only used when it's better (vehicle bonus) or there's nothing else.
  • Machines share a small stock: none asks for fuel another one is already waiting for. A request that gets no delivery
    for 20 seconds while its fuel is gone is cancelled, and the machine gets whatever fuel there is.
  • The fuel you carry is never handed out (personal roboports and spidertrons don't count as a supply unless you turn
    that on).

Settings (map settings)

Setting Default
Fill to (% of a stack) 100
Refill when below (% of the amount filled) 25
Swap worse fuel for better fuel in vehicles on
Fuels never put in machines rocket-fuel, nuclear-fuel
Fuels never used at all (empty)
Fuel nuclear reactors / cells to keep on / 2
Feed biochambers / nutrients to keep on / 20
Fuel heating towers off
Take away used-up fuel on
Use fuel carried by players and spidertrons off
Machines checked per tick 20

For mod authors

remote.call("smart-fuel", "set_fuel", entity, "rocket-fuel", "normal") -- pick the fuel for one machine
remote.call("smart-fuel", "set_fuel", entity, nil)                     -- back to automatic
remote.call("smart-fuel", "kind", entity) -- "vehicle", "stationary", "reactor", "nutrients", "heater" or nil

Source code and tests: GitHub (MIT). From the author of Smart Turret Ammo.

Questions, bug reports or ideas: come and chat on the Donkeywork Games Discord (#mod-bugs for bugs).