glacier-modding / H3-Unofficial-Community-Patch

Community bug fixes and stuff for Hitman 3
https://www.nexusmods.com/hitman3/mods/784
Other
3 stars 12 forks source link

Freelancer Assassins only randomize from variants 1-4 #47

Open Ocean-Minnow opened 10 months ago

Ocean-Minnow commented 10 months ago

Assassins' appearances seems to have been intended to randomly select from all variants of an outfit, but in practice they will only pick from the variants numbered 1-4 (v0 will also never be picked)

There seems to be existing code in the assassin setup entity (00C5B3F905866B52) to determine the current map by checking the assassins' charset and setting the random number generator's maximum to the appropriate number for that map. ("Randomize Variation" in the previously mentioned entity) However, this never seems to run properly and the generator uses its default maximum of 4.

Simply changing this default maximum does make it possible for more variations to be chosen, but causes the variation with the highest number to be chosen more often on maps with a low number of variations such as Dartmoor and Chongqing. (Bulldog/Rat)

It might be good to also set the minimum to 0 so that that can also be picked.

JojjeE commented 7 months ago

Might be worth looking into EvergreenAssassins in 001A8C2F1645FF10. There's a few interesting keys in there like randomizeVariation being false

Ocean-Minnow commented 7 months ago

It does properly randomize the assassins, it just doesn't pick from the full range it's supposed to. They even re-randomize if you alt+f4. For a while I've been using a mod I made to "fix" this by manually changing the default value myself. Obviously that's way too much of a hack to add here though.

It does genuinely seem to be that the code for figuring out which level is active is just never running, since changing the default in Random_int_ from 4 to 25 then playing in Sapienza will make assassins randomize from all variations. There are also no reverse references for the entities that check the charset.

I don't know what randomizeVariation does exactly. I've tried applying it to other NPCs, but nothing happened.

RDIL commented 7 months ago

Don't quote me on this but if I remember correctly, I think the npc randomized variations are used in the scatter crowd generation.