Set bonus lost when shields are in non-active weapon slot.

Talk about anything related to Legend of Grimrock 2 here.
User avatar
Dr.Disaster
Posts: 2876
Joined: Wed Aug 15, 2012 11:48 am

Re: Set bonus lost when shields are in non-active weapon slo

Post by Dr.Disaster »

badhabit wrote:What do you talking about? Petri is considering changing the game mechanic, if he would do it according to model B:
B) Adjust health / energy as percentage. E.g. if character is at full health and completes the armor set, the character would still be at full health (which is now higher). Same with unequipping. Downside: More complex to implement.

...even the Ancient Shield would work and would not result in suicide when rounded reasonable, e.g. MaxHP=100, HP=100, %HP=100%, equip ancient shield: MaxHP=85, HP=85, %HP=100%, unequip Ancient Shield: MaxHP=100, HP=100, %HP=100%; Another case: MaxHP=100, HP=10, %HP=10%, equip ancient shield: MaxHP=85, HP=9 (rounded up to full points, internally not rounded but double), %HP=10%, unequip Ancient Shield: MaxHP=100, HP=10, %HP=10%;
Current behavior in your wording with my numbers (see post above):
MaxHP 100, HP 1 -> Equip Ancient Shield -> Max HP 85, HP=1

Proposed behavior in your wording with my numbers:
MaxHP 100, HP 1, %HP=1% -> Equip Ancient Shield -> Max HP 85, HP=0 =>> Character went suicide!

(xx% of any number above 0 rounded up is 1)
badhabit
Posts: 467
Joined: Sat May 05, 2012 2:24 pm

Re: Set bonus lost when shields are in non-active weapon slo

Post by badhabit »

Dr.Disaster wrote:
badhabit wrote:What do you talking about? Petri is considering changing the game mechanic, if he would do it according to model B:
B) Adjust health / energy as percentage. E.g. if character is at full health and completes the armor set, the character would still be at full health (which is now higher). Same with unequipping. Downside: More complex to implement.

...even the Ancient Shield would work and would not result in suicide when rounded reasonable, e.g. MaxHP=100, HP=100, %HP=100%, equip ancient shield: MaxHP=85, HP=85, %HP=100%, unequip Ancient Shield: MaxHP=100, HP=100, %HP=100%; Another case: MaxHP=100, HP=10, %HP=10%, equip ancient shield: MaxHP=85, HP=9 (rounded up to full points, internally not rounded but double), %HP=10%, unequip Ancient Shield: MaxHP=100, HP=10, %HP=10%;
Current behavior in your wording with my numbers (see post above):
MaxHP 100, HP 1 -> Equip Ancient Shield -> Max HP 85, HP=1

Proposed behavior in your wording with my numbers:
MaxHP 100, HP 1, %HP=1% -> Equip Ancient Shield -> Max HP 85, HP=0 =>> Character went suicide!

(xx% of any number above 0 rounded up is 1)
No, as I said, reasonable rounded:
MaxHP 100, HP 1, %HP=1%
Equip Ancient Shield -> Max HP 85, HP=1%*85=0.85 double => round up to HP=1
unequip Ancient Shield -> Max HP 100, HP=1.
User avatar
Dr.Disaster
Posts: 2876
Joined: Wed Aug 15, 2012 11:48 am

Re: Set bonus lost when shields are in non-active weapon slo

Post by Dr.Disaster »

badhabit wrote:No, as I said, reasonable rounded:
MaxHP 100, HP 1, %HP=1%
Equip Ancient Shield -> Max HP 85, HP=1%*85=0.85 double => round up to HP=1
Even then your "round up to HP=1" kills your character since HP 1 before equip minus 1 (rounded as you showed by equip) is still 0.
You only calculated the HP lost and did not substract it from the current stat.
badhabit
Posts: 467
Joined: Sat May 05, 2012 2:24 pm

Re: Set bonus lost when shields are in non-active weapon slo

Post by badhabit »

Dr.Disaster wrote:
badhabit wrote:No, as I said, reasonable rounded:
MaxHP 100, HP 1, %HP=1%
Equip Ancient Shield -> Max HP 85, HP=1%*85=0.85 double => round up to HP=1
Even then your "round up to HP=1" kills your character since HP 1 before equip minus 1 (rounded as you showed by equip) is still 0.
You only calculated the HP lost and did not substract it from the current stat.
There is no -1, there is just a percentual scaling with a round up end step ("ceil"). I calculated directly the current HP, not the difference.
Last edited by badhabit on Mon Oct 27, 2014 1:11 am, edited 1 time in total.
User avatar
Dr.Disaster
Posts: 2876
Joined: Wed Aug 15, 2012 11:48 am

Re: Set bonus lost when shields are in non-active weapon slo

Post by Dr.Disaster »

Ah i see your method now

This works as long as your %HP is known before your actual HP. Try a real game situation:

MaxHP: 70 HP:40 -> %H=57.14
-> Equip Ancient Shield
MaxHP: 55 HP:40 - to-be-calculate-value -> %H=unknown
badhabit
Posts: 467
Joined: Sat May 05, 2012 2:24 pm

Re: Set bonus lost when shields are in non-active weapon slo

Post by badhabit »

Dr.Disaster wrote:Ah i see your method now

This works as long as your %HP is known before your actual HP. Try a real game situation:

MaxHP: 70 HP:40 -> %H=57.14
-> Equip Ancient Shield
MaxHP: 55 HP:40 - to-be-calculate-value -> %H=unknown
This is known ?!
CurrentHP/maxHP=%H (double)
ceil(maxhp*%H) =currentHP

equip: 55 * 0.5714 = 31.427 (internal stored as double value) -> current HP 32
unequip: 70 * (31.427/55)=39.98 -> current 40HP
Rithrin
Posts: 79
Joined: Sat Oct 25, 2014 12:03 am

Re: Set bonus lost when shields are in non-active weapon slo

Post by Rithrin »

petri wrote:Two potential fixes we're considering are:

A) Remove shield from crystal armor set. Crystal shield would still exist, but it would not be needed to complete the armor set.

B) Adjust health / energy as percentage. E.g. if character is at full health and completes the armor set, the character would still be at full health (which is now higher). Same with unequipping. Downside: More complex to implement.

btw. there is no "accidental suicide" chance with current implementation -- only max health is affected.
Thank you, petri, and the rest of AH for being responsive to community feedback. it is excellent to see.

If you feel you have the time to implement a more complex feature, B would probably be the best way, as it addresses more than just the Crystal set. Players won't be so hesitant to utilize their wizards' alternate weapon sets, either.
User avatar
LastFootnote
Posts: 36
Joined: Mon Apr 09, 2012 8:20 pm

Re: Set bonus lost when shields are in non-active weapon slo

Post by LastFootnote »

Another vote here for Option B. As long as the adjustment always rounds down except when that would result in 0 HP, I think it will work great.

newCurrentHP = max(1, floor(oldCurrentHP * (newMaxHP/oldMaxHP)));
badhabit
Posts: 467
Joined: Sat May 05, 2012 2:24 pm

Re: Set bonus lost when shields are in non-active weapon slo

Post by badhabit »

LastFootnote wrote:Another vote here for Option B. As long as the adjustment always rounds down except when that would result in 0 HP, I think it will work great.

newCurrentHP = max(1, floor(oldCurrentHP * (newMaxHP/oldMaxHP)));
another matlab programmer? ;)
Nice, the complete formulation.
Post Reply