Author Topic: Let's make Pain Killer useful  (Read 5696 times)

Offline Vakrug

  • Colonel
  • ****
  • Posts: 320
    • View Profile
Let's make Pain Killer useful
« on: September 26, 2022, 11:30:48 am »
As you probably already know, Pain Killer part of Medi-Kit is totally useless and nobody use it. It is much easier and beneficial to just kill an alien to restore morale lost from a wound. And, what is even worse, there is no indicators of "soldier's pain" in the interface, that is you can see that soldier's morale is below 100, but you can't tell if it can be improved with Medi-Kit.

The most simple solution to revitalize Pain Killer's mechanics is to make pain more "persistent", so that pain prevents achieving maximal morale. If, for example, a soldier has 20 pain, that it's morale cannot be increased above 80 no matter how many aliens are killed. This will make pain more "visible" in the interface and it will be somewhat important to use Pain Killer to remove that pain and increase morale to 100.

I know, if implemented this will be a downside for a player with no benefits, but realism aspect of a game will improve.

-------------------------------

Another somewhat related issue is penalties from fatal wounds on body parts.
https://www.ufopaedia.org/index.php/Fatal_Wounds
According to this article's text in normal font, a soldier will receive penalties for being wounded depending on injuries on different body parts.
According to this article's text in italic font and my personal observation, this is a lie and penalties received are not related to body parts.
So let's convert this lie into truth and revive another dead mechanics: body parts.

What do you think about all of this?

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11722
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: Let's make Pain Killer useful
« Reply #1 on: September 26, 2022, 11:34:13 am »
The idea behind pain sounds promising.
How would the pain be calculated? Can it be accumulated with no limits? How and when exactly would pain be gained and removed?

Offline Yankes

  • Global Moderator
  • Commander
  • *****
  • Posts: 3350
    • View Profile
Re: Let's make Pain Killer useful
« Reply #2 on: September 26, 2022, 12:22:40 pm »
Scripts probably could make this work, only thing missing would be display of this value.
You can add new dynamic tag that affect any of scriptable effects (like aim calculation) and subtracted when med-kit action is used.

Another solution is interact with "mana" (or "fatigue" in XPZ), this last med-kit action could add or remove from this stat.

Offline Vakrug

  • Colonel
  • ****
  • Posts: 320
    • View Profile
Re: Let's make Pain Killer useful
« Reply #3 on: September 26, 2022, 01:01:31 pm »
How would the pain be calculated? Can it be accumulated with no limits? How and when exactly would pain be gained and removed?
??? Ehh... Exactly how it is happening now, I guess. I only proposed 100-pain morale cap.

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11722
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: Let's make Pain Killer useful
« Reply #4 on: September 26, 2022, 01:48:08 pm »
??? Ehh... Exactly how it is happening now, I guess. I only proposed 100-pain morale cap.

But you're suggesting a new feature. You can't say that it'll work like before, because there is no such feature yet. I mean yes, pain is a thing, but it works differently so changing it will certainly present new problems.
For example: what if you fill your entire moral bar with pain? you're stuck at morale 0, regardless of anything?
Are there any other ways of fighting pain, other than pain killers?

Offline Yankes

  • Global Moderator
  • Commander
  • *****
  • Posts: 3350
    • View Profile
Re: Let's make Pain Killer useful
« Reply #5 on: September 26, 2022, 02:40:04 pm »
Beside should pain more work with stun that morale? It would work like wounds but instead of decreasing HP it increase STUN level, and painkillers remove this for couple of turns.

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11722
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: Let's make Pain Killer useful
« Reply #6 on: September 26, 2022, 03:12:12 pm »
Beside should pain more work with stun that morale? It would work like wounds but instead of decreasing HP it increase STUN level, and painkillers remove this for couple of turns.

I like it; that's how pain works in Piratez anyway (resistance to pain gives extra stun regeneration).

Offline Dioxine

  • Commander
  • *****
  • Posts: 5455
  • punk not dead
    • View Profile
    • Nocturnal Productions
Re: Let's make Pain Killer useful
« Reply #7 on: September 26, 2022, 03:23:22 pm »
A simple solution in existing OXCE mechanics is adding moraleRecovery    (Additional points of morale to restore when pain killers are used. Does not depend on lost health (or anything else).) to medikits, therefore "paikiller" becomes much more useful "think happy thoughts" function.
Personally I just ignore painkiller function or use it to mod in varied custom functions instead.

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11722
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: Let's make Pain Killer useful
« Reply #8 on: September 26, 2022, 03:28:52 pm »
How much pain do you actually get in vanilla? 1 pain point per 1 HP lost? This is kinda crucial...

Offline Dioxine

  • Commander
  • *****
  • Posts: 5455
  • punk not dead
    • View Profile
    • Nocturnal Productions
Re: Let's make Pain Killer useful
« Reply #9 on: September 26, 2022, 03:39:13 pm »
After some discussion, there is idea for a maximum solution: add a Pain stat, that is a derivative of Morale, like Stun is derivative of Health, and working the same way, by blocking a part of the bar. Make Pain be gained normally instead of direct Morale damage when receiving damage, and be removable by some "painRecovery" function which painkiller uses by default. Make possible to juggle this stat by adding it to formulas, like 'toPain' (defaulting to 1.0 being same as vanilla, afaik 1 HP damage = -1 Morale) or access to Pain stat in armor's recovery sections.
« Last Edit: September 26, 2022, 03:41:05 pm by Dioxine »

Offline Vakrug

  • Colonel
  • ****
  • Posts: 320
    • View Profile
Re: Let's make Pain Killer useful
« Reply #10 on: September 26, 2022, 03:41:43 pm »
But you're suggesting a new feature.
:o No way! Text from the article about Medi-Kit:
Quote
Pain killer: This will restore the morale of damaged units up to an amount equivalent to the soldier's lost health. There is no effect on uninjured units. The morale benefit for each unit of lost health can only be had once. (Further health loss will allow further morale benefit from pain killers).
Text in bold suggests that there is something that keeps track of pain.

For example: what if you fill your entire moral bar with pain? you're stuck at morale 0, regardless of anything?
Well, yes. I mean soldier with >100 initial health that lost 100 should not gain happiness by killing aliens (or by seeing how aliens get killed by comrades) until soldier get's it's doze of morpheein.

Are there any other ways of fighting pain, other than pain killers?
Common logic suggests that pain should go away with time. But the same common logic suggests, that pain should increase with time if a soldier has untreated wounds...

Beside should pain more work with stun that morale? It would work like wounds but instead of decreasing HP it increase STUN level, and painkillers remove this for couple of turns.
I don't what to couple pain with stun, because it is counterintuitive in many situations. In real life medium pain DECREASES stun level. And also decreases mobility with notable exception being shot with salt in the but... Only critical level of pain causes lost of consciousness. It is complicated, so let's not tinker with this for now.

I like it; that's how pain works in Piratez anyway (resistance to pain gives extra stun regeneration).
:-\ And I thought resistance to pain reduces critical injuries count... I read that somewhere... Or my memory deceiving me again.
« Last Edit: September 26, 2022, 03:53:39 pm by Vakrug »

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11722
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: Let's make Pain Killer useful
« Reply #11 on: September 26, 2022, 03:49:51 pm »
:o No way! Text from the article about Medi-Kit: (...)

But this isn't a feature, it's a concept. I meant how it's supposed to work mathematically.
Never mind though, this is up to the devs anyway.

Common logic suggests that pain should go away with time. But the same common logic suggests, that pain should increase with time if a soldier has untreated wounds...

I don't have a strong opinion here; open wounds are bad enough already, but I ain't saying they can't get worse.

After some discussion, there is idea for a maximum solution: add a Pain stat, that is a derivative of Morale, like Stun is derivative of Health, and working the same way, by blocking a part of the bar. Make Pain be gained normally instead of direct Morale damage when receiving damage, and be removable by some "painRecovery" function which painkiller uses by default. Make possible to juggle this stat by adding it to formulas, like 'toPain' (defaulting to 1.0 being same as vanilla, afaik 1 HP damage = -1 Morale) or access to Pain stat in armor's recovery sections.

And this sounds like a good summary. I'm down with that.
(I know I said otherwise a moment ago, but after all this feels sensible, as we can give it a secondary effect on Stun anyway.)

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9091
    • View Profile
Re: Let's make Pain Killer useful
« Reply #12 on: September 26, 2022, 04:23:43 pm »
Text in bold suggests that there is something that keeps track of pain.

Nope, there is nothing for pain.
There is only something that keeps track of morale restored (variable `_moraleRestored`).

Btw. the variable never gets reset back to zero during a battle (that's what they meant by "The morale benefit for each unit of lost health can only be had once.")

Very weird algorithm, but hey, vanilla.

Code: [Select]
/**
 * Restore soldier morale
 */
void BattleUnit::painKillers()
{
int lostHealth = getBaseStats()->health - _health;
if (lostHealth > _moraleRestored)
{
_morale = std::min(100, (lostHealth - _moraleRestored + _morale));
_moraleRestored = lostHealth;
}
}

Offline Vakrug

  • Colonel
  • ****
  • Posts: 320
    • View Profile
Re: Let's make Pain Killer useful
« Reply #13 on: September 26, 2022, 05:02:28 pm »
But
Code: [Select]
lostHealth - _moraleRestored == PAINGame keeps track of _moraleRestored and, of course, lostHealth. Isn't that enough?

Well, algorithm is really not ideal. For example
Code: [Select]
lostHealth != getBaseStats()->health - _health;because some health was (probably) restored with healing. And that is not to mention other health boostings using mods. And also not addressing situation where an agent is participating in base defense with <100% health when game rules allow that. However, such agent should have pain from the start, so this is not really an issue...
« Last Edit: September 26, 2022, 05:09:30 pm by Vakrug »

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9091
    • View Profile
Re: Let's make Pain Killer useful
« Reply #14 on: September 26, 2022, 06:05:20 pm »
Game keeps track of _moraleRestored and, of course, lostHealth. Isn't that enough?

No, the game doesn't keep track of lostHealth.

`lostHealth` variable is local for that function and is not remembered anywhere.