Roboport Converter

by Hermios

Convert missing items in the area of a roboport in signals for logistic network.

1 year, 1 month ago
0.16 - 0.18
677

b crash on tick :-(

2 years ago
(updated 2 years ago)

I just got a crash from this mod, while only running around and not accessing the new special functions of roboports. but i had recently placed and crafted new roboports and thus it might have happened while bots or nanobots placed a roboport :

Notice
Roboport_Converter::on_tick (ID 0)
Roboport_Converter/methods/roboportFunctions.lua:38:attempt to index field 'logistic network' (a nil value)

maybe even more severe was the lag that i had after installing several mods (one of them probably this mod). my UPS had gone down from 58-60 to less than 12, most of the time between 5 and 10 UPS only. after deinstalling this mod because of the above error, my UPS immediately went back to the old value of 58-60 !!!

after restarting the game, i was shown that 50 "ghost converter" were deleted, thus i must have had 50+ roboports. i also had placed quite a few blueprints with walls, turrets, and belts in front of the walls, for a total of several thousand missing items. but many factories have a lot more than only 50 roboports (lots of them set up in groups to charge thousands of bots), and when paving a factory, each chunk has 32x32 = 1024 missing floor tiles, easily adding up to 10s of thousands of missing items/tiles.

please reduce the burden on UPS that is caused by your mod or else it is unusable in all but the smallest factories.

btw: do you compute missing items on every tick, or every xx ticks, and are you spreading the calculations on ticks (eg one roboport only per tick, and a scan at most every 10 seconds) ?
it might be best to have those two values settable in mod options so that people can select whether they want more accurate response or less lag. the first value might be how many roboports are scanned per tick (0 meaning "all of them", causing the most accurate results for the price of insane lag) and the second for the delay between scans (values give the delay between one and the next scan of the same roboport, with 0 meaning continually scanning with no delay, continueing with the first roboport immediately after the last is done).
of course it is your mod and you know best what can be done, but please do something against that lag.

2 years ago

Hi Anson
The bug has been solved in the next version (yes, the same one that may be released one day... sigh! Sorry!)
As for the UPS issue, I am aware of that, and havn't found a proper solution.
I think that activating or deactivating roboports through a gui would be the best answer, as this mod is mostly used in outposts. Once an outpost is built, the mod wouldn't take too much UPS
In addition, maybe I could play with the scanned per ticks as well, either by adding an option (as you mentioned), or by some AI that would be based on the number of ghosts already involved... or maybe a combination of both... I will think about it!
Many thanks for the feedback, and once again sorry for the delay, I do my best to fix it as soon as I can!

2 years ago
(updated 2 years ago)

I think that activating or deactivating roboports through a gui would be the best answer, as this mod is mostly used in outposts. Once an outpost is built, the mod wouldn't take too much UPS

quite complicated to use a gui for many roboports, unless this gui would be just an extension to the current selection of "read network vs. read bot statistic", adding a third option "read ghosts", but i doubt that that is possible with the current version of factorio.

btw: does the mod not see which roboports are set to "read bot stats" ? only check the area for ghosts when robot statistics is selected, since only then the values can be read on a wire anyway and counting ghosts would be useless otherwise.
on my current map, i only had 5 or 6 (out of 50+) roboports set to read robot counts, one to inject new robots, and 4 or 5 to count ghosts. no need to check for ghosts and waste time on the the other 45+ roboports.

In addition, maybe I could play with the scanned per ticks as well, ...

many mods had problems with ups when they were new, and changing them to scan only one or very few entities/chunks/whatever per tick solved almost all of those issues, especially when something is not very time critical and thus checks can be spread across a rather long period of time. eg when having a "turn around cycle time" of 10 seconds (600 ticks) even up to 600 roboports could be checked with one roboport per tick only. that's why some mods (and my suggestion above) have two values, one for this "total cycle time" and one for the number of checks per tick.

Many thanks for the feedback, and once again sorry for the delay, I do my best to fix it as soon as I can!

4 or 5 hours from crash report to an answer are no big delay :-)
but as it is now, the crash is just as gamebreaking for me as the lag :-(

ps: as nice as a hidden combinator is (that probably can't detect without effort whether it is really used, but it should be able to see whether "read bot info" is selected?), maybe a simple solution would yield similar results by doing something similar to the other mods, needing to explicitly putting down a new combinator next to a roboport, which then connects and sends the status of ghosts for the area around that single roboport. it still would be quite different from those other mods (and maybe even a big time and UPS saver in comparison to them :-) when it only checks one area each around specific single roboports instead of checking all the overlapping areas of all roboports in a logistics network and then even has to do matching to eliminate duplicate ghosts (and still, those mods seem to have much less of an effect on ups than this one)

2 years ago

Hi Again
For the gui, I meant one gui per roboport. When opening the GUI of a roboport, y choose its options and if you want to read or not ghosts around. This way, we can always have the hidden combinator, as it is not used if you don't activate the ghost converter option.
For the bots stats, I am not sure it is related. I think, even if you don't read bots stats, the function will return how many ghosts are around. I can check, but I'm pretty sure of it. Anyhow, I don't like when one option does too much (In this case, you cannot activate bots stats without having the converter... too much restriction)
For the UPS, according to what you just wrote, I will seriously think about it, it won't be immediate (well, after I solve my other issues!), but I will come back with a proper solution (Maybe yours, maybe another one... let see).
Thanks a lot
Niko

2 years ago

For the bots stats, I am not sure it is related. I think, even if you don't read bots stats, the function will return how many ghosts are around.

if this is true, how do i use the results at all ???
if the roboport shows the number of ghosts in addition to the bot stats as well as in addition to the network stats, how am i supposed to see whether some value is generated because of missing ghosts or because those items are available in the network ?
on bot stats, there are always four signals. thus additional signals can be seen relatively easily, although those four values first have to be removed from a wire before doing something like "if any signal > 0 then call train". but on network stats, how do i separate ghosts from available items ?

ps: how do you handle the situation if someone adds the mod to an existing map? will the existing roboports all be refitted with the invisible combinator (that would be quite some work and an easy source of problems) or would i end up with new roboports that can show the number of ghosts and old roboports that don't have that functionality ? but in that case, how can i see whether "no ghosts" means that there are no ghosts or that it is an old roboport without that hidden combinator ?

2 years ago

I think there is a misunderstanding of the converter: It supposes to send you the ghosts that are not available, i.e. those that are :
- not in a container
- not on bots
Basically, it sends on the network the information of the missing items, that you can see as messages at the bottom of the screen. PLease tell me if you didn't understand that, so I change the description!
For the management of the existing map... there is none! So, to update for the next version :D (Thanks for that!)

2 years ago

I think there is a misunderstanding of the converter:
PLease tell me if you didn't understand that

yes, now i am pretty confused which items and/or ghosts i should be able to see where ...

It supposes to send you the ghosts that are not available,
i.e. those that are : - not in a container - not on bots
Basically, it sends on the network the information of the missing items,
that you can see as messages at the bottom of the screen.

to clarify: with "at the bottom of the screen" you mean the alert messages that list missing items ?
but where am i shown those by your mod ?
when i have set it to read bot statistics, i get XYZT (or whatever i changed those four signals into) for the bots, and everything else are those missing ghosts, but if i didn't switch and keep the default of showing network contents, how can i differentiate between content of the network and missing ghosts ?
eg, what would be shown in this case: chests hold 10k iron, 200 walls, no gates, and 30 turrets, and i just placed a blueprint with 300 walls, 10 gates and 5 turrets. what would be shown now? 10k iron? 200, 300, 200+300=500, or 200-300=-100 walls? +10 or -10 gates? and 30, 5, 30+5=35 or 30-5=25 turrets?

that's why i didn't notice whether the ghosts were part of the logistic network display. but for the robot statistics display, the ghost signals are clearly different and can be seen: the bot signals are virtual signals and no item signals, and only four of them, everyting else must be ghosts.

i just wanted to reenable the mod to check these details, but the game crashed on start :-(

For the management of the existing map... there is none!

it would be nice to have such a description on the info tab or another prominent location. something like "when installing on an existing map, old roboports will not be refitted with the new function, but only newly placed ones."

or as i just had to notice, installing it on an existing map which already has roboports, the game crashes. thus there should be a big warning "don't install on existing maps":

Error while running event Roboport_Converter::on_tick (ID 0)
Roboport_Converter/methods/roboportFunctions.lua:38: attempt to index field 'logistic_network' (a nil value)

New response