Quantcast
ZOS Achievement Progress Calculation for Multicriteria Achievements - ESOUI
 
Thread Tools Display Modes
05/01/20, 10:42 AM   #1
remosito
AddOn Author - Click to view addons
Join Date: Dec 2019
Posts: 20
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

Last edited by remosito : 05/01/20 at 10:57 AM.
  Reply With Quote
05/01/20, 11:34 AM   #2
Baertram
 
Baertram's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 3,088
Thanks for the info.

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.
  Reply With Quote
05/01/20, 02:39 PM   #3
remosito
AddOn Author - Click to view addons
Join Date: Dec 2019
Posts: 20
Originally Posted by Baertram View Post
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.
  Reply With Quote
05/02/20, 08:31 AM   #4
Baertram
 
Baertram's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 3,088
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.
  Reply With Quote

ESOUI » Developer Discussions » Tutorials & Other Helpful Info » ZOS Achievement Progress Calculation for Multicriteria Achievements

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off