thepeacockproject / Peacock

The Peacock Project is a HITMAN™ World of Assassination trilogy server replacement.
https://thepeacockproject.org
GNU Affero General Public License v3.0
387 stars 60 forks source link

Sniper Assassin mode bug: Upgrading to mastery level 20 is faulty #392

Closed MisterFloppy closed 7 months ago

MisterFloppy commented 8 months ago

While leveling mastery up the "Himmelstein" mission in Sniper Assassin mode until level 19 does work properly, upgrading to mastery level 20 is faulty: After completing Mastery Level 19 the game shows the needed minimum of XP to reach Level 20, but as soon as you earn them, the Mastery level reverts to Level 1, starts to show "negative" XP values and locks your weapon upgrades again!

To reproduce this issue, you have to be on Mastery level 19, which can be a hard work: With the help of some useful hints and videos you can improve your Mastery level very quickly, see here for example: https://www.reddit.com/r/HiTMAN/comments/8py306/hitman_sniper_assassin_quick_xpmastery_farming/

AnthonyFuller commented 8 months ago

Thanks for the report, I'll look into it when I get time. We can set our level, so no need to farm.

MisterFloppy commented 8 months ago

Could you please have a look into the two other missions in Sniper Assassin mode, too? I assume they have the same bug.

RDIL commented 8 months ago

It's almost certainly a bug in the underlying system that handles sniper scoring and progression, so it will be fixed on all maps at once.

RDIL commented 8 months ago

Did you do all the mastery (1-20) on the alpha build of Peacock? If it was only partially done on the new version, it could be https://github.com/thepeacockproject/Peacock/commit/79ecf6257bb5f43a91ff40d7ad7b583f920cdc24 / https://github.com/thepeacockproject/Peacock/commit/7780d4fc89839b9a283d69b659708bf29873eab9 that caused it.

AnthonyFuller commented 8 months ago

Ding ding ding. That's probably it.

MisterFloppy commented 8 months ago

As you have released v7.0.0-alpha.3 in the meantime, I decided to test the matter again from scratch:

Firstly, I deleted my json file in the folder "\Peacock\userdata\users\" to get a "fresh" new save game for the new Peacock version. After that I started to level up the Mastery level in the "Himmelstein" mission step by step from Level 1 to Level 19 without any problems. But with trying to upgrade to Level 20 the bugs mentioned above appeared again.

I looked in the json file and found the following entries:

"LOCATION_PARENT_AUSTRIA":{"FIREARMS_SC_HERO_SNIPER_HM":{"Xp":70000000,"Level":1,"PreviouslySeenXp":70000000}

{"Location":"LOCATION_PARENT_AUSTRIA","Xp":70228803,"ActionXp":3585}

So I guess there is something wrong with the maximum score in the one entry not going over 70000000 XP, while the second entry does so.

Yanrishatum commented 7 months ago

The bug was due to faulty logic in calculating xp required for the level that only happened on max level, and applied both to Freelancer and Sniper modes as contrary to other maps their leveling is not based on a formula but instead on hardcoded values.

In save file: the first value being clamped at maximum is intended, as it dictates your mastery level, while another tracks your general gained challenge XP on that map, which goes beyond maximum mastery (and can be seen in your statistics).

With the fix in place you should be able to regain the maximum level properly by just finishing the map once. Or by editing "Level" field in the save. (For Freelancer you also need to edit "EvergreenLevel" field)