Project Hospital
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Go down
avatar
juraj.horvath
specialist
Posts : 146
Reputation : 8
Join date : 2018-08-07
Age : 44
Location : Bratislava, Slovak Republic

[RESOLVED] Early bird perk is not applied Empty [RESOLVED] Early bird perk is not applied

Fri Jan 03, 2020 9:25 am
Description
Early bird perk is not applied to performance or efficiency of employees.

While investigating how works skill experience gain and leveling and their effect on employee performance (with dnSpy), I found typo in Lopital.EmployeeComponent.GetEfficiencyPercent() method (Project Hospital version 1.1.17753, Doctor mode DLC)
Code:
...
if (component.m_perkSet.HasPerk("PERK_>EARLY_BIRD"))
{
    if (this.m_state.m_shift == Shift.DAY)
    {
        num += 20f;
    }
    else
    {
        num -= 20f;
    }
}
It should be PERK_EARLY_BIRD instead of PERK_>EARLY_BIRD.
jan.oxymoron
jan.oxymoron
developer
Posts : 2309
Reputation : 335
Join date : 2018-03-23

[RESOLVED] Early bird perk is not applied Empty Re: [RESOLVED] Early bird perk is not applied

Mon Jan 06, 2020 9:41 am
Hi, happy new year and thanks for finding this! A fix will be included in the next patch - and here's a slightly embarrassing fun fact: this went undetected for about 18 months. Wink
avatar
juraj.horvath
specialist
Posts : 146
Reputation : 8
Join date : 2018-08-07
Age : 44
Location : Bratislava, Slovak Republic

[RESOLVED] Early bird perk is not applied Empty Re: [RESOLVED] Early bird perk is not applied

Mon Jan 06, 2020 10:44 am
Hello, happy new year to you and all team members in Oxymoron Games Smile

And that's why this was undetected for such long time. By my opinion, it's mainly because of this code (sorry for disassembling your code):
Code:
public float GetActionTime(Entity character, int characterTimeConstant, float characterSkill)
{
    return (float)characterTimeConstant * character.GetComponent<EmployeeComponent>().GetEfficiencyTimeMultiplier() / characterSkill;
}
Because character skill (especially for doctors) is raising fast and if you maintain stable mood for employee, then early bird or night owl perk have only partial effect. I checked one of my saves and manually calculated (did not confirmed with debug output), what is returned from GetEfficiencyPercent() method. My doctors have these satisfaction modifiers in save:
Code:

<m_satisfactionModifiers>
   <GameDBPointerOfGameDBSatisfactionModifier>
      <GameDBPointer ID="SAT_MOD_FOOD_EATEN" />
   </GameDBPointerOfGameDBSatisfactionModifier>
   <GameDBPointerOfGameDBSatisfactionModifier>
      <GameDBPointer ID="SAT_MOD_TOILET_USED" />
   </GameDBPointerOfGameDBSatisfactionModifier>
   <GameDBPointerOfGameDBSatisfactionModifier>
      <GameDBPointer ID="SAT_MOD_RESTED" />
   </GameDBPointerOfGameDBSatisfactionModifier>
   <GameDBPointerOfGameDBSatisfactionModifier>
      <GameDBPointer ID="SAT_MOD_NICE_ENVIRONMENT" />
   </GameDBPointerOfGameDBSatisfactionModifier>
   <GameDBPointerOfGameDBSatisfactionModifier>
      <GameDBPointer ID="SAT_MOD_GOOD_BOSS" />
   </GameDBPointerOfGameDBSatisfactionModifier>
</m_satisfactionModifiers>
So the value in GetEfficiencyPercent() should be by
Code:
float num = (float)this.m_entity.GetComponent<MoodComponent>().GetTotalSatisfaction() * 0.5f + 50f;
Code:
95 * 0.5f + 50f = 97.5f
So perks PERK_EARLY_BIRD or PERK_NIGHT_OWL with value of 20 have around 20.5% effect on procedure action time, but increasing skill from base 1.0f to 1.5f decreases procedure action time to 66.6% of original time.
Sponsored content

[RESOLVED] Early bird perk is not applied Empty Re: [RESOLVED] Early bird perk is not applied

Back to top
Permissions in this forum:
You cannot reply to topics in this forum