[MOD 0.16.x] Storage Energistics

Topics and discussion about specific mods
User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5207
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: [MOD 0.16.x] Storage Energistics

Post by eradicator »

As far as i know frequently enumarating large inventories does have somewhat of a performanc penalty. You might get around that by accessing/caching the LuaItemStacks ("Inventory Slots") directly instead of via the inventory. Just food for thought as i really don't know anything about your internal structure ;).
Pekkape
Burner Inserter
Burner Inserter
Posts: 8
Joined: Mon Jul 09, 2018 6:10 pm
Contact:

Re: [MOD 0.16.x] Storage Energistics

Post by Pekkape »

This will be my first message at this forum. :)

Hello and thanks for a wonderful mod but I found a bug and it is related to the extra GUI that a container has where you choose items to be retrieved from the network or where you set read-only in this case.

If a container GUI is open during save/auto-save, it will remain locked and unusable on screen and will not disappear and the remained GUI-part will be useless and that GUI will never show up in a usable form again.
GUI stucked
GUI stucked
GUI factorio.PNG (50.62 KiB) Viewed 4299 times
One way to get around this is to load a previous save but now I noticed this one to late and I have done a lot of stuff since this one got locked on screen. We should have a button the clears the screen from GUI-parts really but you should try to add a button or something that closes all your extra GUI parts if possible.

This is a must have mod and keep up the good work with it. :) Damn nice.

//Pekka
Nividica
Inserter
Inserter
Posts: 25
Joined: Wed Mar 23, 2016 2:55 pm
Contact:

Re: [MOD 0.16.x] Storage Energistics

Post by Nividica »

Pekkape wrote:This will be my first message at this forum. :)

Hello and thanks for a wonderful mod but I found a bug and it is related to the extra GUI that a container has where you choose items to be retrieved from the network or where you set read-only in this case.

If a container GUI is open during save/auto-save, it will remain locked and unusable on screen and will not disappear and the remained GUI-part will be useless and that GUI will never show up in a usable form again.
GUI factorio.PNG
One way to get around this is to load a previous save but now I noticed this one to late and I have done a lot of stuff since this one got locked on screen. We should have a button the clears the screen from GUI-parts really but you should try to add a button or something that closes all your extra GUI parts if possible.

This is a must have mod and keep up the good work with it. :) Damn nice.

//Pekka
That bug annoys me. I actually have a routine that is supposed to look for and clean up orphaned windows, obviously its not working. Thanks for the report.
Nividica
Inserter
Inserter
Posts: 25
Joined: Wed Mar 23, 2016 2:55 pm
Contact:

Re: [MOD 0.16.x] Storage Energistics

Post by Nividica »

eradicator wrote:As far as i know frequently enumarating large inventories does have somewhat of a performanc penalty. You might get around that by accessing/caching the LuaItemStacks ("Inventory Slots") directly instead of via the inventory. Just food for thought as i really don't know anything about your internal structure ;).
The inventories are walked in the following ways:
1) The player has the network overview open. Every 5ish seconds the full network is walked.
2) A transfer request occurs. Walking stops when a place for the item is found on deposits, and or when the item is found for extractions.

Unfortunately I can not trust any kind of inventory cache, as the contents of the chests can be changed outside the purview of the mod. For example an inserter could remove a stack of the item between network ticks, and there are no events related to items entering or leaving an inventory(that I can find).

The best I might be able to do is use a cache as a kind of best-guess-list, where searches or inserts review the guess-list inventories first, and if the list is outdated, do a full walk.
User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5207
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: [MOD 0.16.x] Storage Energistics

Post by eradicator »

Any gui assigned to Player.opened = LuaGuiElement will raise on_gui_closed if the player tries to cloes it (i.e. by opening another gui or pressing buttons). That makes handling them much easier. (In case you don't already do that)
Nividica
Inserter
Inserter
Posts: 25
Joined: Wed Mar 23, 2016 2:55 pm
Contact:

Re: [MOD 0.16.x] Storage Energistics

Post by Nividica »

eradicator wrote:Any gui assigned to Player.opened = LuaGuiElement will raise on_gui_closed if the player tries to cloes it (i.e. by opening another gui or pressing buttons). That makes handling them much easier. (In case you don't already do that)
Unfortunately the side windows can not be set to player.opened, as it closes the opened chest. And with no way to actually get to the LuaGuiElement that represents the opened chest, I cant make the config window a child of it.

Edit: I just realized that the opened chest gui is player.opened.... So I DO have a way (potentially) to get at the element... Such oversight, Much silly
Edit2: No luck, player.opened points to the entity, not the gui element, when a chest is opened. And the on gui opened event does not pass in the element either. Sad day.
User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5207
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: [MOD 0.16.x] Storage Energistics

Post by eradicator »

Nividica wrote:Edit: I just realized that the opened chest gui is player.opened.... So I DO have a way (potentially) to get at the element... Such oversight, Much silly
Oh yea. The chest would set itself there. LuaPlayer.opened in that case will point at the chest LuaEntity, there is no way to get a handle of the chest gui (or any other base game gui element). I just checked though and both defines.events.on_gui_opened and defines.events.on_gui_closed fire just fine for vanilla entities. So you just need to watch both of them, and open/close the gui accordingly. The events also both provide the entity handle directly. And it should be impossible for _opened to fire without _closed being next. (I.e. anything that forces a different _opened will first result in a _closed of the previous chest).

Edit: Why do you think you need the chest gui?
User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5207
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: [MOD 0.16.x] Storage Energistics

Post by eradicator »

So..basically no clue of your internal structure, but it should be as simple as:

Code: Select all

script.on_event(on_gui_closed,function(e)
  if e.entity.name == 'logistic-chest' then
    close_logistic_gui() -- e.entity.unit_number?
    end)
  end)
chernosliv
Burner Inserter
Burner Inserter
Posts: 14
Joined: Sat Aug 01, 2015 2:31 am
Contact:

Re: [MOD 0.16.x] Storage Energistics

Post by chernosliv »

Have a question:what`s better, big network or couple of smaller?
Pekkape
Burner Inserter
Burner Inserter
Posts: 8
Joined: Mon Jul 09, 2018 6:10 pm
Contact:

Re: [MOD 0.16.x] Storage Energistics

Post by Pekkape »

chernosliv wrote:Have a question:what`s better, big network or couple of smaller?
I have everything in one big network, both stuff from Bioindustries and Youkis and almost every original matreriels if it helps and I do not know how many chests that I have. I do have 5 broken networks somewhere but it is not a big issue. I managed to have 2 chests on 2 broken networks but I managed yesterday to find those chests with a new mod called Beastfinder https://mods.factorio.com/mod/BeastFinder and I have been looking for those 2 chests during a couple of hours but with beastfinder, I found them and fixed them within 5 min.

We could add a standalone network for lets say: Youki Industries but it also sometimes use standard subitems lite plates and steel so one network should be enough as otherwise, you have to transfer some basic materiels between the different networks with bots or inserters. To avoid lag, combine your factory with belts because this mod takes a lot of CPU to run and it will cause short constant lagspikes, every second, but it is worth it. :)

//Pekka
astroshak
Filter Inserter
Filter Inserter
Posts: 637
Joined: Thu May 10, 2018 9:59 am
Contact:

Re: [MOD 0.16.x] Storage Energistics

Post by astroshak »

I played around a bit with this mod in 0.16 ... felt a bit cheaty but that’s ok.

Any chance of this being ported to 0.17 ?
User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5207
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: [MOD 0.16.x] Storage Energistics

Post by eradicator »

You lose control of the horde of undead posts you just necro'ed. They attack you and destroy your post count.
(It's pretty obvious that the mod is abandoned.)
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
User avatar
Normal69
Inserter
Inserter
Posts: 38
Joined: Sun Jan 02, 2022 12:46 am
Contact:

Re: [MOD 0.16.x] Storage Energistics

Post by Normal69 »

eradicator wrote: Thu Oct 03, 2019 8:28 pm You lose control of the horde of undead posts you just necro'ed. They attack you and destroy your post count.
(It's pretty obvious that the mod is abandoned.)
Wrong! Viva la necromanolution!
https://mods.factorio.com/mod/re_storage_energistics
:D
User avatar
Normal69
Inserter
Inserter
Posts: 38
Joined: Sun Jan 02, 2022 12:46 am
Contact:

Re: [MOD 0.16.x] Storage Energistics

Post by Normal69 »

astroshak wrote: Thu Oct 03, 2019 6:43 pm I played around a bit with this mod in 0.16 ... felt a bit cheaty but that’s ok.

Any chance of this being ported to 0.17 ?
Indeed, my fellow practicioner of the dark arts.
Post Reply

Return to “Mods”