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

Moral effects last 10x as long as they should #27733

Closed
rselias opened this issue Jan 20, 2019 · 4 comments · Fixed by #27803
Closed

Moral effects last 10x as long as they should #27733

rselias opened this issue Jan 20, 2019 · 4 comments · Fixed by #27803
Labels
Game: Balance Balancing of (existing) in-game features. Mechanics: Character / Player Character / Player mechanics (S1 - Need confirmation) Report waiting on confirmation of reproducibility

Comments

@rselias
Copy link
Contributor

rselias commented Jan 20, 2019

Describe the bug
Looking in the code, it appears the Killed Innocent debuff is supposed to last 2 days. It lasts about 18 instead. This time does not scale with season length.

Looking at my main save file, the duration of the debuff is correctly set to 28800, which should be 48 hours. However, its age is only 10.48 hours when the debuff has been present for maybe five days - I don't remember exactly when it started. My initial guess was that it's reading the duration as minutes instead of turns, but testing with a debug character had the debuff last 18 days instead of 20, which I would have expected if that were the case.

To Reproduce
Steps to reproduce the behavior:

  1. Make a debug character in a new world
  2. Wish for a weapon and timekeeping device
  3. Spawn and kill an NPC
  4. Repeatedly wait until dawn, checking morale until debuff expires on day 19

Expected behavior
For a murder on day 1, the Killed Innocent morale debuff should expire on day 3.

Versions and configuration:

  • OS: Windows 10
  • Game Version: 0.C-36894-gdbbeb42 (but the bug is definitely not just in the latest version)
  • Graphics version: Tiles
  • Mods loaded: DDA, Disable NPC Needs, Filithy Clothing, Simplified Nutrition
@vpkoskinen
Copy link

In game.cpp starting from line 1681 it reads:

    if( calendar::once_every( 1_minutes ) ) {
        u.update_morale();
    }

So morale decays by one turn every minute, but there are 10 turns in a minute.
I do not know if this is intended behavior, but removing the conditional gives the expected behavior by rselias.

@Night-Pryanik Night-Pryanik added Game: Balance Balancing of (existing) in-game features. (S1 - Need confirmation) Report waiting on confirmation of reproducibility Mechanics: Character / Player Character / Player mechanics labels Jan 21, 2019
@Zireael07
Copy link
Contributor

If other effects decay properly, maybe whoever wrote the value misunderstood the units it uses?

@rselias
Copy link
Contributor Author

rselias commented Jan 21, 2019

Upon further testing, it's not just the one effect. Every morale effect I checked lasted a bit under 10 times as long as it was supposed to, as is implied by the faulty check vpkoskinen found.

@rselias rselias changed the title Killed Innocent morale debuff lasts 18 days Moral effects last 10x as long as they should Jan 21, 2019
@SilearFlare
Copy link

looks like an easy fix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Game: Balance Balancing of (existing) in-game features. Mechanics: Character / Player Character / Player mechanics (S1 - Need confirmation) Report waiting on confirmation of reproducibility
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants