Alert Scanner


Adds an alert scanner reading missing materials for ghosts in it's logistic network.

Utilities
2 months ago
1.1 - 2.0
681
Logistic network Circuit network Blueprints

g Seeking info on design decisions & rationale

3 months ago

(sent this as DM on forums too, but duplicated here)

Hey,

Dunno if you're still around playing Factorio and/or making mods, but in the past few weeks I've been tinkering with making an missing-construction-materials alert scanning type mod as an alternative to Ghost Scanner to try to make it perform better. I had looked at doing something like that years ago but at the time the alert API in Lua was such garbage I gave up. Seeing Factorio 2.0's alerting behavior in the UI made me go re-check the Lua API and I was pleasantly surprised to see a nice full and well-rounded API now. So I started tinkering. I'm not very far along at all, but am currently reading and bucketing missing entity ghosts, entity placeholders, upgrade requests, and the like.

But then, I was searching Factorio's unofficial Discord server for Ghost Scanner and I found someone mentioning your Alert Scanner mod. Go figure, this mod of yours is exactly the type of thing I was already envisioning and trying to build! (Serves me right for thinking I was so smart to think of this idea before anyone else :D To be fair, I DID try to search the mod portal extensively for something like this, but I think I got tricked by the fact that Alert Scanner doesn't show up under 2.0).

I downloaded the source and was taking a quick look. Right off the bat, what you did seems WAY more in depth than what I was thinking would be needed. I was thinking:

Every so often (say 3 seconds or something):
- Find one connected player per force (alerts might still be generated even for non-connected but I'd have to check)
- Iterate through the missing construction materials. For each entry, create separate tables per logistics network & per surface. For each table, bucket based on prototype & quality. Count up.
- The resulting table is what needs to be outputted as signals from each "Missing Construction Materials Alert" signal entities placed on the map. Each entity would return only the results for its logistics network.


Now, looking at your logic, I'm seeing all sorts of hacks (like, next-level beyond anything I was thinking lol): * Clearing/deleting alerts as they are generated * Caching various info on alerted entities * Dealing with network merges/splits
and the like.

I'm very much interested in either resurrecting & updating your mod, or else building my own. What's driven me to reach out to you is that -- I HAVE to think you didn't just feel like adding all such complexity for "kicks"; my assumption is there very much were reasons behind each of the additional complexities you added.

If you're still around, would you be able to chat a bit about all your design decisions on Alert Scanner? Granted, maybe some of the performance concerns driving all your optimizations are no longer an issue now in 2.0 but I'd hazard a guess that SOME at least will still apply :D time is money as they say so I figure I might be able to save myself a ton of headache if I just get some of the "deets" from you proactively, if you're willing. Maybe via Discord (but whatever works for you)?

No pressure & no worries if not.

New response