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

A rework of Proximity Detector System to fix #34286 #34361

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

de0rix
Copy link
Contributor

@de0rix de0rix commented Jan 10, 2025

About the PR

In this PR, the ProximityDetectionSystem.cs has been reworked.

It now can match entities if they have at least a single component from the list in yaml (i.e. properly handle component filtering with RequireAll being false), as well as preserving previous functionality of matching entities with all components in the same list.

Some code was also changed to handle tags search in a better way: now it's possible to use tags only as a criteria, as well as dropping the need to mark TagComponent specifically in the list of components in a criteria (because other way, there would be no entities with field Comp containing TagComponent, that is checked for by previous code) and making tags in a criteria work as a whitelist instead of a blacklist.

Why / Balance

This PR fixes #34286 and other similar subsequent issues, where entities that use this system and component need to match entities that have a single component listed in the criteria.

Technical details

All code logic changes are in the system.
Some formatting was changed.

  • Error handling was changed to accommodate use case, where only tags are listed.
  • Now instead of checking for TagComponent specifically in a entity-component pair when matching entities tags, EntityManager is used for retrieving it.
  • CheckForAllComponentsPresent method was changed, as well as it's name and code that prepares data to call it.
  • Some comments were added or changed to better describe why code is used or how to use Criteria property of a component.

Media

footage1.mp4

Requirements

Breaking changes

Possible breaking change is in how the matching entities by criteria is handled now. I've tested all of the two locators currently in-game (anomaly and spectral locator), and adjusted their prototypes a little bit to fix the issue #34286 or to better match new changes, but obviously, developers from other forks of the game should adjust their prototypes accordingly if needed.

Previously, it seems like tags criteria worked like a blacklist, so now entities that should be matched should have those listed tags, instead of entities, that should not.

Default for RequireAll is now false, and because now it affects how entities with listed components matched, changes should be made to their prototypes and/or setting this property to be true.

Changelog

🆑

  • fix: Anomaly locator not locating anomaly injectors.

@github-actions github-actions bot added S: Untriaged Status: Indicates an item has not been triaged and doesn't have appropriate labels. size/S Denotes a PR that changes 10-99 lines. labels Jan 10, 2025
@Hrosts
Copy link
Contributor

Hrosts commented Jan 10, 2025

Wrong PR link in the description I think you wanted #34286

@de0rix
Copy link
Contributor Author

de0rix commented Jan 10, 2025

Wrong PR link in the description I think you wanted #34286

Indeed, thanks!

@lzk228 lzk228 added P3: Standard Priority: Default priority for repository items. T: New Feature Type: New feature or content, or extending existing content D3: Low Difficulty: Some codebase knowledge required. A: Science Area: Science department, not including Silicons. S: Needs Review Status: Requires additional reviews before being fully accepted and removed S: Untriaged Status: Indicates an item has not been triaged and doesn't have appropriate labels. labels Jan 10, 2025
@metalgearsloth metalgearsloth added S: Awaiting Changes Status: Changes are required before another review can happen and removed S: Needs Review Status: Requires additional reviews before being fully accepted labels Jan 10, 2025
@github-actions github-actions bot added size/M Denotes a PR that changes 100-999 lines. and removed size/S Denotes a PR that changes 10-99 lines. labels Jan 12, 2025
@de0rix de0rix requested a review from metalgearsloth January 12, 2025 18:21
@github-actions github-actions bot added S: Needs Review Status: Requires additional reviews before being fully accepted and removed S: Awaiting Changes Status: Changes are required before another review can happen labels Jan 12, 2025
@de0rix de0rix changed the title A rework of Proximity Detector System to fix #34301 A rework of Proximity Detector System to fix #34286 Jan 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A: Science Area: Science department, not including Silicons. D3: Low Difficulty: Some codebase knowledge required. P3: Standard Priority: Default priority for repository items. S: Needs Review Status: Requires additional reviews before being fully accepted size/M Denotes a PR that changes 100-999 lines. T: New Feature Type: New feature or content, or extending existing content
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Anomaly locators do not locate anomaly injectors
5 participants