[MOD 0.12.x] Equalizer chests v1.4.0

Topics and discussion about specific mods
Boogieman14
Filter Inserter
Filter Inserter
Posts: 770
Joined: Sun Sep 07, 2014 12:59 pm
Contact:

Re: [Mod 0.12.x] Equalizer chests v1.1.1

Post by Boogieman14 »

Yup, plans have been made and realized :) Not sure when I'll get around to using it again myself, KSP has been eating most of my freetime (and then some :roll: )
I don't have OCD, I have CDO. It's the same, but with the letters in the correct order.

wanyfer
Burner Inserter
Burner Inserter
Posts: 11
Joined: Thu Jun 19, 2014 5:45 pm
Contact:

Re: [Mod 0.12.x] Equalizer chests v1.1.1

Post by wanyfer »

this mod is one of mine MUST HAVE mods cant do rails without it

Boogieman14
Filter Inserter
Filter Inserter
Posts: 770
Joined: Sun Sep 07, 2014 12:59 pm
Contact:

Re: [Mod 0.12.x] Equalizer chests v1.1.1

Post by Boogieman14 »

Enjoy our 0.12 experience with this mod then :)

Oh, one more thing: i haven't tested loading an original 0.11 game into 0.12, so no idea how this mod will handle that (only significant change that could have an impact is the new surfaces, so if the original surface is assumed to be the default when no information is present, i suspect it'll work ok)
I don't have OCD, I have CDO. It's the same, but with the letters in the correct order.

User avatar
ssilk
Global Moderator
Global Moderator
Posts: 12888
Joined: Tue Apr 16, 2013 10:35 pm
Contact:

Re: [Mod 0.12.x] Equalizer chests v1.1.1

Post by ssilk »

Moved thread to convenience, I think this has a deeper game-changing effect. But I left a link.
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...

User avatar
oLaudix
Filter Inserter
Filter Inserter
Posts: 282
Joined: Sun Jun 14, 2015 3:24 pm
Contact:

Re: [Mod 0.12.x] Equalizer chests v1.1.1

Post by oLaudix »

ssilk wrote:Moved thread to convenience, I think this has a deeper game-changing effect. But I left a link.
I tried to chain the boxes to make smth like conveyor belt, but after putting about 400 of them it started to affect performance :p
Image

Boogieman14
Filter Inserter
Filter Inserter
Posts: 770
Joined: Sun Sep 07, 2014 12:59 pm
Contact:

Re: [Mod 0.12.x] Equalizer chests v1.1.1

Post by Boogieman14 »

I guess that's a use case I hadn't really taken into consideration with my performance checking :) You could probably reduce the load a bit by reducing the frequency at which the chests are checked. That would of course reduce the transfer speed, so not sure what the impact gameplay would be. To do this, play with the ticks variable in line 21 of control.lua. By default it checks every 60 ticks (I believe this is 1 second), so you could increase this to 119 for every other second. (ignore the ticks variable in line 7, this is just the initialization for the very first cycle, doesn't affect performance)
I don't have OCD, I have CDO. It's the same, but with the letters in the correct order.

jorgenRe
Filter Inserter
Filter Inserter
Posts: 535
Joined: Wed Apr 09, 2014 3:32 pm
Contact:

Re: [Mod 0.12.x] Equalizer chests v1.1.1

Post by jorgenRe »

I see you do as many do:

Code: Select all

function ticker()
	if global.eqChests ~= nil then
		if ticks == 0 then
			ticks = 59
			processEqChests()
		else
			ticks = ticks - 1
		end
	else
		game.on_event(defines.events.on_tick, nil)
	end
end
And that is where you should be able to increase the perfomance of your mod. What you should do is to trye and spread all the chests on each of their tick. So that not all of the chests update at the same time.
That should hopefully be a ~60 times perfomance increase ^_^!
Logo
Noticed the told change in FFF #111 so il continue to use my signature ^_^
Thanks for listening to our suggestions, devs :D!
I would jump of joy if we could specify which tiles spawned in a surfaces

Boogieman14
Filter Inserter
Filter Inserter
Posts: 770
Joined: Sun Sep 07, 2014 12:59 pm
Contact:

Re: [Mod 0.12.x] Equalizer chests v1.1.1

Post by Boogieman14 »

You have a point there :) I suppose what I could do (which would be easiest to implement, otherwise the added complexity might negate the gains for average usage) would be to just have a global counter that increments on each tick and processes that chest number. With <60 chests, that would cause them to get updated more frequently than now, but having more chests wouldn't have an effect on game performance at all, it would only mean that chests don't get processed as often (but for that 400 chests example earlier, still once every ~6 seconds).. Or even have a counter of the number of chests in total, divide that by 60 and process that many chests each tick. Yeah, I guess that could work. I'll have to brood on that some more, and find a quiet time at work next week to implement it ;)
I don't have OCD, I have CDO. It's the same, but with the letters in the correct order.

Mr Sunol
Inserter
Inserter
Posts: 24
Joined: Thu Dec 25, 2014 6:23 am
Contact:

Re: [MOD 0.12.x] Equalizer chests v1.1.1

Post by Mr Sunol »

The Mod seems cool and all...... but do you realize that your original problem already had an in-game solution......?

The rail carriages are already "equalizer chests"

You can even compartmentalize them if you have more than one resource being unloaded. (which you can't do with regular chests).
If you want faster output form your train, there is enough room for another row of long inserters.
Attachments
unload.png
unload.png (454.78 KiB) Viewed 6447 times

Boogieman14
Filter Inserter
Filter Inserter
Posts: 770
Joined: Sun Sep 07, 2014 12:59 pm
Contact:

Re: [MOD 0.12.x] Equalizer chests v1.1.1

Post by Boogieman14 »

For the specific case I presented, yes. But I've been using these things in many more places where it's useful to have stuff spread out over all chests. Besides, I think those wagons look kinda silly when used like that ;)
I don't have OCD, I have CDO. It's the same, but with the letters in the correct order.

Mr Sunol
Inserter
Inserter
Posts: 24
Joined: Thu Dec 25, 2014 6:23 am
Contact:

Re: [MOD 0.12.x] Equalizer chests v1.1.1

Post by Mr Sunol »

Boogieman14 wrote:For the specific case I presented, yes. But I've been using these things in many more places where it's useful to have stuff spread out over all chests
I agree, The mod is still beneficial, I'm just saying there WAS a solution to the problem :p
Boogieman14 wrote: Besides, I think those wagons look kinda silly when used like that ;)
I also agree here, I never actually use this configuration, BUT I do use the rail carts in other areas, as I will upload shortly....

JohnyDL
Filter Inserter
Filter Inserter
Posts: 533
Joined: Fri May 16, 2014 3:44 pm
Contact:

Re: [MOD 0.12.x] Equalizer chests v1.1.1

Post by JohnyDL »

I've tested this extensively and I think that there's a few slight bugs

First I have a problem placing chests without major lag spikes, I have over 3k in one game and it's noticeable to the point of when I build them I have to in short stints giving myself a headache before I have to stop for a while


Second if you have a huge number of items in the system (I use them instead of conveyers for ore mining, providing me a huge ore reserve) removing the chests is tedious, you try to delete it only to have it empty into your inventory and refil before you can, I eventually learned to hot swap to steel or mark it as unusable and then delete the chest but there should be a better way to handle it.


Third if you try to use the chests to move things over a distance, the difference of 10 to initate movement is kinda anoying, it means that you're limited in distance unless every so often you put in inserters as valves which adds it's own set of problems, so moving iron ore for example is limited to a trickle after 240 chests, I know the difference of 1 means stuff bouncing so is there a different way to handle it? perhapse spreading over the entire network rather than neighbouring chests.

Idea: if the least number of items in a set of chests is has a difference greater than say ten stacks (assuming all items in the array are the same if not then use 45-48 items to be on the safe side) from the highest number of items in that same set then collect all the items together and distibute equally by count if that difference isn't reached then use the standard method.

Boogieman14
Filter Inserter
Filter Inserter
Posts: 770
Joined: Sun Sep 07, 2014 12:59 pm
Contact:

Re: [MOD 0.12.x] Equalizer chests v1.1.1

Post by Boogieman14 »

JohnyDL wrote:I've tested this extensively and I think that there's a few slight bugs

First I have a problem placing chests without major lag spikes, I have over 3k in one game and it's noticeable to the point of when I build them I have to in short stints giving myself a headache before I have to stop for a while
Yeah, I noticed that too when I was trying some stresstesting the other day. I clearly hadn't considered situations where more than 100 of these would ever exist in a game :) I know what the issue is, I'll need to look into fixing it properly.
Second if you have a huge number of items in the system (I use them instead of conveyers for ore mining, providing me a huge ore reserve) removing the chests is tedious, you try to delete it only to have it empty into your inventory and refil before you can, I eventually learned to hot swap to steel or mark it as unusable and then delete the chest but there should be a better way to handle it.
If you don't have the inventory space, just open the chest and mark all slots red. Stuff won't be added anymore, it will still slowly empty into neighbouring chests as contents balance out or you can manually move stuff over and mine it once it's empty. That should work well enough. Removing a chest using bots is still an interesting way of turning construction bots into logistics bots, so I'll probably still see if I can add something to do the disabling automatically.
Third if you try to use the chests to move things over a distance, the difference of 10 to initate movement is kinda anoying, it means that you're limited in distance unless every so often you put in inserters as valves which adds it's own set of problems, so moving iron ore for example is limited to a trickle after 240 chests, I know the difference of 1 means stuff bouncing so is there a different way to handle it? perhapse spreading over the entire network rather than neighbouring chests.
I'll have to think about a way to work around this without adding all kinds of complicated calculations.
I don't have OCD, I have CDO. It's the same, but with the letters in the correct order.

Boogieman14
Filter Inserter
Filter Inserter
Posts: 770
Joined: Sun Sep 07, 2014 12:59 pm
Contact:

Re: [MOD 0.12.x] Equalizer chests v1.1.1

Post by Boogieman14 »

JohnyDL wrote:I've tested this extensively and I think that there's a few slight bugs

First I have a problem placing chests without major lag spikes, I have over 3k in one game and it's noticeable to the point of when I build them I have to in short stints giving myself a headache before I have to stop for a while
Well, as of version 1.1.2 this should now not be an issue anymore. Placement of the 10,000th chest should now take the same amount of time as placing the second did. :)
(note: I've only tried this version with my current ongoing game, and everything appears fine there, but as always: make a backup copy if you're trying it on a save you care about ;) )
I don't have OCD, I have CDO. It's the same, but with the letters in the correct order.

JohnyDL
Filter Inserter
Filter Inserter
Posts: 533
Joined: Fri May 16, 2014 3:44 pm
Contact:

Re: [MOD 0.12.x] Equalizer chests v1.1.2

Post by JohnyDL »

Awesome, I was going to suggest a way of handling that but I think it's far too complicated in hind sight

As for the the third bug, I think I've found a partial cause/solution to it things like moving from chest zero to chest n quite easily because if you fill 0 with items half of them will move to 1 of which half will move to 2 and then half to 3 and so on and so on in the same itteration but moving in the other direction rather than it happening in one turn it happens over a much larger number of turns
examples
organising/sorting the array every so often maybe every thousand times you run the move items so that the chests with the most items are closer to 0 in the array and the empty ones closer to the end would maybe help the chests to move items more freely and further. And for my game I've changed that threshold from 10 to 2 items means things can go further and it still prevents bouncing

one more bug, if you place the equaliser chests using the map editor they don't act like equaliser chests during the game, could use a one off routine to check for those on game launch
Last edited by JohnyDL on Mon Sep 14, 2015 7:55 pm, edited 2 times in total.

Boogieman14
Filter Inserter
Filter Inserter
Posts: 770
Joined: Sun Sep 07, 2014 12:59 pm
Contact:

Re: [MOD 0.12.x] Equalizer chests v1.1.2

Post by Boogieman14 »

JohnyDL wrote:As for the the third bug
I've given that some more though, and I actually disagree with it being a bug :) I suppose, tuning that threshold down a bit would alleviate your problem, but in the end these chests do what it says on the tin: they transfer stuff between their neighbours so each holds roughly the same amount. From your description and suggestion, it appears you think they're considered part of a bigger network, but this isn't the case: they only know about their direct neighbours and will only communicate with those.
one more bug, if you place the equaliser chests using the map editor they don't act like equaliser chests during the game, could use a one off routine to check for those on game launch
Ah yes, I suppose the map editor doesn't execute the placement scripts. Fixing that may not be trivial though, I suspect I'll have to scan the entire map for all instances and initialize them. Depending on the number of chests, that could cause a rather significant delay at load time.
I don't have OCD, I have CDO. It's the same, but with the letters in the correct order.

JohnyDL
Filter Inserter
Filter Inserter
Posts: 533
Joined: Fri May 16, 2014 3:44 pm
Contact:

Re: [MOD 0.12.x] Equalizer chests v1.1.2

Post by JohnyDL »

Yeah I know what you mean I'm really pushing the idea of using them like pipes in certain places and kind of expecting them to act like pipes which do ballance over distance even if the neighbours only know about each other, but then for fluids infinitely fine fractions work, not the same for items

Boogieman14
Filter Inserter
Filter Inserter
Posts: 770
Joined: Sun Sep 07, 2014 12:59 pm
Contact:

Re: [MOD 0.12.x] Equalizer chests v1.1.2

Post by Boogieman14 »

Posted version 1.1.3, updated for 0.12.11 changes.
I don't have OCD, I have CDO. It's the same, but with the letters in the correct order.

roy7
Filter Inserter
Filter Inserter
Posts: 337
Joined: Fri Dec 12, 2014 4:24 pm
Contact:

Re: [MOD 0.12.x] Equalizer chests v1.1.3

Post by roy7 »

Had anyone else had issues with Equalizer Chests in multiplayer? On one of the US public MP servers we were having issues we eventually determined was Equalizer related and removed the mod which cleared it up. Some observations are that placing/removing them was safe, and using them would only rarely cause a desync, so it was hard to isolate at first. But if we have an active train unloading station and replace 10-12 chests in-place with Eqaulizers that inserters are busy loading/unloading ore to, it was much more likely to cause an immediate desync.

apriori
Filter Inserter
Filter Inserter
Posts: 259
Joined: Thu Feb 18, 2016 8:13 pm
Contact:

Re: [MOD 0.12.x] Equalizer chests v1.1.3

Post by apriori »

roy7 wrote:Had anyone else had issues with Equalizer Chests in multiplayer? On one of the US public MP servers we were having issues we eventually determined was Equalizer related and removed the mod which cleared it up. Some observations are that placing/removing them was safe, and using them would only rarely cause a desync, so it was hard to isolate at first. But if we have an active train unloading station and replace 10-12 chests in-place with Eqaulizers that inserters are busy loading/unloading ore to, it was much more likely to cause an immediate desync.
I've had this issue too, when I've tried to play my savegame with my son. Often repeated syncs. I have about 400 EqChests - it's my way to provide smelters with ore.

I'd also like to ask modder a question: is it possible to make common inventory for several containers? Or each container can only have it's own inventory? Or may be it's possible to store items in global.myMod.customInvs[] for entities from global.myMod.myEnts[]? I'd like to make mod, where neighboring chests have common inventory to provide my smelters with ore - it's the fastest way of using upgraded inserters (5 items per time instead of 1, when interacting with belts).
Any code or mods posted by me are WTFPL, unless otherwise copyrights are specified.

Post Reply

Return to “Mods”