Ghost Scanner2

by Tiavor

Adds a combinator reading ghost requests from the logistic network it's placed in. -> now with better performance <-

Content
2 years ago
1.1
5.30K
Circuit network

g Still Slow

1 year, 10 months ago

While better then the orginal ghost scanner 1 this mod is scans are still pretty slow I have like 10 Ghost scanners on my map, and the mod is almost constatnly using 3-8ms even with max areas scanned set to 1 and the time delay increased, maybe you could reduce the size of the scanned area (instead of scanning a whole roboports area do scan one chunk or smaller at a time) or at a delay between scans so it only scans n areas every m ticks, so I could set it to only scan 1-2 areas maybe ever 5-10 ticks or something. The way it is now this mod still has a massive impact on performance, enough to push me under 60 UPS.

1 year, 8 months ago
(updated 1 year, 8 months ago)

yes, large connected roboport areas are still a problem. when I find the time I'll give it another try. maybe even do more internal counters because scanning is just so slow. the perfect mod would only listen to events and not use the tick at all.

1 year, 8 months ago

In theory using events should work at least 99% of the time (excluding when another mod builds something without raising the script_raise_build event) at least for keeping track of ghosts in general, just add ghosts to a list/table/queue when they get build via an event, or upgraded (there is an event for ghost upgrades), and loop trough n entrys of that list, with a check to see if it's still exists is valid (that way you wouldn't have to any of the removed events), remove anything invalid and add everything else back onto the end of the queue anything new also get's added to the end, this is how my mod GhostOnWater checks it's water ghosts.

Of course you still have to use find_entitys_filtered when on init and on settings changed since that clears the global table.

The question for this mod now is how easy it is to check if any given entity is a a specific logistics network, if that's an easy check a single queue/table should be enough to keep track of all the ghosts just check which logistic network they are in when you go over that specific entry, maybe store that in the table as well or somthing. You end up with a table of what ghosts are in what logistic networks and can just use that to update the ghosts scanners. It may not be that easy tough, I don't know how fast or easy it is to check what logistic network a specific entity is in.

8 months ago

For me this mod appears to have a larger UPS impact than the original one (with comparable settings).
I don't know why, but it spikes every so often and then goes back to almost zero, but the spikes make it feel more laggy than the original.
(It has less laggy defaults than the original though)

7 months ago

I think I just gotta rewrite the whole thing from ground up...

6 months ago

I think I just gotta rewrite the whole thing from ground up...

That would be well appreciated. Thank you.

New response