After I posted this I did do some tests in fot, inferred how the bandaged state was working and noticed that around 50% of the time the healing values were double for first aid (that would probably be the critical success, but seems a bit often, I will implement it on my end and report back).
This would be caused by the bug I mentioned. In a case where the uninitialized memory is pseudo-random, I'd expect around a 50/50 distribution of critical vs. non-critical outcomes.
During testing I've gotten quite a few critical fails injuring limbs without having any of the two traits on (Stitch)
Same here.
I'm likely going to add a fix in FTSE for the bug, but I'm not sure yet if I'll enable it by default. It's clear what the code is trying to do, and the intended effects make sense. But whatever (likely minimal) testing and balancing that was done for the game would have been done with the bug in place, so I don't know the degree to which fixing it will affect gameplay. At a minimum, likely effects would be: failed heals rarely have any impact other than wasting a use of the first aid kits, successful heals restore less HP, and trap disarm failures being much less deadly (though the extremely high difficulty traps would still critically fail often due to the secondary critical fail condition - e.g. the mines in the St. Louis base).
For the values to fall within the ranges that I've recorded it would seem that at least the first aid kit does not actually add any skill effect on first aid (wondering if the field medic kit does) so that is strange as it is usally advertised in wikis that it adds 20% (even if no such effect is present in the entity editor for it).
This is correct - I didn't see any specific increase from the regular first aid kit. The field medic kit does have a skill bonus of 20 for First Aid in the entity, so that would be applied at equip time. It's possible that whoever wrote the entry for the wiki was confused by the 1.2x multiplier coming from Heal Rate.
Any ideas on the formula used to grant xp on successful lockpick, science, trap disarm? And chance to find a trap?
For First Aid: XP is the amount healed, clamped between the values [15,150].
For Doctor: +15 XP if target was unconscious and woken up, +15 XP per recovered injury, and the same increase as First Aid for heal amount. On a critical heal, use +30 XP instead of the heal amount.
For Repair: Repair of robot is same as Doctor, repair of vehicle uses the amount of HP repaired clamped to [15,150], and repair of an item appears to use (RepairSkill - RepairDifficulty).
For Lockpick: Locking a door or container is always 15 XP. Unlocking gives XP based on the "Chance to Unlock" value in the editor, clamped between [15,150].
For Science: Gives XP equal to "Difficulty" in the entity/editor, clamped between [15,150].
For Traps: Disarming a trap gives XP equal to the sum of "Difficulty" and "Skill Roll" of the trap, clamped between [15,150].
Trap detection appears to work somewhat like sneak detection - the game calculates a range at which the character would be able to see the trap at its next think timer expiration. The distance where the mine can be seen is (Perception + MIN(0,(TrapsSkill - TotalDifficulty)/5)), where TotalDifficulty is the sum of the "Difficulty" and "Skill Roll" values. Note that the distance measurement is from edges of each bounding box, not the center point of the entities. Given the formula only applies the second value if difficulty is higher than skill, the maximum detection distance is the character's PE, and detection is impossible if the difficulty exceeds skill by 5*PE.
I have tried a few times to poke thru the BOS.exe using Binary Ninja, even found the first aid skill use function, attached to the game, hit the breakpoint but then I was completely lost on how to interpret any of it, so I have no idea how you people actually do it, seems like black magic
Actually, getting that far is pretty impressive - I was barely able to do more than that when I first started the Team Player hex fix that led to FTSE. It's more a matter of perseverance - walking through code with the debugger, finding what certain values in memory represent in the game, then going back to the static analysis (Binary Ninja or Ghidra) and plugging in the info you found. As you do this, the info the static analysis gives you is much more readable. So you can go from raw assembly code:
LAB_005ce341 XREF[1]: 005ce32d(j)
005ce341 8b 16 MOV EDX,dword ptr [ESI]
005ce343 8b ce MOV ECX,ESI
005ce345 ff 92 7c CALL dword ptr [EDX + 0x57c]
05 00 00
005ce34b 8b a8 f1 MOV EBP,dword ptr [EAX + 0xf1]
00 00 00
005ce351 8b 97 50 MOV EDX,dword ptr [EDI + 0x850]
08 00 00
005ce357 8b 8f 30 MOV ECX,dword ptr [EDI + 0x830]
08 00 00
005ce35d 05 c1 00 ADD EAX,0xc1
00 00
005ce362 2b ea SUB EBP,EDX
005ce364 2b e9 SUB EBP,ECX
005ce366 3b eb CMP EBP,EBX
005ce368 7e 02 JLE LAB_005ce36c
005ce36a 33 ed XOR EBP,EBP
LAB_005ce36c XREF[1]: 005ce368(j)
005ce36c 8b 06 MOV EAX,dword ptr [ESI]
005ce36e 8b ce MOV ECX,ESI
005ce370 ff 90 7c CALL dword ptr [EAX + 0x57c]
05 00 00
005ce376 8b c8 MOV ECX,EAX
005ce378 b8 67 66 MOV EAX,0x66666667
66 66
005ce37d f7 ed IMUL EBP
To something considerably more readable:
pAVar7 = (*pEVar13->entity_vtable->GetCurrentStats)(pEVar13);
skill_minus_difficulty = ((pAVar7->skills).traps - this->difficulty) - this->skillroll;
if (0 < skill_minus_difficulty) {
skill_minus_difficulty = 0;
}
pAVar7 = (*pEVar13->entity_vtable->GetCurrentStats)(pEVar13);
total_ability = (float)((pAVar7->stats).perception + skill_minus_difficulty / 5);
sighting_distance = (float)(int)total_ability;
if (sighting_distance < 0.0) {
sighting_distance = 0.0;
}
if ((float)dist_minus_bounding_box < sighting_distance * sighting_distance) {
dist_minus_bounding_box = &stack0xffffff44;
cVar4 = FUN_00553790();
if (cVar4 != '\0') {
this->hidden = false;
If you ever want to give it another try at some point, let me know - I can try to set you up with a copy of my Ghidra project, with the info I've collected so far. There's an archive of the Ghidra project in the FTSE GitHub under the Technical Docs section, but it's not up to date.
If I even have any questions regarding the mechanics of FoT would you be open to get comissioned to look into them (get paid)? I'm not rich in any sense but it would be a small price to pay for having a true professional have my back when the mechanics get really murky.
Nah, that's not necessary - I've always done this for fun as a hobby. Plus, my time is still pretty limited, so I'd hate to have someone dependent on my finding time to research/reverse. (That said, if the developer came to me and said "We lost the source code and want to do a remake, can you fully reverse engineer and make a reference implementation", and offered me a retirement-level sum of money .. Hey, one can dream, right?

)