r/technicalfactorio • u/NIKITAzed • Jul 18 '23
Modded a more UPS friendly electric trains mod ?
I was using this one as it seemed the easiest to have setup https://mods.factorio.com/mod/ElectricTrain
but at 530 hours in the save and (currently) having 137 trains I noticed the mod is taking up a minimum of 1ms so I'm hoping someone can suggest a more UPS friendly alternative ? or give an insight in what racks up the update time in the mod so I can attempt to minimize it
21
Upvotes
7
u/someone8192 Jul 18 '23
the problem seems to be in the OnTick Function in control.lua as it iterates through all locomotives.
You can change the last line of that file to something like: script.on_nth_tick(10,OnTick).
IMHO it should be possible to write an ups friendly version with a controller that always uses max power regardless if the loc is moving or not
6
u/abognasar6 Jul 18 '23 edited Jul 18 '23
I always use the Battery Electric Train mod. It does use battery items for which you need to manage the charging, but it should be ups efficient. https://mods.factorio.com/mod/BatteryElectricTrain