Skip to content

Update Population format on Extinction Continue and Patch Details Panel Screens#6601

Open
vmjauregui3 wants to merge 5 commits intoRevolutionary-Games:masterfrom
vmjauregui3:master
Open

Update Population format on Extinction Continue and Patch Details Panel Screens#6601
vmjauregui3 wants to merge 5 commits intoRevolutionary-Games:masterfrom
vmjauregui3:master

Conversation

@vmjauregui3
Copy link

@vmjauregui3 vmjauregui3 commented Dec 22, 2025

Prefix
I wanted to start contributing to Thrive, so I looked at the application page https://www.revolutionarygamesstudio.com/application and was led to https://github.com/Revolutionary-Games/Thrive/issues. I haven't made a public push request before, so this is unlikely to be formatted correctly, and for that, I apologize.

I saw the issue "Update the population format on the extinction continue screen" https://github.com/Revolutionary-Games/Thrive/issues/6570 was marked as "easy" and "good first issue" so I took a crack at it; although, I'm unsure if it's really the "best practice" format that is used in other places in the code. I'd have to keep reading through to make sure it aligned with how you all do things.

Brief Description of What This PR Does

Updates the Extinction Continue Screen to use the "T" suffix
Screenshot 2025-12-21 230320

While I was looking for an example of how it was used in other places, I saw that the Patch Details Panel Screen also wasn't updated. I'm unsure if that was intentional, but I changed that too.

Updates the Patch Details Panel Screen to use the "T" suffix.
Screenshot 2025-12-21 230603

I based the changes off of how the populations were being displayed in src/microbe_stage/editor/SpeciesResultButton.cs
Let me know if there is a better way to do this and I can make the change.

Related Issues

Fixes #6570

Progress Checklist

Note: before starting this checklist the PR should be marked as non-draft.

  • PR author has checked that this PR works as intended and doesn't
    break existing features:
    https://wiki.revolutionarygamesstudio.com/wiki/Testing_Checklist
    (this is important as to not waste the time of Thrive team
    members reviewing this PR)
  • Initial code review passed (this and further items should not be checked by the PR author)
  • Functionality is confirmed working by another person (see above checklist link)
  • Final code review is passed and code conforms to the
    styleguide.

Before merging all CI jobs should finish on this PR without errors, if
there are automatically detected style issues they should be fixed by
the PR author. Merging must follow our
styleguide.

@revolutionary-bot
Copy link

Thank you for contributing to Thrive.

Before your contribution can be accepted, you need to sign our CLA.
You can sign it, and find more info about it, here: https://dev.revolutionarygamesstudio.com/cla

Once your contribution has been accepted you can ask to be included in the credits (https://wiki.revolutionarygamesstudio.com/wiki/Team_Members) and you can apply to join the team and use this work as a sample: https://revolutionarygamesstudio.com/application/

@revolutionary-bot
Copy link

The lead programmer for Thrive is currently on vacation until 2026-01-07. Until then other programmers will try to make pull request reviews, but please be patient if your PR is not getting reviewed.

PRs may be merged after multiple programmers have approved the changes (especially making sure to ensure style guide conformance and gameplay testing are good). If there are no active experienced programmers who can perform merges, PRs may need to wait until the lead programmer is back to be merged.

@vmjauregui3
Copy link
Author

I would like to contribute if possible, so even if this commit is not proper, please inform me of the error and I will do my best to work on improving it.

continueText.ExtendedBbcode = Localization.Translate("CONTINUE_AS_SPECIES")
.FormatSafe(ShowContinueAs.FormattedNameBbCode,
StringUtils.ThreeDigitFormat(ShowContinueAs.Population));
.FormatSafe(ShowContinueAs.FormattedNameBbCode, $"{ShowContinueAs.Population} {AmountSuffix}");
Copy link
Contributor

Choose a reason for hiding this comment

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

You don't need to create an AmountSuffix field on the class, just use the constant value directly

Copy link
Author

Choose a reason for hiding this comment

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

That is what I thought, but it's how it was done in already existing code in this project.
Screenshot 2025-12-22 070821
Screenshot 2025-12-22 070536

It is exported here though. Is that why it's supposed to be done in this case or should it be changed here as well?

Regardless, I have made the changes and am adding those to this pull request.

Copy link
Contributor

Choose a reason for hiding this comment

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

Hmmm interesting, tbh I have no idea what it's for, it seems there is no point in making it an exported value here. Maybe it's some left-over code? Git says our lead programmer wrote these lines, so we would need to wait until he's back from the break.

If you look in two other places where this value is used you can see that it is used directly, example:

predictionDetailsText.Append(new LocalizedString("ENERGY_SUMMARY_LINE", Round(energyResult.Value.TotalEnergyGathered), Round(energyResult.Value.IndividualCost), $"{energyResult.Value.UnadjustedPopulation} {Constants.MICROBE_POPULATION_SUFFIX}"));

I would propose to also do it like that

Copy link
Member

Choose a reason for hiding this comment

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

The reason why the suffix is made configurable is that each species type will in the future need to have its own value, for example multicell and especially macroscopic species will not have trillions of members. So there should be enough configurability put in the code that deals with the suffises so that it isn't a major headache later to solve. Without reading my own older code, I bet that that was what I was doing but obviously as the different suffix constants aren't made yet, the design might not be fully "tested" so to speak.

The nonconfigurability un auto-evo is kind of fine for now as auto-evo is not implemented for any other species type than microbes. But yes there as well the suffix will need to be made configurable.

p.s. I'm still on break but I couldn't help seeing the notification with some reference being made to me so I ended up reading the notification and then writing this message.

Copy link
Author

Choose a reason for hiding this comment

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

@hhyyrylainen I'm not sure when you'll be back, but I also just returned from a holiday break, so I wanted to ask a question about this. Right now, even in my example photos, there are >999T values still being represented with a T. I think when I was playing before, I saw numbers with the Q suffix at the end. If we're currently using the T for all microbes, are those values also using an older system, or are they using a newer suffix system than what I got approved here?

Copy link
Member

Choose a reason for hiding this comment

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

StringUtils.FormatNumber is the right way to ask to format big numbers. I haven't yet looked at the code here as I've had over 100 notification emails to go through, but also you need to multiply the number by population *= Constants.MICROBE_POPULATION_MULTIPLIER; first if the species is a microbe.

@vmjauregui3
Copy link
Author

Apparently, I forgot to indent the change that made a new line. I'll have to fix it when I get home.

@Patryk26g
Copy link
Contributor

There is still an issue with the styling. You can use dotnet run --project Scripts -- check command before commiting to see if something needs more work.

Btw in almost all cases our lead programmer is the one that merges pull requests, so you will need to wait patiently for him to come back from his break :D, he just started today so you got unlucky with the timing

@Patryk26g
Copy link
Contributor

Code looks good now, I have tested it and it works as intended

@hhyyrylainen hhyyrylainen added this to the Release 1.0.1 milestone Jan 7, 2026
@hhyyrylainen
Copy link
Member

I feel like it would be really useful to make a generic "FormatSpeciesPopulationForDisplay" method (maybe even directly in the Species class and then override that for MicrobeSpecies to use the scaling factor.

Copy link
Member

@hhyyrylainen hhyyrylainen left a comment

Choose a reason for hiding this comment

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

I feel like these changes should take into account the fact that these also exist in the multicellular stage and can be used from there, so it's not fully correct to use a hardcoded assumption that any species is a microbe species.

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

Labels

Projects

Status: In progress

Development

Successfully merging this pull request may close these issues.

Update the population format on the extinction continue screen

4 participants