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

Componentize Rat King "Rummaging." #34530

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

Conversation

widgetbeck
Copy link
Contributor

@widgetbeck widgetbeck commented Jan 20, 2025

About the PR

Separated out the "rummage" verb and its associated systems from the Rat King component. Also added several options to make it more flexible for developer use.

Why / Balance

Many older components (e.g. Rat King, Dragon, Drone) combine several unrelated systems into one monolithic component with very little YML customizability, which I feel goes against one of the core aims of an ECS - modularity.
My goal in my next few upstream PRs is to separate out these (niche, but useful) mechanics so that they can be more easily used by developers without having to develop their own systems that do the same thing, and in so doing provide more variables which can be manipulated without delving into CS.

Technical details

In this PR, I:

  • Create two new components, CanRummage and Rummageable, which replace the same parts of Rat King component.
  • Create a new system, RummagingSystem, which performs the functions previously confined to Rat King component.
  • Add several options to CanRummage, including:
    • The ability to define a default rummage loot table per-Rummager, as opposed to per-Rummageable object - this can be overridden on the Rummageable object.
    • The ability to customize the LocId of the verb.
    • A rummage speed modifier.
  • Add several options to Rummageable, including:
    • The ability to mark a Rummageable entity as "re-lootable", and a definable cooldown for when its loot will be reset.
    • The ability to override the default loot table defined in Rummaging.

Media

Requirements

Breaking changes

Changelog

I have not included a changelog because these changes do not immediately affect gameplay.

@github-actions github-actions bot added S: Untriaged Status: Indicates an item has not been triaged and doesn't have appropriate labels. size/M Denotes a PR that changes 100-999 lines. labels Jan 20, 2025
@lzk228 lzk228 added A: Core Tech Area: Underlying core tech for the game and the Github repository. P3: Standard Priority: Default priority for repository items. T: Cleanup Type: Code clean-up, without being a full refactor or feature D3: Low Difficulty: Some codebase knowledge required. S: Needs Review Status: Requires additional reviews before being fully accepted T: New Feature Type: New feature or content, or extending existing content and removed S: Untriaged Status: Indicates an item has not been triaged and doesn't have appropriate labels. labels Jan 20, 2025
Copy link
Contributor

@iaada iaada left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this PR! Here's a few things I noticed that I've gotten feedback on before.

Content.Shared/Rummaging/RummageableComponent.cs Outdated Show resolved Hide resolved
Content.Shared/Rummaging/RummageableComponent.cs Outdated Show resolved Hide resolved
Content.Shared/Rummaging/RummagingComponent.cs Outdated Show resolved Hide resolved
Content.Shared/Rummaging/RummagingComponent.cs Outdated Show resolved Hide resolved
@beck-thompson beck-thompson self-assigned this Jan 22, 2025
Copy link
Contributor

@beck-thompson beck-thompson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only other thing is, could you rename Rummagningcomponent/system to something like "CanRummage" or something? It was kind of confusing at first!

Content.Shared/Rummaging/RummagingComponent.cs Outdated Show resolved Hide resolved
Content.Shared/Rummaging/RummagingComponent.cs Outdated Show resolved Hide resolved
Content.Shared/Rummaging/RummagingSystem.cs Outdated Show resolved Hide resolved
Content.Shared/Rummaging/RummagingSystem.cs Show resolved Hide resolved
Content.Shared/Rummaging/RummagingSystem.cs Outdated Show resolved Hide resolved
Content.Shared/Rummaging/RummageableComponent.cs Outdated Show resolved Hide resolved
Content.Shared/Rummaging/RummageableComponent.cs Outdated Show resolved Hide resolved
Content.Shared/Rummaging/RummageableComponent.cs Outdated Show resolved Hide resolved
Copy link
Contributor

@beck-thompson beck-thompson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just really minor stuff! Doing some final tests now

Content.Shared/Rummaging/RummagingSystem.cs Outdated Show resolved Hide resolved
Content.Shared/Rummaging/RummagingSystem.cs Outdated Show resolved Hide resolved
@widgetbeck
Copy link
Contributor Author

widgetbeck commented Feb 1, 2025 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A: Core Tech Area: Underlying core tech for the game and the Github repository. 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: Cleanup Type: Code clean-up, without being a full refactor or feature 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.

4 participants