Miniloader

by therax

Compact and UPS-friendly 1x1 loaders. Works with train cargo wagons, circuits, filters, and modded belts from Bob's, Krastorio, FactorioExtended Plus, Space Exploration, and Ultimate Belts.

Content
1 year, 3 months ago
0.15 - 1.1
192K
Logistics

b Losing the split filter configuration

2 years ago
(updated 2 years ago)

I took a look at this and may have found the cause for the split belt configuration being lost.

The root problem seems to be the mod is relying on a list of inserters being returned from the engine api in a stable order. While I'm not at all sure there is any guarantee for that, in practice it does seem to be fairly stable. The mod also makes an attempt to fix things up when it thinks it may have changed for whatever reason. Unfortunately when doing that fixup the filter settings are currently ignored. By adding a function to also fix the filter settings it solves the configuration getting lost; at least from the limited way I could reliably trigger the bug by changing active mods.

The PR with this fix is at https://github.com/mspielberg/factorio-miniloader/pull/72 if you would like to take a look or give it a try.

2 years ago
(updated 2 years ago)

FYI - therax posted that this USED to be more constant than it is now - https://forums.factorio.com/102521 has the post where this behavior (returning lists in a stable order) has changed recently.

Grabbing your PR to try it on my case (server updates, etc. lose order) - I have a save game from pre-upgrade to test with.

2 years ago

Ahh, interesting. Well that provides some motivation to go for a proper fix of not relying on the order at all. It'll certainly be much more invasive than just adding a single function, but I might give it a shot.

2 years ago
(updated 2 years ago)

So the patch MOSTLY works, but the filters are set in reverse order for loaders facing south and east (output belt from the loader going down or to the right) - right is set to left and vice versa, at least judging by what the filters are set to versus what the arms on holding on restart. Filters facing north and I BELIEVE west (I only found one with both split-lane and full belt to verify against) seem to be correct.

2 years ago

I stand corrected - looks like it's flipped for all four directions.

2 years ago

Just in case it's not clear what I'm meaning - I have several places with full belts that I'm looking at post restart, and I see the following on their configurations:

Left side:
https://postimg.cc/jCr7S8K5

Right side:
https://postimg.cc/JD3tXLmh

2 years ago
(updated 2 years ago)

It may be that it's not working at all. Have you tried clicking on one to open the filter configuration? The items being placed on the opposite belts is one symptom of the bug, if the miniloader configuration is then opened the split belt disappears altogether and it starts placing just one of the items on both belts.

2 years ago

Oops, crossed messages. Not sure if that's what I was describing just because it hasn't placed a single item since the gui was opened or if it's a new behaviour I hadn't seen yet.

2 years ago

It does seem like it may not be the original bug; since I'm pretty sure before the checkmark would be unselected and the selection switch centered as soon as the gui was opened. I'll try and dig into it some more later today.

2 years ago

Basically the loader hasn't had a chance to place any items yet (the belt is backed up), so I can see what the configuration WAS based on what's on the belt, and what the arm on the inserter is holding (the item marked in the screenshots above) versus what the filter configuration is now set to (the filter settings below). The left arm is holding (i.e. was set for) what the right side is now set as a filter, and vice-versa.

2 years ago

Prior to your fix (and symptom of the bug), the right side filtering was lost entirely, and the filter was set for both lanes to the left filter.

2 years ago
(updated 2 years ago)

Ah I see what you mean now - it's very weird... if I clear the belt a little on some of the belts, I have a few bits of the wrong order (the arm emptying) and then it flips to the right order again. I'm going through my entire (huge) base and just resetting everything (hopefully for the last time heh) and seeing a mix of things.

I'm guessing things just got Royally Goofed at some point, hopefully this is the last fix pass needed. Thanks for working on the patch!

2 years ago
(updated 2 years ago)

Ahh, interesting. Well that provides some motivation to go for a proper fix of not relying on the order at all. It'll certainly be much more invasive than just adding a single function, but I might give it a shot.

Yes, this is the fix I was referring to here (https://mods.factorio.com/mod/miniloader/discussion/6277fca3486b0ca2ae0489ee). It's a large job since the order of entities in the game map doesn't just affect the find_entities() calls, but also affects which entity is selected on mouseover if there are multiples in the same location. The fix requires splitting out miniloaders into more types of entities, and migrating existing miniloaders to the new scheme. I've been busy with work lately and have not had the amount of time needed for this major rebuild of the mod.

2 years ago

Blargh2015:

...hopefully this is the last fix pass needed.

Well before seeing your last messages and after being away from the computer for a while I had convinced myself why the current patch has to be broken and is swapping the belt lanes. So now I'm in the "how is this ever working?" state, rather than "yep, it must be fixed". ;)

therax:

It's a large job since the order of entities in the game map doesn't just affect the find_entities() calls, but also affects which entity is selected on mouseover if there are multiples in the same location.

Yeah, it definitely looks like quite an overhaul to completely rip out the dependency. I did think of a few possible ways to lessen it, in spots at least. That might make it possible to more gradually migrate away from at least some of the order dependence. I'll see what I can do with it.

1 year, 11 months ago

Seconded, this just happened to me for a second time after adding another, totally unrelated mod to the server (in this case being ModuleInsertersSimplified).

I definitely think this is a bug, and quite a major one - hinting at a faulty or improperly stored configuration for the miniloaders.
I'm thinking of deeming their split lane configuration to be too unreliable to really use, which is quite a shame as it's a really helpful feature!

One thing however. This has been a known, major bug for a while now - I think it is highly important to warn people of it, because by now a large portion of the factory I'm running moderately relies on split lanes and is now breaking all over the place, simply because no disclosure was made.
If it's a broken feature, why not lock the UI or add a warning?
I just checked, and it's not listed under "known issues"

New response