Author Topic: Recovery time revamped [OXCE]  (Read 610 times)

Offline Kzer-Za

  • Colonel
  • ****
  • Posts: 140
    • View Profile
Recovery time revamped [OXCE]
« on: August 27, 2019, 04:48:31 pm »
This mod addresses in several ways the time that your wounded soldiers take to heal up.

TL;DR:
1. Recovery time depends on the total amount of health the soldier lost.
2. Percentage of the max health plays a role.
3. No random involved.
4. Shorter average recovery times.

Details:

1. In vanilla the recovery time depends on the health the soldier has in the end of the mission. This makes you pospone ending the mission if you have wounded soldiers and if it's safe for you to postpone ending it until you heal them with medi-kits, because the difference in recovery time will be great. And if the mission ends (due to reaction fire from one of your soldiers, for example) before you have the chance to heal the wounded soldier, it makes you grit your teeth. I think it's excessive micromanagement, which just adds routine, uninteresting actions. Besides, the commander with a wounded soldier would want to finish the battle more quickly, not to prolong it.

Making the recovery time dependent on the total amount of health the soldier lost during the battle takes care of that: if you heal a soldier, it's not gonna reduce the recovery time. Thus, you have no reason not to end the battle when you can. At the same time, the need to heal your soldiers during the battle is not any less: you still don't want them to have low HP, and also the HP they lose when they bleed are also added to the total amount of HP lost. So you still can't neglect your soldiers, but you are not stimulated artificially to prolong the battle until everyone is treated.

2. A soldier with max health 60 is gonna recover from losing 30 HP faster than a soldier with max health 40. The exact values in percent are: less than 20% (20% – 1 HP) lost is healed instantly. Recovery from losing between 20% and (70% – 1 HP) takes 1 day per 5 HP. Recovery from losing between 70% and (100% – 1 HP) adds 1 day per 3 HP. If you lose 100% or more (it's possible if you healed up a wounded soldier for a significant amount of HP and then he was damaged again but not killed), 2 days are added for every HP.

These intervals are additive. Say, your soldier has 50 max health, he first was damaged for 35 HP (15 HP left) and had 7 wounds. You healed all wounds and thus restored 21 HP (his health is 36 HP). Then he is damaged for 25 HP. He still has 11 HP left, so he stay alive, but the total damage taken is 35 + 25 = 60 HP, which is more than 100%. At this moment you kill the last alien and go home. Let's calculate the recovery time.

Less than 20% does not take any time to recover, so his first 9 HP (20% of 50 is 10, and 9 is the first figure less than 10) lost are not taken into account (if he lost only 9 HP, he would be ready for action immediately). Then we add 1 day for every 5 HP lost in the interval 20–70%: (35 – 10) / 5. Then we add 1 day for every 3 HP lost in the interval 70–100%: (50 – 35) / 3. Then, for each HP gone below 100% (plus 100%-th HP per se, since losing this last HP is what actually would have killed the soldier if he weren't healed) we add 2 days: ((60 – 50) + 1) * 2. This makes 5 + 5 + 22 = 32.

3. Any two soldiers with the same max health that have taken the same damage are gonna recover in the same time.

4. Vanilla recovery times always seemed absurdly high to me. This may be "realistic", but I always say that gameplay > realism. If a soldier recovery time approaches 2 months, it is simpler to fire him and hire another one. Notice that with my formula the numbers sharply go up only after taking "deadly wounds", i.e. losing more than 100% health. Until a soldier has taken deadly wounds (which, while possible, is rather unlikely: he is more likely to die), he is gonna recover much more quickly, even considering that in vanilla you can reduce the recovery time by healing him in combat, while with my approach healing, while useful during combat, has no effect on recovery time (other than by preventing loss of HP to bleeding).

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 5468
  • Aaand we're back!
    • View Profile
    • My Wiki
Re: Recovery time revamped [OXCE]
« Reply #1 on: August 27, 2019, 05:12:12 pm »
I don't want to sound negative... but why are you doing this? What's the motivation?

I mean, an average player will never even notice any of these changes.

Also, I feel like you're mostly solving non-issues, like excessive micromanagement for example... whoever micromanages this really needs to think about their priorities in life.

In the last 5 years, I've barely heard any complaints about game mechanics such as this one... you get hurt => you need to spend some time in the infirmary... who cares if it is X days or Y days.

Offline Kzer-Za

  • Colonel
  • ****
  • Posts: 140
    • View Profile
Re: Recovery time revamped [OXCE]
« Reply #2 on: August 27, 2019, 05:26:08 pm »
For fun :) I just like tweaking such things.

Offline N7Kopper

  • Sergeant
  • **
  • Posts: 26
    • View Profile
Re: Recovery time revamped [OXCE]
« Reply #3 on: September 25, 2019, 12:32:57 am »
I don't want to sound negative... but why are you doing this? What's the motivation?

I mean, an average player will never even notice any of these changes.

Also, I feel like you're mostly solving non-issues, like excessive micromanagement for example... whoever micromanages this really needs to think about their priorities in life.

In the last 5 years, I've barely heard any complaints about game mechanics such as this one... you get hurt => you need to spend some time in the infirmary... who cares if it is X days or Y days.
I could legitimately see the benefit of percentage-based recovery times for mods with hero units that might have hundreds of hit points (EG: if someone made a 40k Chaos campaign with Daemon Princes that might need to heal after big fights or something), but honestly, even for my setup it's not necessary for average soldiers - I like to play UFO with TFTD damage RNG, but it makes the endgame armours OP (the option warns you about Sectopods, but it should also warn you about Flying Suits!), so I reduce their effectiveness slightly, but up my soldier's HP values by a good chunk (max 100 rather than 60) to compensate for increased single-shot lethality. The increased infirmary stays from losing 90 hit points rather than 50 (or, you know, 10 rather than 0) just add to the simulationist charm in my book. If you want all of your soldiers to be heroes rather than just skilled and lucky normal people, that's the speciality of the new XCOM games.


I don't think my little balance tweak is everyone's cup of tea, but I actually rather like how it punishes endgame recklessness while also making the beginning less of a meat grinder. Haven't tested it religiously, however.
« Last Edit: September 25, 2019, 12:35:27 am by N7Kopper »

Offline BlackStaff

  • Colonel
  • ****
  • Posts: 152
    • View Profile
Re: Recovery time revamped [OXCE]
« Reply #4 on: September 25, 2019, 02:44:13 pm »
For fun :) I just like tweaking such things.
Thanks for sharing !   :)
Since I don't understand anything about your code, I just have one question!
Does your code take into account the presence of an infirmary/hospital on the base?

Offline Kzer-Za

  • Colonel
  • ****
  • Posts: 140
    • View Profile
Re: Recovery time revamped [OXCE]
« Reply #5 on: September 27, 2019, 07:35:40 pm »
Hm, I don't actually know how it would mix with infirmary/hospital.

Offline KingMob4313

  • Colonel
  • ****
  • Posts: 483
  • Never let me down again.
    • View Profile
    • Mod Hub for Equal Terms 2.0
Re: Recovery time revamped [OXCE]
« Reply #6 on: September 28, 2019, 01:25:24 am »
This mod addresses in several ways the time that your wounded soldiers take to heal up.

TL;DR:
1. Recovery time depends on the total amount of health the soldier lost.
2. Percentage of the max health plays a role.
3. No random involved.
4. Shorter average recovery times.

Details:

1. In vanilla the recovery time depends on the health the soldier has in the end of the mission. This makes you pospone ending the mission if you have wounded soldiers and if it's safe for you to postpone ending it until you heal them with medi-kits, because the difference in recovery time will be great. And if the mission ends (due to reaction fire from one of your soldiers, for example) before you have the chance to heal the wounded soldier, it makes you grit your teeth. I think it's excessive micromanagement, which just adds routine, uninteresting actions. Besides, the commander with a wounded soldier would want to finish the battle more quickly, not to prolong it.

Making the recovery time dependent on the total amount of health the soldier lost during the battle takes care of that: if you heal a soldier, it's not gonna reduce the recovery time. Thus, you have no reason not to end the battle when you can. At the same time, the need to heal your soldiers during the battle is not any less: you still don't want them to have low HP, and also the HP they lose when they bleed are also added to the total amount of HP lost. So you still can't neglect your soldiers, but you are not stimulated artificially to prolong the battle until everyone is treated.

2. A soldier with max health 60 is gonna recover from losing 30 HP faster than a soldier with max health 40. The exact values in percent are: less than 20% (20% – 1 HP) lost is healed instantly. Recovery from losing between 20% and (70% – 1 HP) takes 1 day per 5 HP. Recovery from losing between 70% and (100% – 1 HP) adds 1 day per 3 HP. If you lose 100% or more (it's possible if you healed up a wounded soldier for a significant amount of HP and then he was damaged again but not killed), 2 days are added for every HP.

These intervals are additive. Say, your soldier has 50 max health, he first was damaged for 35 HP (15 HP left) and had 7 wounds. You healed all wounds and thus restored 21 HP (his health is 36 HP). Then he is damaged for 25 HP. He still has 11 HP left, so he stay alive, but the total damage taken is 35 + 25 = 60 HP, which is more than 100%. At this moment you kill the last alien and go home. Let's calculate the recovery time.

Less than 20% does not take any time to recover, so his first 9 HP (20% of 50 is 10, and 9 is the first figure less than 10) lost are not taken into account (if he lost only 9 HP, he would be ready for action immediately). Then we add 1 day for every 5 HP lost in the interval 20–70%: (35 – 10) / 5. Then we add 1 day for every 3 HP lost in the interval 70–100%: (50 – 35) / 3. Then, for each HP gone below 100% (plus 100%-th HP per se, since losing this last HP is what actually would have killed the soldier if he weren't healed) we add 2 days: ((60 – 50) + 1) * 2. This makes 5 + 5 + 22 = 32.

3. Any two soldiers with the same max health that have taken the same damage are gonna recover in the same time.

4. Vanilla recovery times always seemed absurdly high to me. This may be "realistic", but I always say that gameplay > realism. If a soldier recovery time approaches 2 months, it is simpler to fire him and hire another one. Notice that with my formula the numbers sharply go up only after taking "deadly wounds", i.e. losing more than 100% health. Until a soldier has taken deadly wounds (which, while possible, is rather unlikely: he is more likely to die), he is gonna recover much more quickly, even considering that in vanilla you can reduce the recovery time by healing him in combat, while with my approach healing, while useful during combat, has no effect on recovery time (other than by preventing loss of HP to bleeding).

I've done much the same in my game, but edited the behavior at the code level.

Offline new_civilian

  • Commander
  • *****
  • Posts: 677
    • View Profile
Re: Recovery time revamped [OXCE]
« Reply #7 on: November 05, 2019, 11:51:53 am »
Thanks for this script. Unlike Meridian and SolariusScorch I am not a hardcore/masochist player and do like the fact that randomness plays a smaller role in this game.  ;D

Keep up the good work.

Offline Docent

  • Sergeant
  • **
  • Posts: 29
    • View Profile
Re: Recovery time revamped [OXCE]
« Reply #8 on: November 08, 2019, 01:54:04 pm »
This script is great. Do not discourage people from striving for excellence. Only such people can do something like this :)
« Last Edit: November 08, 2019, 01:55:41 pm by Docent »

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 8821
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: Recovery time revamped [OXCE]
« Reply #9 on: November 08, 2019, 02:00:09 pm »
Thanks for this script. Unlike Meridian and SolariusScorch I am not a hardcore/masochist player and do like the fact that randomness plays a smaller role in this game.  ;D

Keep up the good work.

Eh? But less randomness usually means more masochism, not less.

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 5468
  • Aaand we're back!
    • View Profile
    • My Wiki
Re: Recovery time revamped [OXCE]
« Reply #10 on: November 08, 2019, 02:14:23 pm »
1/ IMO randomness and masochism are unrelated

2/ I clearly stated my intention of not wanting to discourage anyone in the first sentence of my response

3/ there are a million ways of implementing this feature... I personally think the vanilla implementation is far superior to this script... other people will think exactly the opposite... and a vast majority of people will anyway think we are both wrong... and that their own solution is far superior to both vanilla and this script... it's pointless to argue who's right (because noone is), so just try not to offend anyone