Logistic-Train-Network
Logistic-Train-Network copied to clipboard
Incorrect calculation of train slots available with mixed item types + double-headed trains
Error message or bug description
While trying to use LTN with mixed-item shipments, I'm pretty sure I found a bug where LTN is incorrectly calculating a train's total stack size. I have a <CCL>
train that was dispatched to pickup this load:
Screenshot from LTN Manager interface:
Screenshot of signals coming from the LTN station's constant combinator output:
This load requires the following assignment of stacks:
- Artillery Shells: 65 (stack size 1)
- Uranium Ammo: 5 (stack size 200)
- Repairs Packs: 4 (stack size 100)
- Lbots: 2 (stack size 50)
- Cbots: 2 (stack size 50)
- Pipes: 2 (stack size 100)
- Filtered inserters: 1 (stack size 50)
- Stack inserters: 1 (stack size 50)
- Flame turrets: 1 (stack size 50)
This is 83 stacks, which does not fit in the 2 wagons available on the train (80 stacks). It would "fit", however, if LTN was counting the final locomotive as having a 3-stack cargo, even though it's actually just the inventory.
I tried to trace through the code to see if I could find something suspicious, and I got as far as here. I wonder if some recent Factorio update started putting the non-head locomotives in the cargo_wagons
variable?
I'm playing SE so my save file is like 400MB, but I'm happy to find a place to upload it if that would help.
To Reproduce Request a complicated mixed wagon and have it filled by a train with locomotives at both ends.
LTN version 1.18.1
Log file
This is 83 stacks, which does not fit in the 2 wagons available on the train (80 stacks). It would "fit", however, if LTN was counting the final locomotive as having a 3-stack cargo, even though it's actually just the inventory.
I tried to trace through the code to see if I could find something suspicious, and I got as far as here. I wonder if some recent Factorio update started putting the non-head locomotives in the cargo_wagons variable?
I highly doubt Wube made changes like that without mentioning it in their changelogs. However some mods create locomotives with integrated cargo wagons.
I don't have time to download a heavily modded 400MB save and filter out all mod interactions. To start analyzing I need the following:
- factorio-current.log with LTN's debug log enabled. The logfile must be complete and have the logging option enabled for a few seconds before the delivery was created and include everything until the train arrives at the provider.
- Names of stops between which the delivery was created
Even better would be if you can reproduce the error on a newly created map with only LTN running.
Thanks for the quick response! I'll start working on a more compact repro.