OpenXcom Forum
OpenXcom => Suggestions => Topic started by: Vakrug 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 (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?
-
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?
-
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.
-
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.
-
??? 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?
-
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.
-
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).
-
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.
-
How much pain do you actually get in vanilla? 1 pain point per 1 HP lost? This is kinda crucial...
-
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.
-
But you're suggesting a new feature.
:o No way! Text from the article about Medi-Kit:
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.
-
: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.)
-
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.
/**
* Restore soldier morale
*/
void BattleUnit::painKillers()
{
int lostHealth = getBaseStats()->health - _health;
if (lostHealth > _moraleRestored)
{
_morale = std::min(100, (lostHealth - _moraleRestored + _morale));
_moraleRestored = lostHealth;
}
}
-
But
lostHealth - _moraleRestored == PAIN
Game keeps track of _moraleRestored and, of course, lostHealth. Isn't that enough?
Well, algorithm is really not ideal. For example
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...
-
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.
-
`lostHealth` variable is local for that function and is not remembered anywhere.
Oh, come on... lostHealth = getBaseStats()->health - _health; I don't see the declaration of "getBaseStats" and "_health" here, so I assume they are taken from "soldier" object. So the game does keep track of lostHealth by keeping track of "current health" and "maximal health".
The main concern is about _moraleRestored...
-
Oh, come on... lostHealth = getBaseStats()->health - _health; I don't see the declaration of "getBaseStats" and "_health" here, so I assume they are taken from "soldier" object. So the game does keep track of lostHealth by keeping track of "current health" and "maximal health".
Dude, do you really want to argue with an openxcom developer about openxcom source code?
`getBaseStats()->health` is a constant (usually), but `_health` can easily change. Once you heal up your soldier, both will have the same value and lostHealth will be zero. I.e. the game lost all information it ever had about it, i.e. it is not tracked.
-
Dude, do you really want to argue with an openxcom developer about openxcom source code?
At this moment it is more an argue about ability to make logical conclusions using facts provided. Pain Killer do works, right? It restores some morale and do it only once (before another plasma beam hit), right? So game does keep track of Pain Killer usage. Otherwise either Pain Killer would not work completely or it would be possible to restore morale multiple times.
`getBaseStats()->health` is a constant (usually), but `_health` can easily change. Once you heal up your soldier, both will have the same value and lostHealth will be zero. I.e. the game lost all information it ever had about it, i.e. it is not tracked.
Yes, this is a problem, but not really big problem. According to formula provided, if a soldier somehow gets healed completely it cannot recover morale with Pain Killer, because info about damage take is lost indeed. And info about pain is lost as well. But in most cases a soldier after healing will still have diminished health. So it would be possible to recover some lost morale (but not all) lost during damage taken. And after that nothing would prevent gaining morale through shooting bad guys, because there is no more pain.
I really don't want to change anything in how right now morale gets retracted or how it gets back after using Pain Killer. I want to change how morale gets added by shooting aliens.
-
At this moment it is more an argue about ability to make logical conclusions using facts provided.
The facts you have are incomplete.
That's why I tried to make it clearer (for you and for everybody else reading).
So I say it again: It is a fact that xcom/openxcom does not keep track of "pain".
Pain Killer do works, right? It restores some morale and do it only once (before another plasma beam hit), right? So game does keep track of Pain Killer usage. Otherwise either Pain Killer would not work completely or it would be possible to restore morale multiple times.
This is correct.
But keeping track of "Pain Killer usage" is NOT the same as keeping track of "Pain".
And even keeping track of "Pain Killer usage" is only indirect (via keeping track of "Morale restored so far").
Yes, this is a problem, but not really big problem. According to formula provided, if a soldier somehow gets healed completely it cannot recover morale with Pain Killer, because info about damage take is lost indeed. And info about pain is lost as well. But in most cases a soldier after healing will still have diminished health. So it would be possible to recover some lost morale (but not all) lost during damage taken. And after that nothing would prevent gaining morale through shooting bad guys, because there is no more pain.
True.
Or in other words: "the game does not keep track of pain" :)
I really don't want to change anything in how right now morale gets retracted or how it gets back after using Pain Killer. I want to change how morale gets added by shooting aliens.
I don't want to change anything either.
I just wanted to make clear that the game doesn't keep track of pain, that's all.
-
And even keeping track of "Pain Killer usage" is only indirect (via keeping track of "Morale restored so far").
If that means that _moraleRestored variable gets altered even when morale goes up by shooting aliens, then I admit that my idea is screwed. But if not, then
Or in other words: "the game does not keep track of pain" :)
In the end it all boils down to definition of a word "pain".
Your definition is "morale, that is substracted by damage".
My definition is "morale, that is added by Pain Killer usage".
Your definition is correct.
My definition is how "pain" is actually tracked by the game.
There is less "pain" in my definition. But there is enough "pain" to make Pain Killer useful if implemented as morale cap. At least for a proof of concept reasons.
-
I tried, but I give up.
Forget I said anything.
-
Sorry about the derailment. Dioxine and I are both still interested in modifying this part of vanilla, so please still consider it.
-
In what exactly way? Best would be some "user story" example how you like to it work.
-
Also, if the requirement is different from Vakrug's, please open a new thread.
(just so that we can mark it later as [DONE] without causing confusion)
-
Also, if the requirement is different from Vakrug's, please open a new thread.
(just so that we can mark it later as [DONE] without causing confusion)
All right, here it is: https://openxcom.org/forum/index.php/topic,10786.0.html
In what exactly way? Best would be some "user story" example how you like to it work.
I hope the new thread sheds some light on this; if not, feel free to ask for clarification (here or on Matrix).