The following is something I stumbled upon. And I did a few tests on it.
I don't think I'll follow up on this as it doesn't seem overly important. It may hint at a calculation glitch (possibly), but even if, it doesn't seem that relevant, tbh. Still, there may be an engine glitch... see end of notes (i.e. there may be a failing min/max check when calculating HP).
These are my full test notes from start to finish, not a summary.
I used 1.02d US w/ sfall 4.3.6 [edit: and w/o, so it's not sfall] and started a new game w/ Narg.
He has 44 HP=15+ST (9)+(2*EN (10)).
Then I open F12se and adjust his base ST to 100.
Back into game, I open the character screen (causes a recalculation of secondary stats) and Narg has a max HP of 136.
Isn't this wrong?
Even weirder, why does it adjust to 136? Even when it skips the SPECIAL max of 10 it should be 135=15+ST (100)+(2*EN (10))? Why 136?
[edit: (speculation) could be: HP (44)+100-ST (9-1 for Gifted)=136... sounds strange but adds up. Gifted is weird though... but apparently it isn't added to the base stat, see below.]
...
I checked again (same thing, just disabled Gifted).
Then Narg had 41 HP=15+ST (8)+(2*EN (9)) and 133 after editing (i.e. setting base ST to 100).
[edit: could be: HP (41)+100-ST (8)=133.]
...Did a third attempt (non-Gifted again) but this time edited EN to 100, and he ended up with 223 HP.
So Narg had 41 HP=15+ST (8)+(2*EN (9)) and 223 after editing (i.e. setting base EN to 100).
[edit: could be: HP (41)+(2*100)-(2*EN (9))=223.]
...
Btw, when I adjust "bonus" ST etc. it behaves fine, caps at the max of 10 and max HP does not adjust, which is correct (i.e. HP is the one secondary stat that does not adjust with Drugs or Power Armour; aka it does ignore any bonus/extra to ST or EN).
...
Did another clean check:
Took a new character, set LK to 10 and picked the bottom three skills.
Then created 4 saves and set base/bonus of ST & EN to 100.
It all seemed correct (melee, carry weight, HR, poison/rad resistances & skills; all used the max of 10 for SPECIAL). However, HP is (15+ST (5)+(2*EN (5))=30 and changed to:
100STBase: 125 (so +95) --- HP+100-5 (ST)?
100STBonus: 30 (correct; bonus shouldn't influence HP)
100ENBase: 220 (so +190) --- HP+(100*2)-10 (EN*2)?
100ENBonus: 30 (correct; bonus shouldn't influence HP)
...
And another
Took a new character, set LK to 8, ST & EN to 6 and picked the bottom three skills.
Then created 4 saves and set base/bonus of ST & EN to 225.
It all seemed correct (melee, carry weight, HR, poison/rad resistances & skills; all used the max of 10 for SPECIAL). However, HP is (15+ST (6)+(2*EN (6))=33 and changed to:
100STBase: 252 (so +219) --- HP+225-6 (ST)?
100STBonus: 33 (correct; bonus shouldn't influence HP)
100ENBase: 471 (so +438) --- HP+(225*2)-12 (EN*2)?
100ENBonus: 33 (correct; bonus shouldn't influence HP)
...
Makes no sense, really.
Seems as if the engine takes current max HP, adds the new base value (multiplied by 2 in case of EN) and then subtracts the "old" base value from it... Seems strange. Adds up, but I'm not sure this can be right.
Still, why doesn't it just reduce the new base stat (i.e. ST/EN of 100 or 225) to the max of 10? Anything else (melee, carry weight, HR, poison/rad resistances, skills) seems to.
HP is special though (i.e. not influenced by drugs etc.). Maybe there is a glitch in how it's calculated.
Which could be as simple as a max check that is missing or not working correctly (i.e. if above 10, treat as 10), anything else (as said) seems to do that. [Note: even when I save the game, the base continues to be 100 or 225, but all the secondary stats treat it as 10, except HP).]
Could be... maybe it's supposed to be:
HP+(new ST: 225 IF > 10 THEN 10 ELSE 225)-(old ST)
And
HP+(new EN: 225 IF > 10 THEN 10*2 ELSE 225*2)-(old EN*2)
Does that make sense?
Still seems strange, but it would add up.
...
P.S.
The only question mark is Gifted in the first example. Not sure what to make of it. Did a quick test with the same numbers (repetition is crossed out):
Took a new character, set LK to 10 and picked the bottom three skills. THEN I took Gifted, reduced ST & EN [and LK] by one and added it to CH.
Then created 4 saves and set base/bonus of ST & EN to 100.
It all seemed correct (melee, carry weight, HR, poison/rad resistances & skills; all used the max of 10 for SPECIAL). However, HP is (15+ST (4+1)+(2*EN (4+1))=30 and changed to:
100STBase: 126 (so +96) --- HP+100-4 (ST)?
100STBonus: 30 (correct; bonus shouldn't influence HP)
100ENBase: 222 (so +192) --- HP+(100*2)-8 (EN*2)?
100ENBonus: 30 (correct; bonus shouldn't influence HP)
?
Summary (from the two tests above):
100STBase: 125 (so +95) --- 30 HP+100-5 (ST)? : this is Non-Gifted (ST 5 & EN 5)
100STBase: 126 (so +96) --- 30 HP+100-4 (ST)? : this is Gifted (ST 5 & EN 5)
Seems as if Gifted is not added to the base stats, and consequently, gets somehow skipped in all this...? 1 HP more... Which means assuming the above is true:
HP+(new ST: 225 IF > 10 THEN 10 ELSE 225)-(old ST)
And
HP+(new EN: 225 IF > 10 THEN 10*2 ELSE 225*2)-(old EN*2)
it would create a +1 glitch for Gifted. Or it needs to be 9 if Gifted...
HP+(new ST: 225 IF > 10 THEN IF Gifted THEN 9 ELSE 10 ; ELSE 225)-(old ST)
And
HP+(new EN: 225 IF > 10 THEN IF Gifted THEN 9*2 ELSE 10*2 ; ELSE 225*2)-(old EN*2)
...
Next (Same w/ Endurance):
100ENBase: 220 (so +190) --- 30 HP+(100*2)-10 (EN*2)? : this is Non-Gifted (ST 5 & EN 5)
100ENBase: 222 (so +192) --- 30 HP+(100*2)-8 (EN*2)? : this is Gifted (ST 5 & EN 5)
...
Adds up, but...?
Also does it matter? I mean can this ever happen outside using F12se? Maybe if adding to base ST via script...? Uhu... [yep, well, at least it does adjust max HP. Not checked adding an amount that takes it above the max of 10 though. But that should start to glitch... in theory.]
Anything else besides Gifted...? Lifegiver (part of current max HP, I guess)...
How do the other secondary stats handle this? Shouldn't it be enough to check those and then copy & paste whatever they do right (regarding the max of SPECIAL & Gifted), and which HP isn't? Assuming it is a failing max check... should be, though. I mean what else, right?
…
P.S.S.
Did a quick check w/ -100 base values and it also glitched. Did set me to 0 HP (death*) although I should have some HP (even w/ both ST & EN reduced to their minimum of 1). Gifted made no difference (also 0 HP), but that's probably as the total HP was negative and got reset to its minimum of 0. If interested one can experiment with setting a character to -100 base ST or EN and bonus HP to 999 (the max) that seems to create some interesting numbers (in one case I had 930 HP... so it does add/subtract something). Anyway, same as above, adjusting base ST & EN to -100 glitches HP, while the other secondary stats (carry weight, heal rate etc.) handle it fine (get reduced to a value that is based on the minimum of SPECIAL, i.e. carry weight drops to 50 (ST 1) and heal rate to 1 (EN 1), and not to 0 (the actual minimum of carry weight & HR), so they treat -100 ST as ST 1, just as HP should, I think).
*death: this doesn't kill instantly. You need to toggle C [character screen] a bit before it triggers. Note: toggling C triggers a recalculation of secondary stats (HP, carry weight etc.) which then adjusts the HP on the interface, values on the inventory screen and eventually death. Once being set to 0 HP, it also knocks out the script (dude_obj), i.e. looking at myself stops working and also looking at anything else (no display message), bit messy by the nature of 33/0 HP being a peculiar state and the engine adjusting to it gradually). Btw, all tests were made w/ a new character at the Temple of Trial entrance.
Note: Reducing a SPECIAL stat to 0 during radiation sickness is death... but I guess "radiation" is special, while the above is the standard (i.e. things like drugs, script (?) or F12se "accidents" (etc.) can't reduce SPECIAL below its minimum of 1)... I think?
There is probably a lot more one could check (like NPC critters)... but, worth it?
Conclusion: the above assumes that HP fails to take the min/max for SPECIAL into account.
That's it "so far", not as crisp and developed (i.e. normally I sleep over it, sometimes for months, see if I can think of something), but as said I don't think I'll follow up on this [I lied, added a P.S.S.], and my backlog is growing too much. I think I should push stuff out more even if it's not "finished" as in truth it probably never will.
Then,
there's Something (almost) completely different:
Another "detail" [using 1.02d US w/ sfall 4.3.6]:
When I checked a XP gain of -1.000.000 on a critter, it got reset to 0 XP and skipped the "you gain XP" message. Detail but apparently 0 XP (or a negative amount... both tested), skips over it, rather than displaying "You gain 0 XP for killing Bob". I guess that could be fixed (on a slow day...), especially as it seems to skip 0 XP. [i.e. a negative amount would be fringe zone, but setting a proto to 0 XP is almost within the realm of something someone might do.]
And last, one that is a bit more out there (not sure how I feel about it):
"If I give a critter drugs (that change SPECIAL) then save and load, it will remember the change to SPECIAL, but not to the secondary stats." Example; using booze reduces PE from 5 to 4 and Sequence from 10 to 8. When I then save & load, the critter has PE 4 and Sequence 10.
Code:
procedure look_at_p_proc begin
display_msg("I have " + get_critter_stat(self_obj, 1) + " Perception!");
display_msg("I have " + get_critter_stat(self_obj, 13) + " Sequence!");
end
This is similar to a "map_enter", i.e. critters do reset their proto back to default on every map_enter. When doing so the engine does not recalculate secondary stats, but just uses base+bonus (ignoring SPECIAL). The only thing, as far as I can tell, that causes a recalculation of the derived stats (taking SPECIAL into account), is a change to SPECIAL (as, for example, drugs-use does).
However, I'm not sure if messing with this is a good idea.
Although adding a recalculation of secondary stats on loading a game could make sense. At least that shouldn't cause any follow up issues (as SPECIAL already is reduced in the load, it just doesn't reflect on the derived stats).
However, adding the same recalculation to map_enter [which I think the engine actually should also do] would cause compatibility issues with old mods that set up their proto files incorrectly (i.e. editing the base of secondary stats or failing to edit secondary stats after editing SPECIAL). Those mods already are buggy (due to the nature of the faulty proto files), but would become even more unstable in some cases if map_enter would recalculate the base of secondary stats. [i.e. it would overwrite all the "edited" values [example; 999 base HP] with the "correct" ones [example; 34 base HP, according to ST 7 & EN 6.] This is not as concerning during loading a save, as that base HP [example; of 999] is already glitched by the drug-use [
changes to SPECIAL do reset max HP (tested), it just ignores any extra/bonus to SPECIAL]. Then again, loading the save [just as a map enter] would reset the critter back to default [in this case back to the proto's 999 HP]. So...?
Anyway, the current behaviour is that feeding a critter booze, then save & load, will keep PE down (
as well as Skills, as they do get recalculated, probably as they have no base [tested w/ Buffout]*) but not secondary stats like Sequence (those reset).
*
Tbh, I don't know why secondary stats even have a base value. Basically they should function like Skills which are always (SPECIAL + Skill bonus).
Used the following w/ Buffout (should show that skills & ST stay the same after a load, only 11 & 12 reset):
Code:
procedure look_at_p_proc begin
display_msg("I have " + get_critter_stat(self_obj, 0) + " Strength!");
display_msg("I have " + get_critter_stat(self_obj, 7) + " max HP!");
display_msg("I have " + get_critter_stat(self_obj, 11) + " Melee Damage!");
display_msg("I have " + get_critter_stat(self_obj, 12) + " Carry Weight!");
display_msg("I have " + has_skill(self_obj, 3) + " Unarmed!");
display_msg("I have " + has_skill(self_obj, 4) + " Melee Weapon!");
end
P.S. This behaviour does not apply to the dude or Fo2 companions. Only generic critters. And in Fo1 it doesn't even remember the change to SPECIAL (resets both PE & Sequence etc.).
Not sure what can be done about this, or if anything should be done about it...