aliens

Author Topic: [Suggestion] Display missing health/mana in SoldierInfo screen.  (Read 1953 times)

Offline MaxMahem

  • Captain
  • ***
  • Posts: 60
    • View Profile
Another small one while you're chewing on the last bigger one: a way to display the health/mana a soldier is missing while recovering in the Soldier Info screen. Currently, this information is tracked, but not presented to the player in any concrete way beyond the return to service countdown. I am envisioning displaying this by having a 3rd segment of the stat bar that proceeded from the right end towards the left, to visualize the missing health.

While admittedly, the utility of this information is low, I think it would be a neat "nice to have" feature. And in addition, the features I would have to build to support this, likely an extension of the bar class to support this 3rd bar could be useful elsewhere, such as the alternate take on painkillers discussed elsewhere that appeared interesting to me.

Open questions with this enhancement would be: Should the number displayed for health/mana reflect this figure? It seems like it should, though you are somewhat inaccurate information. But, OTOH, the numbers already reflect modifications due to armor, and the utility of knowing the "true" health score of a wounded soldier seem somewhat limited.

Offline MaxMahem

  • Captain
  • ***
  • Posts: 60
    • View Profile
Re: [Suggestion] Display missing health/mana in SoldierInfo screen.
« Reply #1 on: March 03, 2023, 05:54:02 pm »
Quick demo of this concept:


I'm not sure I love it though. To do this I sub-classed the Bar class into a BarR class that can handle drawing a reverse bar, which works but is kind of clunky. I could instead just modify the bar class to give all instances this functionality, or just do it manually (though getting the draw code mixed in with the other code is kind of gross). Will also need to find a way to specify the color for this "reverse" segment of the bar. Adding a color3 tag to the rules would work, but feels kind of clunky as well.

An alternative way of displaying this might be not to overlap the entire bar, and instead only cover maybe the bottom half.
« Last Edit: March 03, 2023, 06:28:28 pm by Meridian »

Offline DoxaLogos (JG)

  • Colonel
  • ****
  • Posts: 358
  • Squaddie cautiously peering through the breach
    • View Profile
Re: [Suggestion] Display missing health/mana in SoldierInfo screen.
« Reply #2 on: March 03, 2023, 06:22:20 pm »
This could have more applications than just checking current health in recovery.  I could see an up to date display of the soldier's status during a battle like affected stats from from various battle conditions reflected on this screen as well with the "reverse" bars.

Offline MaxMahem

  • Captain
  • ***
  • Posts: 60
    • View Profile
Re: [Suggestion] Display missing health/mana in SoldierInfo screen.
« Reply #3 on: March 03, 2023, 06:26:43 pm »
This could have more applications than just checking current health in recovery.  I could see an up to date display of the soldier's status during a battle like affected stats from from various battle conditions reflected on this screen as well with the "reverse" bars.

Indeed, part of the motivation was to build the graphic asset so that it could be reused elsewhere (though I believe the infoscreen in the battlescape does consider various negative effects).

Offline MaxMahem

  • Captain
  • ***
  • Posts: 60
    • View Profile
Re: [Suggestion] Display missing health/mana in SoldierInfo screen.
« Reply #4 on: March 04, 2023, 05:30:03 am »
Alas, after some work I came to the conclusion that sometimes the simplest solutions are the best, and to just show these stats by simply subtracting them from the "withArmor" stat (which is your "current" stat, with all its bonuses and penalties, ie, your effective stat). This is easy to then reflect in the number and the missing health shows up as missing space in the bar.

The old code for this feature remains in this commit. I'll hold off on submitting a pull for this new feature until you've taken in the last stat-info screen with whatever changes you apply, as this is dependent on this one. The new concept can be seen at the head of that branch (and is trivial). Honestly, it might still need some more thought. For soldiers with stats much above their original max, the effect isn't very apparent (maybe a partially empty bar inside there to display it?)

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 8974
    • View Profile
Re: [Suggestion] Display missing health/mana in SoldierInfo screen.
« Reply #5 on: March 04, 2023, 11:34:11 am »
Another small one while you're chewing on the last bigger one: a way to display the health/mana a soldier is missing while recovering in the Soldier Info screen. Currently, this information is tracked, but not presented to the player in any concrete way beyond the return to service countdown. I am envisioning displaying this by having a 3rd segment of the stat bar that proceeded from the right end towards the left, to visualize the missing health.

Health missing is not tracked by OXC.

It can be tracked by OXCE: https://openxcom.org/forum/index.php/topic,8020.0.html
But right now, there is not a single mod using this option.

Presenting the return to service countdown, a.k.a. recovery time (which is not equal to health missing, numerically nor semantically) is also not a good idea since the recovery time can be higher than max health. So we would either display a negative value (ugly) or zero (lying). Plus it would create a lot more confusion than it would solve (98% of players are not aware that recovery time is not equal to health lost).

Mana missing is used, but it suffers similar issues.
For example mana missing can be double the amount of max mana pool.
So again negative values...

While admittedly, the utility of this information is low, I think it would be a neat "nice to have" feature. And in addition, the features I would have to build to support this, likely an extension of the bar class to support this 3rd bar could be useful elsewhere, such as the alternate take on painkillers discussed elsewhere that appeared interesting to me.

Currently the utility is zero for missing health.

For missing mana, it's low.
If we would need to expose the raw values somewhere (and I don't think we do), I'd propose to do it on the Soldier List GUI, using the sort function (i.e. add 2 new sort criteria).

Open questions with this enhancement would be: Should the number displayed for health/mana reflect this figure? It seems like it should, though you are somewhat inaccurate information. But, OTOH, the numbers already reflect modifications due to armor, and the utility of knowing the "true" health score of a wounded soldier seem somewhat limited.

No, this screen shows the "max" values.

Same way we don't show "current energy" but "stamina = max energy"; not showing "current mana" but "mana pool = max mana"; not showing current TUs; not showing current morale, not showing current health or stun level.

I'd like to keep it that way.