ESOUI

ESOUI (https://www.esoui.com/forums/index.php)
-   Tutorials & Other Helpful Info (https://www.esoui.com/forums/forumdisplay.php?f=172)
-   -   ZOS Achievement Progress Calculation for Multicriteria Achievements (https://www.esoui.com/forums/showthread.php?t=9125)

remosito 05/01/20 10:42 AM

ZOS Achievement Progress Calculation for Multicriteria Achievements
 
Howdie all,

not sure if the right place, but just wanted to deposit this somewhere so google can pick it up. And if ever somebody else needs to figure out how ZOS calculates these insane looking values for achievementwide progress on multi-criteria achievements. Said person won't have to slam hisher head against the wall for a few hours.

Am talking about Achievements like Nature/Undead Slayer.

Examples:
UndeadSlayer 1000/1000 1000/1000 768/1000 500/500 -> progress value = 537677243368
HumanoidSlayer 1000/1000 500/500 87/100 -> progress value = 46126056

From GetAchievementProgressFromLinkData(self.achievementId, self.progress) which returns an list with progress per criteria it is clear that it is even reversible. But I didn't find the inverse function of given the progress on all the criteriums would return the achievement wide progress value.


The obvious way to do it would be to consider it some weird ass Numberscheme where each part can be multidigit and base changes from part to part based on numberrequired. Each part being the different criteria. Either ascending or descending. Just looking at the numbre makes it clear. Aint the case here. Base of 500 1000 and 100 would have resulted in plenty more 0 in there.

Well the idea ZOS would do it that way was not far off. But instead of using the numrequired values of each criterium as the base of that digit. They actually round it up to the next power of 2 number.

numrequired -> actual base used for calculations:
25->32
50->64
100 -> 128
200 -> 256
500 -> 512
1000 -> 1024

Tall papa knows why....my gut thinks might be dark arts of bitshifting related ...

To apply this to the examples:
HumanoidSlayer 1000/1000 500/500 87/100 -> progress value = 46126056

The bases are 1024 512 (128)
And the calculation is 1000 + 500*1024 + 87*512*1024 which indeed gives 46126056

UndeadSlayer 1000/1000 1000/1000 768/1000 500/500 -> progress value = 537677243368

The bases are 1024 1024 1024 (512)
1000 + 1000*1024 + 768*1024*1024 + 500*1024*1024*1024 = 537677243368

NatureSlayer:
500/500 500/500 481/500 200/200 100/100 452/500 50/64 -> progress value 114581370651011572

The bases are 512 512 512 256 128 512 (64)
500 + 500*512 + 481*512*512 + 200*512*512*512 + 100*512*512*512*256 + 452*512*512*512*256*128 + 50*512*512*512*256*128*512 = 114581370651011572


maybe this wil provide useful one day to somebody :-)

cheers

Baertram 05/01/20 11:34 AM

Thanks for the info.

Quote:

25->32
50->64
100 -> 128
200 -> 256
500 -> 512
1000 -> 1024
These values at the right are all base 2 values, like 2^10 = 1024.

remosito 05/01/20 02:39 PM

Quote:

Originally Posted by Baertram (Post 41025)
Thanks for the info.


These values at the right are all base 2 values, like 2^10 = 1024.

Indeed, that's what I meant with

> They actually round it up to the next power of 2 number.

Baertram 05/02/20 08:31 AM

Whoops, have skipped this as I read your text ;)

If you want to, you could add this info to the esoui wiki:
https://wiki.esoui.com/Main_Page

Either at the left below the "Data" section add an "Achievement" section and add this as subpoint "Calculation of progress", or at the right side below "More" maybe.


All times are GMT -6. The time now is 07:07 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI