-
-
Notifications
You must be signed in to change notification settings - Fork 520
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
Tweak mutations algorithm #2293
Tweak mutations algorithm #2293
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Found few things that could be improved.
Co-authored-by: Kasterisk <[email protected]>
This comment has been minimized.
This comment has been minimized.
Seems to work alright. Divergent species are seemingly a bit more diverse in layout. Did not notice any apparent issues. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some code style comments.
src/general/Mutations.cs
Outdated
@@ -391,6 +333,41 @@ private OrganelleDefinition GetRandomOrganelle(bool isBacteria) | |||
"for a new organelle"); | |||
} | |||
|
|||
private MembraneType RandomMembraneType() | |||
{ | |||
var simulation = SimulationParameters.Instance; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is already looked up in the function calling this, should be passed in as a parameter.
src/general/Mutations.cs
Outdated
{ | ||
bool copy = true; | ||
OrganelleTemplate organelle = (OrganelleTemplate)parentOrganelle.Clone(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use var
As far as I can tell, there's just two of my comments left to solve, then this can be merged (play testing didn't bring up any issues). |
Whoops, missed that. |
Brief Description of What This PR Does
I was thinking about the feedback I got from the AI PR that the cells weren't aggressive enough, and I realized we were thinking in terms of trying to make weak cells more likely to attack the player instead of making cells stronger so it made more sense to attack the player. I set out to tweak the mutation add and remove rates, and realized an odd (probably unintended) quirk of the code: adding an organelle had 6 chances to happen (one out of a loop and five in it, but at the same probability), while deletion had a chance of happening PER ORGANELLE. This brings microbes to a natural equilibrium of 6 organelles, beyond which they would be increasingly more likely to mutate down than up, notwithstanding (and eventually overpowering) and influences from auto-evo. This probably helped cause my experience that I would always be the biggest microbe around me, unless I intentionally chose to stay very small.
This PR edits the algorithm to have an equilibrium of (creation chance / delete chance) squared. I've set the two chances to have an equilibrium of 25. In my experience, they still don't get that big, but it seems to help increase the chance that there's something around that might be able to engulf you. I've used:
at line 496 of MicrobeStage.cs to see what microbe species there are without having to swim around and find all of them.
I also changed the logic for a new genus to change genus name whenever a new type of organelle evolves rather than just being on a flat chance, just as an indulgence.
Progress Checklist
Note: before starting this checklist the issue should be marked as non-draft.
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)
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.