[MOD] Deadlock's Stacking Beltboxes & Compact Loaders

Topics and discussion about specific mods
McDuff
Fast Inserter
Fast Inserter
Posts: 236
Joined: Sun Jan 11, 2015 11:09 am
Contact:

Re: [MOD 0.16] Deadlock's Stacking Beltboxes (& Compact Loaders)

Post by McDuff »

Auto unstacking for me only works on direct pickup anyway. If I pick up a belt with stacks on it, I get stacks in my inventory. If I pick up off the belt, they unstack.

One thing that did occur to me: I've noticed you can use stacks of coal or solid fuel directly, which is quite nice. I don't see any immediate difficulties in doing direct stack smelting - stack of ore smelts to stack of plates. Has anyone implemented this yet?
mrvn
Smart Inserter
Smart Inserter
Posts: 5910
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: Automatically generated stacking recipes

Post by mrvn »

I think I need to implement the automatic static recipe generation as it's own mod. There seems to be problems with data-final-fixes running before other mods that still modify the data. For example in Seablock you have charcoal that has 2.5MJ of energy. But a stack of charcoal only has 10MJ. I believe the fuel value is initially 2MJ and later changed to 2.5, after the stacks were created.

As a separate mod I could add an optional depends to create the stacking recipes last. Or is there another way to ensure something runs after another mod?
shanemadden
Fast Inserter
Fast Inserter
Posts: 128
Joined: Thu Feb 08, 2018 8:25 am
Contact:

Re: [MOD 0.16] Deadlock's Stacking Beltboxes (& Compact Loaders)

Post by shanemadden »

McDuff wrote: Thu Mar 07, 2019 12:14 pm Auto unstacking for me only works on direct pickup anyway. If I pick up a belt with stacks on it, I get stacks in my inventory. If I pick up off the belt, they unstack.

One thing that did occur to me: I've noticed you can use stacks of coal or solid fuel directly, which is quite nice. I don't see any immediate difficulties in doing direct stack smelting - stack of ore smelts to stack of plates. Has anyone implemented this yet?
Exactly right, it's only acting on the on_picked_up_item event for performance reasons. That event includes the item stack with the event data so it's relatively simple to just attempt to unstack that stack. on_player_main_inventory_changed is the catch-all for all the other types of ways that items get into your inventory, and that'd require scanning the whole inventory each time since the event doesn't tell you what changed.
mrvn wrote: Thu Mar 07, 2019 12:23 pm I think I need to implement the automatic static recipe generation as it's own mod. There seems to be problems with data-final-fixes running before other mods that still modify the data. For example in Seablock you have charcoal that has 2.5MJ of energy. But a stack of charcoal only has 10MJ. I believe the fuel value is initially 2MJ and later changed to 2.5, after the stacks were created.

As a separate mod I could add an optional depends to create the stacking recipes last. Or is there another way to ensure something runs after another mod?
Ahh, the eternal dependency race ;)

Yup, you should be able to resolve this and get your data-final-fixes.lua to run after another mod's final-fixes by adding that mod as an optional dependency in your info.json (start the line with a ?).
mrvn
Smart Inserter
Smart Inserter
Posts: 5910
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: [MOD 0.16] Deadlock's Stacking Beltboxes (& Compact Loaders)

Post by mrvn »

McDuff wrote: Thu Mar 07, 2019 12:14 pm Auto unstacking for me only works on direct pickup anyway. If I pick up a belt with stacks on it, I get stacks in my inventory. If I pick up off the belt, they unstack.

One thing that did occur to me: I've noticed you can use stacks of coal or solid fuel directly, which is quite nice. I don't see any immediate difficulties in doing direct stack smelting - stack of ore smelts to stack of plates. Has anyone implemented this yet?
The reason it works for fuel is that the stack simply has 5 times the fuel value of the item. So nothing extra is needed and deadlock can automatically compute the fuel value when the stack recipe is added.

I assume smelting a stack of something should take 1/5th the amount or 5 times the time. You would have to make extra recipes for that and using 1/5th the amount probably doesn't divide well. 5 times the time seems easier. I guess you could filter out all furnace recipes and then add a stacked flavour automatically.
McDuff
Fast Inserter
Fast Inserter
Posts: 236
Joined: Sun Jan 11, 2015 11:09 am
Contact:

Re: [MOD 0.16] Deadlock's Stacking Beltboxes (& Compact Loaders)

Post by McDuff »

Yeah I assumed that you could just do it by writing recipes for the smelters: stacked ore produces stacked plates - should be 5 times the time to keep with the spirit of the mod.

I am sure someone clever could figure out a programmatic way to do it but writing 3 new recipes (copper, iron, stone) would probably be enough to start?
McDuff
Fast Inserter
Fast Inserter
Posts: 236
Joined: Sun Jan 11, 2015 11:09 am
Contact:

Re: [MOD 0.16] Deadlock's Stacking Beltboxes (& Compact Loaders)

Post by McDuff »

Did the loaders stop working for anyone else with the latest update?
Anson
Fast Inserter
Fast Inserter
Posts: 249
Joined: Sun May 22, 2016 4:41 pm
Contact:

Re: [MOD 0.16] Deadlock's Stacking Beltboxes (& Compact Loaders)

Post by Anson »

shanemadden wrote: Thu Mar 07, 2019 3:34 amI thought that allowing the unstacking recipes as intermediates would allow auto-unstacking for use in recipes, but it's inconsistent (I think based on the presence of other recipes) - it'll happily unstack copper to make some copper cables when you click the cables, but it won't unstack iron plates automatically for trying to make a green circuit
some other mods seem to have very similar problems, eg Production Scrap 2 which also changes/adds recipes, and results in sometimes being able to handcraft items and sometimes not (probably when factorio tries to use the new alternate recipe first)
it seems to me (just a wild guess without having tested it) that it mostly works with simple recipes but not recursively, thus are you sure that it's the iron that doesn't unstack and prevents circuits from being made, and not the copper that is first made into cables (although making copper into cables directly works) before they can be used for the circuits (test needed with stacked iron and unstacked copper in the inventory, or even stacked iron and unstacked cables)?
maybe on such recursive crafting, the wrong recipe and no alternative recipes are checked.
McDuff wrote: Thu Mar 07, 2019 6:50 pmI am sure someone clever could figure out a programmatic way to do it but writing 3 new recipes (copper, iron, stone) would probably be enough to start?
watch out for stacked sizes that don't match the number of items that are required for smelting, eg no multiples of 5 for steel or uneven values for stone, and this becomes even more difficult depending on whether the default value of 5 or an alternate value of 4 is used in the mod settings, and yet even more when also other mods are used that change the stacksize of vanilla items. you need to expect completely "random" amounts of items compressed into one beltbox. how would those stacks be handled? just dropping the surplus, or giving bonus, or unstacking the rest which then will block the input? ...

but of course, it would be really nice if you could make it work :-)

edit: of course, that direct use of stacked items should be a mod option since it might be considered too cheaty by some people
(similar reasoning why stacks of stacked boxes should use the same amount of slots that stacks of the same total number of vanilla items use)
McDuff
Fast Inserter
Fast Inserter
Posts: 236
Joined: Sun Jan 11, 2015 11:09 am
Contact:

Re: [MOD 0.16] Deadlock's Stacking Beltboxes (& Compact Loaders)

Post by McDuff »

Yeah directly smelting stacks would be "cheaty" but I think if it just took the same amount of time, just didn't need a beltbox, it's just a throughput advantage - i.e. gives you bigger smelting columns, not more plates from the same number of furnaces.
Anson
Fast Inserter
Fast Inserter
Posts: 249
Joined: Sun May 22, 2016 4:41 pm
Contact:

Re: [MOD 0.16] Deadlock's Stacking Beltboxes (& Compact Loaders)

Post by Anson »

McDuff wrote: Thu Mar 07, 2019 11:30 pm Yeah directly smelting stacks would be "cheaty" but I think if it just took the same amount of time, just didn't need a beltbox, it's just a throughput advantage - i.e. gives you bigger smelting columns, not more plates from the same number of furnaces.
*I* don't consider it too cheaty when the time is adjusted, but in the spirit of the mod that wanted to only improve on belt throughput, some people might see a reduction of work/energy (by avoiding the unpacking and repacking) to be cheaty, while others find it just in the right spirit to improve belt throughput :-)
and it shouldn't be too difficult to add an option so that this functionality can be toggled on/off ...
GTrak
Inserter
Inserter
Posts: 21
Joined: Tue Mar 01, 2016 10:44 pm
Contact:

Re: [MOD 0.16] Deadlock's Stacking Beltboxes (& Compact Loaders)

Post by GTrak »

This migration (0.16 save file to 0.17) removed all of my blueprint's name (both inside blueprint book/outside).
Blueprint book's name is OK.
I checked several times with/without these mods (deadlock-beltboxes-loaders, DeadlockLoaders). and it still happend with only two mods when migration(0.16 to 0.17).
Any idea to resolve this?

Additional confirmed: It removed concrete tiles on blueprint and changed blueprint icons.
Last edited by GTrak on Fri Mar 08, 2019 6:40 am, edited 1 time in total.
User avatar
MasterBuilder
Filter Inserter
Filter Inserter
Posts: 353
Joined: Sun Nov 23, 2014 1:22 am
Contact:

Re: [MOD 0.16] Deadlock's Stacking Beltboxes (& Compact Loaders)

Post by MasterBuilder »

GTrak wrote: Fri Mar 08, 2019 4:50 am This migration (0.16 save file to 0.17) removed all of my blueprint's name (both inside blueprint book/outside).
Blueprint book's name is OK.
I checked several times with/without these mods (deadlock-beltboxes-loaders, DeadlockLoaders). and it still happend with only two mods when migration(0.16 to 0.17).
Any idea to resolve this?
On a 0.17 save, after updating/migrating, all the BP/books in my player inventory lost both names & tiles. However, all the prints/books in the BP lib remained safe for some reason.
In theory, if you have the previous version of the mod & save, you could load that, move stuff to the BP lib, then try the migration. No guarantees it'll work but those stayed safe on my save.

I just moved on since I didn't have very many in my inventory and it would take <5min to fix the ones I did.
Give a man fire and he'll be warm for a day. Set a man on fire and he'll be warm for the rest of his life.
shanemadden
Fast Inserter
Fast Inserter
Posts: 128
Joined: Thu Feb 08, 2018 8:25 am
Contact:

Re: [MOD 0.16] Deadlock's Stacking Beltboxes (& Compact Loaders)

Post by shanemadden »

That's a nasty bug with the blueprint migration, I'm really surprised that nobody hit that in the last few months since that test version went up.

Really sorry about that, I see exactly what I missed, I'll test and post a fix shortly. It won't be able to fix your blueprints for an already migrated save unfortunately, so you'll need to go back to a pre-migration save - but at least then you can export and import them without rolling all the way back to 0.16.
shanemadden
Fast Inserter
Fast Inserter
Posts: 128
Joined: Thu Feb 08, 2018 8:25 am
Contact:

Re: [MOD 0.16] Deadlock's Stacking Beltboxes (& Compact Loaders)

Post by shanemadden »

...and while I wait 5 minutes for a test run of the fixed migration to complete..., re: direct smelting of stacked stuff:

That's a super cool idea and should be relatively easy to implement in a tiny standalone mod. I'll post some example code later. :)
shanemadden
Fast Inserter
Fast Inserter
Posts: 128
Joined: Thu Feb 08, 2018 8:25 am
Contact:

Re: [MOD 0.16] Deadlock's Stacking Beltboxes (& Compact Loaders)

Post by shanemadden »

1.7.3 versions of the migration mods posted with the blueprint fix, let me know if there are still any issues.
GTrak
Inserter
Inserter
Posts: 21
Joined: Tue Mar 01, 2016 10:44 pm
Contact:

Re: [MOD 0.16] Deadlock's Stacking Beltboxes (& Compact Loaders)

Post by GTrak »

Thank you for update fix.
Looks all good.
Blueprint's name, tiles and icons are all fine now.
User avatar
Deadlock989
Smart Inserter
Smart Inserter
Posts: 2529
Joined: Fri Nov 06, 2015 7:41 pm

Re: [MOD 0.16] Deadlock's Stacking Beltboxes (& Compact Loaders)

Post by Deadlock989 »

McDuff wrote: Thu Mar 07, 2019 11:30 pm Yeah directly smelting stacks would be "cheaty" but I think if it just took the same amount of time, just didn't need a beltbox, it's just a throughput advantage - i.e. gives you bigger smelting columns, not more plates from the same number of furnaces.
An early version of the mod did let you smelt stacks of ore directly. It took the equivalent time, i.e. 5x the time for 5x the output, so the only benefit was the energy saving of not having to unstack (negligible from mid-game onwards). I also experimented with being able to smelt a stack of five iron plates directly into one steel plate. In the end I decided it added nothing and was inconsistent with not being able to use stacks in other recipes and I didn't want to open that can of anacondas. Weird stuff starts to happen with hand auto-crafting when you provide too many routes to the same product.

I haven't made much progress with updating the graphics although I've sketched some stuff out. I haven't even had time to play 0.17 yet. Getting a Satisfactory weekend alpha key isn't helping. I think having something done for the first stable release of 0.17 is still realistic.
shanemadden
Fast Inserter
Fast Inserter
Posts: 128
Joined: Thu Feb 08, 2018 8:25 am
Contact:

Re: [MOD 0.16] Deadlock's Stacking Beltboxes (& Compact Loaders)

Post by shanemadden »

Deadlock989 wrote: Sat Mar 09, 2019 11:40 amI haven't made much progress with updating the graphics although I've sketched some stuff out. I haven't even had time to play 0.17 yet. Getting a Satisfactory weekend alpha key isn't helping. I think having something done for the first stable release of 0.17 is still realistic.
Same, I like their burner phase so far :) but absolutely no rush, no hint of the 64px icons yet either and the UI reworks are still ongoing, it seems like it'll be a relatively lengthy experimental phase - thanks again for your expertise!
Deadlock989 wrote: Sat Mar 09, 2019 11:40 am
McDuff wrote: Thu Mar 07, 2019 11:30 pm Yeah directly smelting stacks would be "cheaty" but I think if it just took the same amount of time, just didn't need a beltbox, it's just a throughput advantage - i.e. gives you bigger smelting columns, not more plates from the same number of furnaces.
An early version of the mod did let you smelt stacks of ore directly. It took the equivalent time, i.e. 5x the time for 5x the output, so the only benefit was the energy saving of not having to unstack (negligible from mid-game onwards). I also experimented with being able to smelt a stack of five iron plates directly into one steel plate. In the end I decided it added nothing and was inconsistent with not being able to use stacks in other recipes and I didn't want to open that can of anacondas. Weird stuff starts to happen with hand auto-crafting when you provide too many routes to the same product.
Yeah, players getting used to the mod should have the unstack-before-machines approach reinforced as much as possible, I agree that it'd cause more confusion than it'd be worth.

That said, I'm not above enabling some crazy-and-ultimately-pointless ideas; I went ahead and uploaded a little standalone mod for experiments like this. https://mods.factorio.com/mod/deadlock-experiments

It just includes smelting recipes for stacked ores (and iron plates to steel) with options on whether to output stacked or unstacked products. Definitely cheaty ;) and I slapped it together very quickly, so I might have not gotten the balance quite right.

Also includes an update to the science pack stacking experiment posted a few pages back, and settings to control both experiments.
User avatar
Optera
Smart Inserter
Smart Inserter
Posts: 2920
Joined: Sat Jun 11, 2016 6:41 am
Contact:

Re: [MOD 0.16] Deadlock's Stacking Beltboxes (& Compact Loaders)

Post by Optera »

How about adding expensive furnaces and assemblers able to directly use stacked items as inputs and output stacked as well?
That certainly could help megabases to reduce entity count a bit.
reapersms
Long Handed Inserter
Long Handed Inserter
Posts: 69
Joined: Sun Jun 17, 2018 4:55 am
Contact:

Re: [MOD 0.16] Deadlock's Stacking Beltboxes (& Compact Loaders)

Post by reapersms »

I cooked up a local mod to do some of these things last night, targeted at pymods. The approach I went with was to only hit a particular set of recipes, and only affect inputs that are stackable and a multiple of the stack size.

Rationale was entity reduction, but still leaving the need to stack things. Recipe choice was subjective, with a general trend focusing on things that are just getting tossed in a furnace or a pit of acid. Sand and salt were the main ones that got hit.

I'll try it a bit more locally before uploading or submitting a patch for experiments.

There is an outstanding issue with the recipe names, it checks for a main product to pick between item-name or recipe-name when building the new one, but that isn't sufficient for all cases. Still have a few that get unknown tags.

edit: published what I have for now
https://mods.factorio.com/mod/stackrecipes
User avatar
MasterBuilder
Filter Inserter
Filter Inserter
Posts: 353
Joined: Sun Nov 23, 2014 1:22 am
Contact:

Re: [MOD 0.16] Deadlock's Stacking Beltboxes (& Compact Loaders)

Post by MasterBuilder »

Stacking Beltboxes Changelog wrote:- Move loaders to the transport-belt fast replace group, matching beltboxes
Can this be optional?
I place the buffers & stackers then draw the belt lines and inevitably go one too far and have now replaced the loader I want with a belt I don't.
I even use a mod to prevent fast replacing underneathies & splitters with belts. IMHO belts should only fast replace other belts. Anything else causes more problems than it solves.
Give a man fire and he'll be warm for a day. Set a man on fire and he'll be warm for the rest of his life.
Post Reply

Return to “Mods”