IntelligenceModding / Advanced-Peripherals-Features

A place for the feature request for Advanced Peripherals
0 stars 1 forks source link

Entity Camera/Radar block #4

Open jbox144 opened 1 year ago

jbox144 commented 1 year ago

Describe your idea

I have a (fairly) simple concept, that I can't find in any modern CC peripheral mods - a remote entity sensor of some kind.

It's main function is to detect nearby entities it can see from itself - within a certain radius. A basic sensor would be able to detect entities within an 8 block radius, and an advanced one may have a more impressive range of 32 or 64 (potentially with configuration options)

The peripheral would provide a "scan" function, which will return a table of the relative position of entities to the sensor. The function could also optionally take a name or type filter - specifying to search for entities with a specific name, or which are mobs/items/falling sand/tnt/e.t.c.

When called - the sensor should filter out all loaded entities to an area around itself which satisfies the range requirement. Then, it would perform a simple ray cast from itself to each entity - to test whether it's vision is obstructed. Obstruction would include any solid blocks, but not transparent blocks - obviously. All entities which satisfy the raycast are passed on.

To prevent abusing this function for lag - the function should start with the closest entities and work outwards. If the number of checked entities exceeds a configured limit, the function should end, and return the list generated so far.

The returned value would be a list of dictionaries containing the relative position of entities as well as their name - and potentially some metadata which would be reasonably visible (like if they are holding an item or wearing armor if applicable)

Describe alternatives you've considered if you've any

In some of the classic versions of CC and the 1.12.2 CC port, there were several addons which provided functionality similar or identical to what's described above. However, such addons are no longer maintained - and none of the modern addons I've seen have any such feature. I would have figured that entity detection would have been a pretty reasonable addition, but I can't find anything for such.

Additional context

If this has been addressed before and I couldn't see the suggestion, I apoligise for wasting your time.

Linked Issues

No response

SirEdvin commented 1 year ago

There is scanEntities function in Environment Detector, which just scan entities in provided range. But is seems it doesn't described in documentation

zyxkad commented 11 months ago

I think you can use both environment detector and geo scanner (for check transport block) to impliment what you said above

zyxkad commented 2 months ago

Considered again, this could be an addition for environment detector, which let it have narrow POV instead of a cube, but gives more range