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

[RDY]Morale craft speed penalty #23299

Merged
merged 2 commits into from
Apr 1, 2018

Conversation

Coolthulhu
Copy link
Contributor

Currently there is no craft speed penalty for low morale, only a stonewall at -50 morale.
Changed to craft speed penalty for low morale.

The formula is as follows:

  • If morale is not negative, no penalty
  • For every skill requirement for a given recipe:
    • If crafter's skill is at least 2 times the requirement, no change
    • Otherwise multiply effective morale by 2 * requirement / crafter_skill
  • Divide crafting speed by 1.0f + ( -effective_morale / 50.0f )
  • If crafting speed is below 33%, you can't start a craft
  • If crafting speed is below 20%, you stop current craft

The crafting speed is recalculated every single turn. This crafting speed also includes light penalty.
Important note: this change also means that losing light during crafting will now stop the activity!

The intentions are:

  • Easy jobs (boiling water) will not be penalized noticeably
  • Experts will have no problems with things trivial for them (ie. skill > 2 * requirement)
  • Crafts that would increase skills are penalized the most
  • You need non-negative (or at least only weakly negative) morale to effectively craft hard things

[CR] because both the formula and the intentions may be wrong.
Performance isn't perfect (it could be cached), but this shouldn't be costly enough to be noticeable, not even when repeated every single turn.

[WiP] because at the moment the penalty is applied twice - once for job length (at start of activity), once during crafting.

@Night-Pryanik
Copy link
Contributor

this change also means that losing light during crafting will now stop the activity!

At last!

@ZhilkinSerg
Copy link
Contributor

No more vehicle construction in the dark too?

@Coolthulhu
Copy link
Contributor Author

Didn't change vehicle crafting or construction jobs, only item crafting.

@Coolthulhu Coolthulhu changed the title [WiP][CR]Morale craft speed penalty [RDY]Morale craft speed penalty Apr 1, 2018
@Coolthulhu
Copy link
Contributor Author

Jenkins, rebuild

@illi-kun illi-kun merged commit c31e79e into CleverRaven:master Apr 1, 2018
@Leland
Copy link
Contributor

Leland commented Apr 1, 2018

@Coolthulhu does this close #22203?

@illi-kun
Copy link
Contributor

illi-kun commented Apr 1, 2018

@Leland you mistakenly mentioned the current PR, I suppose.

@Leland
Copy link
Contributor

Leland commented Apr 1, 2018

Fixed. It's been a long day, hah

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants