Skip to content

Clear mutation points cache on infinite MP cheat used#6991

Open
CI09 wants to merge 4 commits into
masterfrom
infinite_mp_cheat_fix
Open

Clear mutation points cache on infinite MP cheat used#6991
CI09 wants to merge 4 commits into
masterfrom
infinite_mp_cheat_fix

Conversation

@CI09

@CI09 CI09 commented May 11, 2026

Copy link
Copy Markdown
Contributor

Brief Description of What This PR Does

Extra cache was added, also microbe editor cheat panel now references microbe editor, and infinite MP cheat connects to another method (other method wasn't microbe editor cheat panel's specifically, but inherited from its base class instead, that's why)

Related Issues

Closes #6987

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). This includes gameplay testing by the PR author.
  • 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.

@CI09
CI09 requested review from a team May 11, 2026 15:27
@CI09 CI09 added the review label May 11, 2026
@github-project-automation github-project-automation Bot moved this to In progress in Thrive Planning May 11, 2026
@hhyyrylainen

Copy link
Copy Markdown
Member

How does this fix the infinite MP cheat not working if at low MP when enabling it?

@CI09

CI09 commented May 11, 2026

Copy link
Copy Markdown
Contributor Author

Well I didn't really look much into it, just tried clearing cache when using the cheat, and it kind of worked.
I now pushed a commit removing the extra caching, because I realized it just gets removed anyway... Yeah this PR turned out kinda weird.

Although it works, if you use up more MP than you had and turn off the cheat (so you have negative MP), you can't remove the organelles you placed, which might or might not be a bug, I don't know.

@CI09 CI09 changed the title Add extra cache for mutation points if infinite MP cheat was used Clear mutation points cache on infinite MP cheat used May 11, 2026
@hhyyrylainen

Copy link
Copy Markdown
Member

Although it works, if you use up more MP than you had and turn off the cheat (so you have negative MP), you can't remove the organelles you placed, which might or might not be a bug, I don't know.

I think that is caused by the actual underlying problem: #6696

I was kind of hoping that the infinite MP cheat would be fixed in a way that also fixed #6696 rather than doing a workaround like this, which needs to be done for all editors (I think this fix will actually not work at all in the multicellular editor).

So I kind of want to leave this PR open for a while to see if we get a fix for the underlying issue first. If not then I suppose it will eventually be good to at least have a bandaid fix for the microbe and multicellular editors (as this fix doesn't fix the underlying issue, it has to be hooked up to each editor separately to keep working).

@CI09

CI09 commented May 12, 2026

Copy link
Copy Markdown
Contributor Author

It should now work for multicellular editor too now.
And yeah the fix is kinda scuffed but appearently I'm still not really comfortable in editing and adding to other people's code even after this time.
I have some idea that the issue might be somewhere in EditorMPTests.cs or in related parts, maybe in some SpeciesComparer, although the first one feels more like it. Though I don't promise it's necessarily there if someone wants to take a look at it

@hhyyrylainen

Copy link
Copy Markdown
Member

Well EditorMPTests.cs is just the tests, so changing it won't impact much. Though it might be the case that after the underlying bug is solved, the tests also need updating.

I think the problem is unlikely in SpeciesComparer, because it doesn't know what max MP is so it just tallies up the changes. What I think the most likely place the bug is is that the editor code misinterprets data from the change calculation. It should be updated to tell the difference between the new action costing too much MP and the MP being already consumed but the new action doesn't make the situation worse. I think that would allow free actions when at 0 MP and maybe any action if cheats are enabled (though this might need a further small tweak depending on how changes are assumed to be free with the cheats on).

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.

Infinite MP cheat not working on already low MP

3 participants