Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added the angle property to DetectionMode that controls whether the mode is limited to the vision angle #8482

Closed
dev7355608 opened this issue Nov 5, 2022 · 3 comments
Assignees
Labels
api Issues related to the API used by Mod Devs data-models Issues related to data models and schema changes vision Issues related to Token vision and vision modes

Comments

@dev7355608
Copy link

User Experience

The name of DetectionMode#walls suggests that the LOS check performed by _testLOS is strictly wall-based. But the LOS polygon may be constrained either by the Vision Angle or by a module that wants to limit the maximum range of light-based perception. Those constraints are unrelated to walls but are applied regardless to all detection modes with walls: true, because _testLOS uses the LOS polygon. Detection modes with walls: false ignore the Vision Angle even though the angle is unrelated to walls.

There should be a separate property that controls whether the mode is limited to the vision angle. A sense may be directional (limited to the vision angle) but ignore walls (example: x-ray vision). A sense may be omnidirectional (not limited to the vision angle) but restricted by walls (example: smell, hearing).

@aaclayton aaclayton added the vision Issues related to Token vision and vision modes label Nov 6, 2022
@aaclayton aaclayton added this to the Version 10 - Stable Patch 5 milestone Nov 6, 2022
@aaclayton aaclayton added the data-models Issues related to data models and schema changes label Nov 6, 2022
@aaclayton aaclayton removed this from the Version 10 - Stable Patch 5 milestone Nov 6, 2022
@caewok
Copy link

caewok commented Nov 6, 2022

I agree, but I think if you do this, you probably need to cache the different LOS polygons in some manner. Changing VisionAngle and/or maximum range would, of course, change the LOS polygon. Given the possibility of multiple detection modes, you would want to keep the default LOS polygon for a given VisionSource and then construct additional ones on-demand. Otherwise, testing multiple points with multiple detection modes will quickly become unworkable.

You could set up caching in VisionSource.prototype._createPolygon and wipe the cache on VisionSource.prototype.initialize, for example.

Related: #8484.

@Feu-Secret
Copy link

@dev7355608 @aaclayton I think we should requalify this issue as a bug. With walls: false, we should take into account the angle and direction to test visibility. We don't need an extra parameter (for the moment, maybe for a future version). Thoughts?
If we are going this way, we could add it to the v11 testing 2 milestone.

@Feu-Secret Feu-Secret self-assigned this May 6, 2023
@Feu-Secret Feu-Secret added the api Issues related to the API used by Mod Devs label May 6, 2023
@Feu-Secret Feu-Secret added this to the Version 11 - Testing 2 milestone May 6, 2023
@aaclayton
Copy link
Contributor

I'm okay with that if you think the scope and timing are appropriate to work on for V11.

@Feu-Secret Feu-Secret assigned dev7355608 and unassigned Feu-Secret May 9, 2023
@dev7355608 dev7355608 changed the title Add a property to DetectionMode that controls whether the mode is limited to the vision angle Added the angle property to DetectionMode that controls whether the mode is limited to the vision angle May 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Issues related to the API used by Mod Devs data-models Issues related to data models and schema changes vision Issues related to Token vision and vision modes
Projects
Status: Done
Development

No branches or pull requests

4 participants