Author Topic: Incorrectly calculated stats  (Read 2510 times)

Offline Alpha Centauri Bear

  • Colonel
  • ****
  • Posts: 466
    • View Profile
Incorrectly calculated stats
« on: October 23, 2020, 05:09:28 am »
I observed this in vanilla too many years ago. Just curious whether it can be fixed in openxcom. I guess this is the reason my statstrings for this soldier (TU >= 70) doesn't trigger.

You see the TU, energy, reaction bar borders are incorrectly drawn. They are too short. Other stats borders are fine.

Offline Alpha Centauri Bear

  • Colonel
  • ****
  • Posts: 466
    • View Profile
Re: Incorrectly calculated stats
« Reply #1 on: October 23, 2020, 05:54:08 am »
Never mind. These are armor modifiers sticking out.

Then I have another question. I understand border outlines max value. How value possible can get out of max one? Should it be corrected?

Look at the code here.
https://github.com/OpenXcom/OpenXcom/blob/02bac59cb8c83b367d8ae659513c437f4f56b8c9/src/Basescape/SoldierInfoState.cpp#L350
It clearly picks the min of initial and withArmor. Shouldn't max value be an actual max of current and withArmor?

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 8616
    • View Profile
Re: Incorrectly calculated stats
« Reply #2 on: October 23, 2020, 09:38:12 am »
Sorry, I don't understand what you're saying.

Everything looks fine.

Offline Alpha Centauri Bear

  • Colonel
  • ****
  • Posts: 466
    • View Profile
Re: Incorrectly calculated stats
« Reply #3 on: October 23, 2020, 06:12:47 pm »
I am saying the inner bar should not get out of the border.
« Last Edit: October 23, 2020, 06:17:25 pm by Alpha Centauri Bear »

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 8616
    • View Profile
Re: Incorrectly calculated stats
« Reply #4 on: October 23, 2020, 06:27:34 pm »
why not?
that's completely intended and expected.

border outline shows the current stat
the inner bar shows current stat + armor
the alt color of inner bar shows initial stat

if armor adds +10 strength for example, it inner bar will get 10 pixels out of the border...

Offline Alpha Centauri Bear

  • Colonel
  • ****
  • Posts: 466
    • View Profile
Re: Incorrectly calculated stats
« Reply #5 on: October 23, 2020, 07:28:32 pm »
Thank you for explanation. I understand how it is implemented. I am just thinking maybe we can alter it. Inner bar sticking out of border is aesthetically not pleasing. Besides, it overlay the border so the actual border value line for max stat is not visible. Would it be more logical to do it other way around - border for current + armor, while value 1 is for current. Then they won't overlap.

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 8616
    • View Profile
Re: Incorrectly calculated stats
« Reply #6 on: October 23, 2020, 07:32:17 pm »
I don't have any strong opinion on that.

My only concern is to keep it the same way as in OXC.
Other than that, whatever people want...

Offline Alpha Centauri Bear

  • Colonel
  • ****
  • Posts: 466
    • View Profile
Re: Incorrectly calculated stats
« Reply #7 on: October 23, 2020, 11:51:54 pm »
Isn't it the thread for both OCX and OCXE? Whom to bother from OCX for that?