Skip to content

Conversation

@GameDungeon
Copy link
Contributor

@GameDungeon GameDungeon commented Jul 12, 2025

Brief Description of What This PR Does

Refactors the algorithm for GetMutationsForSpecies for a large speed increase.

This does have an effect on auto-evo output, and could contain some regressions due to the complexity of the patch, but everything appears to be working.

Related Issues

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.

@GameDungeon GameDungeon marked this pull request as ready for review July 12, 2025 19:50
@Patryk26g
Copy link
Contributor

In terms of performance it works wonderful, good work, but unfortunately there is still something wrong - the species take ages to evolve

Above 10 generations on this branch:
Screenshot_20250713_194607

3 generations on master
Screenshot_20250713_194844

@GameDungeon
Copy link
Contributor Author

All of the duplicate work did have the side effect of trying way more variations. I'll try cranking it up and see if it gives better results.

@GameDungeon
Copy link
Contributor Author

Ok, So I think I figured out the real issue. Before the mutations were applied in a random order, but now the are applied in a strict order based on the miche tree. This is an issue as beneficial mutations are now getting pruned if applied too early. I'm going to try and rework the mutation order to work better now.

With that change this now has a larger gameplay effect and will likely need some sort of play testing to make sure auto-evo isn't completely out of tune.

@GameDungeon GameDungeon marked this pull request as draft July 13, 2025 20:34
@GameDungeon
Copy link
Contributor Author

This now disables the changes in Thim's most recent auto-evo PR. It is incompatible with the patch here. I would like to find a way to have them play nice, but I can't seem to think of one right now. I'm open to suggestions if anyone has any.

Other than that, this PR is complete and works in my testing. I'm opening it for review.

@GameDungeon GameDungeon marked this pull request as ready for review July 15, 2025 03:46
@Patryk26g
Copy link
Contributor

Patryk26g commented Jul 15, 2025

Now the auto-evo goes a little bit nuts and evolves species with nucleus after only 5 generations 😅
It definately is more "bold" now, but would require to be calmed down a little bit

Edit: I even got a species with nucleus after 3 generations
Screenshot_20250715_232438
Screenshot_20250715_232614

@GameDungeon
Copy link
Contributor Author

Just to have it on the record, that isn't a bug with this patch, and I'll fix it with my next balance patch.

@adQuid
Copy link
Contributor

adQuid commented Aug 3, 2025

it appears that new species aren't consistently being renamed:
image

@adQuid
Copy link
Contributor

adQuid commented Aug 4, 2025

I pushed a change to rebalance the osmoregulation penalty. I don't understand why a square root function makes fewer species get pruned, but eukaryotes now appear at similar rates to before, with some variety of early species still present. It's still your PR, so feel free to mess with it however you need.

@GameDungeon
Copy link
Contributor Author

I'll try and test this tomorrow. Thanks for the commit.

@hhyyrylainen
Copy link
Member

I merged master here as I think this was messing up the CI running unit tests (or at least I hope that was the cause).

@hhyyrylainen
Copy link
Member

Was the renaming problem already fixed? I saw some commits after that but none directly referencing that.

return TraversalOrder8;
}

public record Mutant(MicrobeSpecies Species, double MP);
Copy link
Member

Choose a reason for hiding this comment

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

To not wreck memory allocations, this has to be public record struct Mutant(MicrobeSpecies Species, double MP); to make this into a value type.

And also that means Mutant? should not be used anywhere as that causes boxing. Instead I think that Species here should be made nullable so that null species can stand-in for invalid Mutant instances.

Copy link
Contributor Author

@GameDungeon GameDungeon Aug 5, 2025

Choose a reason for hiding this comment

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

The only place that Mutant? is used is in the sorter, and I don't think it can be replaced with your solution in that context.

Copy link
Member

Choose a reason for hiding this comment

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

I see, that's a bit unfortunate, but it seems it had the same problem with Tuples already. So I guess for now could you add a TODO comment there about this architectural problem that would be nice to solve eventually?

@hhyyrylainen
Copy link
Member

Well this is critically not ready today, so this kind of can't make it into 0.8.3 anymore...

@GameDungeon
Copy link
Contributor Author

Got it. This one really needs a second balancing pass PR too, so unless both can make it neither should be merged.

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

Labels

None yet

Projects

Status: In progress

Development

Successfully merging this pull request may close these issues.

5 participants