Skip to content

Conversation

Anubioz
Copy link

@Anubioz Anubioz commented Sep 30, 2025

Summary

Bugfixes "missions in yet_to_start status should be exempted from is_complete checks"

Purpose of change

While analyzing performance issues for my crafting/sleeping, it showed that almost 70% of CPU was used by the mission:is_complete checks
image

But heck my character didn't even had any missions. Long stort short, game automatically adds hidden mission MISSION_LEARN_ABOUT_CATTAIL_JELLY with MGOAL_CONDITION type and u_has_item check. So effectively that does a full inventory iteration every turn.

Describe the solution

So why would even check for completeness a mission that hasn't even started? We have another check for yet_to_start type (which would change the mission state to the in_progress status). As soon as those are not checked there is a huge performance boost for every long task
image

Describe alternatives you've considered

Just removing MISSION_LEARN_ABOUT_CATTAIL_JELLY or modifying it to NOT check for any inventory items should work just as well

Testing

It compiles, it runs...

Additional context

No AI this time, no strange overhaul ideas, will it work this way or am I mistaken again?

…ness

Checking every turn if mission is complete has a huge performance impact when sleeping/crafting/doing any task. We need to make it blazing fast, so let's start with removing missions that hasn't even been started from that check...
Copy link
Contributor

You are creating a pull request with the master branch as the head branch. This is completely fine if you plan to make contribution once or do not plan to do it often, but if you are interested in making multiple pull requests within a short span of time, this would prevent you from doing it comfortably. You may read https://docs.github.com/en/get-started/quickstart/contributing-to-projects#creating-a-branch-to-work-on for a typical workflow of contributing to a project on GitHub.

@github-actions github-actions bot added Missions Quests and missions [C++] Changes (can be) made in C++. Previously named `Code` new contributor labels Sep 30, 2025
@Anubioz
Copy link
Author

Anubioz commented Sep 30, 2025

Oh and now I see that function should have return false; I knew I would screw up even in 3 lines of c++ code, sorry guys )
Should i recommit or can you please make the change yourself, please please

@github-actions github-actions bot added json-styled JSON lint passed, label assigned by github actions astyled astyled PR, label is assigned by github actions labels Oct 1, 2025
@PatrikLundell
Copy link
Contributor

When you screw up in a PR (which is bound to happen sooner or later for everyone), you update the PR yourself and submit that to the same PR as another commit, so you don't need to ask others to do it for you.

@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label Oct 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions [C++] Changes (can be) made in C++. Previously named `Code` json-styled JSON lint passed, label assigned by github actions Missions Quests and missions new contributor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants