Skip to content
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

Fix: weariness makes hauling faster instead of slower; set weariness tracker in debug #77220

Merged
merged 3 commits into from
Oct 21, 2024

Conversation

Brambor
Copy link
Contributor

@Brambor Brambor commented Oct 21, 2024

Summary

Bugfixes "Fix: weariness makes hauling faster instead of slower"

Purpose of change

Describe the solution

  • fix: divide instead of multiply
  • debug: add getter and setter to a private variable (ugh...)

Describe alternatives you've considered

  • fix: look at other activities, make hauling move cost more general, it would take more time and potentially introduce more bugs
  • debug: make the variable public (since it has setter and getter, it kinda is); But the implemented way, naming the methods debug_* it is more clear that the programmer shouldn't use them. Open to suggestions!

Testing

  • fix: compiled game before and after, the hauling took much longer. I moved 8 refrigerator tanks with AIM one tile, which takes 13-14 seconds without weariness, 27 seconds being Very Weary, 54-55 seconds being Extremely Weary

    • after, test with different weariness. Hauling seems to be moderate activity, since it takes 4 times as long with Extreme Weariness
      image
  • debug:

    1. set value of weariness tracker:
      1. debug menu
      2. player
      3. edit player/NPC
      4. you
      5. Set needs
      6. Weariness tracker
      7. <set to some value>
      8. or just F11 p p ENTER n W <set to some value> in my case:
      • 0 Fresh
      • 1000000 Light
      • 2000000 Moderate
      • 3000000 Weary
      • 3500000 Very
      • 4000000 Extreme
    2. wait a turn
      - Weariness updates in the side menu
      - You get a message, if weariness changed
      - You get the right effect

Additional context

Not sure, when the player would notice an incoming zombie. Would the Safe mode trigger on time when hauling a big item and being very weary?

@Brambor Brambor changed the title Fix: weariness makes hauling faster instead of slower Fix: weariness makes hauling faster instead of slower; set weariness tracker in debug Oct 21, 2024
@Brambor Brambor marked this pull request as ready for review October 21, 2024 06:28
@github-actions github-actions bot added [C++] Changes (can be) made in C++. Previously named `Code` <Bugfix> This is a fix for a bug (or closes open issue) json-styled JSON lint passed, label assigned by github actions astyled astyled PR, label is assigned by github actions labels Oct 21, 2024
@harakka
Copy link
Member

harakka commented Oct 21, 2024

Do you happen to know if this is also in 0.H or was the bug introduced after? If it is, backport would be cool once this is approved.

@Brambor
Copy link
Contributor Author

Brambor commented Oct 21, 2024

It was there since the beginning of weariness, unless the wearines implementation flipped from 1/val to val/1.

@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label Oct 21, 2024
@dseguin dseguin merged commit aca4398 into CleverRaven:master Oct 21, 2024
25 checks passed
@Brambor
Copy link
Contributor Author

Brambor commented Oct 22, 2024

I hope it is all right if I mark it as a backport candidate then.

If minimizing the code is better, maybe only the change from * to / could be backported.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.H backport candidate astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions <Bugfix> This is a fix for a bug (or closes open issue) [C++] Changes (can be) made in C++. Previously named `Code` json-styled JSON lint passed, label assigned by github actions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Weary penalty doesn't apply to hauling, actually speed ​​it up
3 participants