Improved Inventory Sensor


Shows inventory information of various entities.

Content
21 days ago
2.0
601
Circuit network

i Improvement ideas

8 months ago
(updated 8 months ago)

Hi, nice mod, I'll probably transition to it from the old one in the near future. In the meantime here is a list of things I always wanted from the previous mod that:

  • some other texture than the recolored combinator (but let's be honest, graphics is the most difficult part xd)
  • it would be nice to visualize the area that the sensor scans (I read you have that in debug mode, but it would be nice to have it in the normal mode as well, for example on hover and how inserters visualize their input/output)
  • because it scans in an interval, I had an idea to improve the performance: detect events in the area it scans. So for example if it scans a 1x1 area in front of it, don't check that in a loop, but rather check for events such as entity placed/destroyed, entity interacted with and vehicle entered/exited hitbox and entity inventory changed by player/inserter/whatever. I am not familiar with the modding API, but as a programmer I imagine it could be done by reversing the responsibility: entities have the ability to read the tiles they are on (so that for example car/player can go faster on concrete than on the ground), so it could be be done with inventory sensor being passive, and when entity moves it notifies the tiles it's over that it's there. This way there could be no need for scan interval.
  • it would also be useful if there was a single light indicator which could show different colors depending on the state it's detecting - if there is an entity like a car/wagon show green, if not show red.
  • Ability to filter on what to detect - if it reads inventory or does it only read the entities
  • ability to configure scan area for each scanner individually. With the below proposition of "smart concrete" would be out of the box.
  • instead of a circuit and an entity, it could be nice if it was implemented as a tile which can be connected to the circuit network, something like "smart asphalt". So anything that comes in contact with any of the connected tiles of a smart asphalt tile is detected. Be it placed entity or vehicle entering the spot. It would also solve the problem of visualization because it would be straightforward to see what area is being detected.
8 months ago

Smart concrete concept

8 months ago

Hi,

thanks, those are great suggestions. Some might be implementable easier than others.

Obviously I am very open to collaborating with someone that is a graphics artist / knows 2.5D/3D design. I don't (if I need something I can recolor an existing sprite or create an image with chatgpt but that is it. I am a programmer. :-) ).

Biggest problems with the events that you list, is that most of them don't exist. :-) There e.g. are no events when an inventory changes or a vehicle enters/leaves an area. see https://lua-api.factorio.com/latest/events.html for event that the game emits and that mods can listen to.

The light indicators are tricky. The little blue light is controlled by the game itself based on activity and it can be moved around but not controlled. So adding a light is basically adding another entity overlaying the combinator which is hard. For now, the blue light turns on if the combinator is connected to something and emits a signal. That behavior is hardcoded in the game.

Visualizations are doable and I might add them. However, the biggest value besides scanning vehicles is "look at the thing in front of you". It makes the detection simple because there can be only one entity. Extending the area means that the code needs to look at multiple areas and that makes life much harder.

The tile would be a combination of tile entities with a combinator. The combinator is needed because that is what literally generates the signals.

Some of the filtering suggestions are interesting and I might think about it. Thank you for engaging here with the mod.

New response