Skip to content

Conversation

@Pok27
Copy link
Contributor

@Pok27 Pok27 commented Aug 1, 2025

About the PR

Attempting to resurrect and finalize (to the best of my ability) #31461, by design document Botany Rewrite proposal

Thank you for your contribution @drakewill-CRL

Technical details

«‎
This includes making components and systems for the logic around water, nutrients, toxins, pests, gases consumed or exuded, tolerance for light/pressure/ heat, and auto-harvesting.

In the future, plants will be able to have different needs for growth, (EX: a cactus may not check for water, or space-plants may be dependent on special chemicals being present) and different effects can happen on a growth tick without hard-coding more checks into PlantHolderSystem. This also opens up possibilities to mutate these needs off of, or onto, other plants. In particular, a future-state plan for mutations requires plants to be able to consume plasma gas to start acquiring stronger mutations, and that will be its own growth component to trigger that change.

In the process of coding this, the following stats were removed: LightTolerance/Ideal Light (Unused and possibly unmeasureable).
»‎

Requirements

Breaking changes

Changelog

Shouldn't affect gameplay in any way!

@PJBot PJBot added size/L Denotes a PR that changes 1000-4999 lines. Changes: Map Changes: Might require knowledge of mapping. labels Aug 1, 2025
@PJBot PJBot removed the size/L Denotes a PR that changes 1000-4999 lines. label Aug 1, 2025
@PJBot PJBot added the size/L Denotes a PR that changes 1000-4999 lines. label Aug 1, 2025
@PJBot PJBot removed the size/L Denotes a PR that changes 1000-4999 lines. label Aug 1, 2025
@PJBot PJBot added the size/L Denotes a PR that changes 1000-4999 lines. label Aug 2, 2025
@PJBot PJBot removed the size/L Denotes a PR that changes 1000-4999 lines. label Aug 2, 2025
@github-actions github-actions bot added the S: Merge Conflict Status: Needs to resolve merge conflicts before it can be accepted label Oct 12, 2025
@github-actions github-actions bot removed the S: Merge Conflict Status: Needs to resolve merge conflicts before it can be accepted label Oct 13, 2025
Copy link
Member

@Princess-Cheeseballs Princess-Cheeseballs left a comment

Choose a reason for hiding this comment

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

Partial review.

Comment on lines 14 to 15
[DataField]
public float SwabDelay = 2f;

Choose a reason for hiding this comment

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

timespan pls.

Comment on lines 18 to 19
private void OnPlantGrow(EntityUid uid, AtmosphericGrowthComponent component, OnPlantGrowEvent args)
{

Choose a reason for hiding this comment

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

Use Entity<T> typing

Comment on lines 22 to 23
private void OnSwab(EntityUid uid, BasicGrowthComponent component, BotanySwabDoAfterEvent args)
{

Choose a reason for hiding this comment

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

Same here.

Comment on lines 46 to 47
private void OnPlantGrow(EntityUid uid, BasicGrowthComponent component, OnPlantGrowEvent args)
{

Choose a reason for hiding this comment

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

And here.

Comment on lines 17 to 18
private void OnPlantGrow(EntityUid uid, ToxinsComponent component, OnPlantGrowEvent args)
{

Choose a reason for hiding this comment

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

Here too.

Comment on lines 13 to 14
private void OnPlantGrow(EntityUid uid, UnviableGrowthComponent component, OnPlantGrowEvent args)
{

Choose a reason for hiding this comment

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

Here.

Comment on lines 16 to 17
private void OnPlantGrow(EntityUid uid, WeedPestGrowthComponent component, OnPlantGrowEvent args)
{

Choose a reason for hiding this comment

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

And here.

Comment on lines 44 to 45
private void OnTrayUpdate(EntityUid uid, PlantHolderComponent component, OnPlantGrowEvent args)
{

Choose a reason for hiding this comment

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

Here as well.

Comment on lines 16 to 19
if (!TryComp<PlantTraitsComponent>(entity, out var traits))
return;

traits.Potency = Math.Max(traits.Potency + args.Effect.Amount, 1);

Choose a reason for hiding this comment

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

Should probably be tied to an API method rather than having the data in here.

@PJBot PJBot 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. Not to be replaced by S: Approved. labels Oct 15, 2025
@Pok27
Copy link
Contributor Author

Pok27 commented Oct 16, 2025

Do not do this. I'd just delete this entire file and take a completely different approach, this is an evil approach. Use prototypes or entities for storing this kind of data.

After thinking about it and referring to the author's original design (space-wizards/docs#284), I think that fixing it now will only make the situation worse in the future or require a much larger refractor than planned in this PR.

When plants become independent entities, all this will no longer be necessary, the components will simply be located in their id: Plant*, and SeedPrototype will simply indicate to the seed which entity to take the characteristics from (see #31941, but it was not finished).

@Pok27
Copy link
Contributor Author

Pok27 commented Oct 16, 2025

If this PR is merged, I will finish refactoring the rest of it in other PR.

@Princess-Cheeseballs
Copy link
Member

Do not do this. I'd just delete this entire file and take a completely different approach, this is an evil approach. Use prototypes or entities for storing this kind of data.

After thinking about it and referring to the author's original design (space-wizards/docs#284), I think that fixing it now will only make the situation worse in the future or require a much larger refractor than planned in this PR.

When plants become independent entities, all this will no longer be necessary, the components will simply be located in their id: Plant*, and SeedPrototype will simply indicate to the seed which entity to take the characteristics from (see #31941, but it was not finished).

Leave some remarks in the file then explaining your reasoning as to why it exists, as well as a TODO that properly explains what needs to change before the file can be deleted.

@PJBot PJBot added S: Needs Review Status: Requires additional reviews before being fully accepted. Not to be replaced by S: Approved. and removed S: Awaiting Changes Status: Changes are required before another review can happen labels Oct 17, 2025
Copy link
Member

@Princess-Cheeseballs Princess-Cheeseballs left a comment

Choose a reason for hiding this comment

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

One small step towards usable botany code. Still needs another approval, and I'd also give this a full 2 weeks of testing due to size.

@PJBot PJBot added the S: Approved Status: Reviewed and approved by at least one maintainer; a PR may require another approval. label Oct 23, 2025
@Pok27
Copy link
Contributor Author

Pok27 commented Oct 23, 2025

By the way, regarding testing, the growth was a little broken, but it should be back to normal now. Everything else seems to be working as before. 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A: Service Area: Service department, including cooking, botany, etc Changes: Map Changes: Might require knowledge of mapping. D2: Medium Difficulty: A good amount of codebase knowledge required. P3: Standard Priority: Default priority for repository items. S: Approved Status: Reviewed and approved by at least one maintainer; a PR may require another approval. S: Needs Review Status: Requires additional reviews before being fully accepted. Not to be replaced by S: Approved. size/L Denotes a PR that changes 1000-4999 lines. T: Refactor Type: Refactor of notable amount of codebase

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants