Leanny / leanny.github.io

156 stars 38 forks source link

Feature request #163

Closed miku1958 closed 2 years ago

miku1958 commented 2 years ago

Is it possible to add a feature to "Gear Seed Recovery" to reverse the seed by clearing the skill and refreshing it with drink? For example, if I have three known skills and three refreshed skills, I can recover about 30 seeds, then I clear all the skills and refresh the fourth skill with a drink to get the real seeds.

I tried to write a APP myself but it looks like the algorithms are in gearSeed.wasm, and I'm not very familiar with disassembly or wasm....

Leanny commented 2 years ago

Lets see if I understand you correctly:

  1. You want to do a normal search first and reduce the number of seeds
  2. Then you want to start a search with "possible seeds" and then it only checks your new input against the possible seeds

Do I understand this correctly?

About the APP: On the page is a page "technical write-up" that should have all information you need. If you have any questions, feel free to let me know

miku1958 commented 2 years ago

Yes, secondary search with possible seeds

To be more specific:

  1. I first use the existing 4 skills to calculate 100 possible seeds
  2. I add the 3 predicted skills to find 30 possible seeds, and filter out the seeds that don't match the first step, assuming there are 30 seeds left in the first step
  3. Wash all the skills directly, then drink and go to the battle to get new skills, then see which one is compatible from the 30 seeds in the first step, one by one.

This is theoretically possible, right, but the workload is really too much for human.

For the page "technical write-up", I can't find the detail of "get_ability_weight", "get_branded_ability_with_drink" and "max_brand_num_drink"

Leanny commented 2 years ago

Thank you for the suggestion! I will add the refine button in a future update.

About the missing details: They are described in text form. Here is some pseudocode for them that can help you to understand what the methods might be doing. Brand is something generated from this here https://github.com/Leanny/leanny.github.io/blob/master/splat3/data/parameter/111/misc/spl__BrandTraitsParam.spl__BrandTraitsParam.json: Drink is just the ability name:

uint32_t max_brand_num(Brand brand) {
    if(brand.isNeutral()) return 28;
    return 35;
}

uint32_t max_brand_num_drink(Brand brand, uint32_t drink) {
    if(brand.isNeutral()) return 26;
    if(brand.UnusualGearSkill == drink) return 34;
    if(brand.UsualGearSkill == drink) return 25;
    return 33;
}

uint32_t get_ability_weight(Brand brand, uint32_t ability_index) { // you can use this to generate the map that is used in the write-up. ability_index is defined by the ability order at the bottom of the write-up
    if(brand.UnusualGearSkill == ability_index) return 1;
    if(brand.UsualGearSkill == ability_index) return 10;
    return 2;
}

uint32_t get_branded_ability_with_drink(Brand brand, uint32_t ability_index, uint32_t drink) { // you can use this to generate the map that is used in the write-up. ability_index is defined by the ability order at the bottom of the write-up
    if(ability_index == drink) return 0;
    if(brand.UnusualGearSkill == ability_index) return 1;
    if(brand.UsualGearSkill == ability_index) return 10;
    return 2;
}
Leanny commented 2 years ago

Added with latest update. Thank you for the feedback!

miku1958 commented 2 years ago

Thanks! Could you explain how to use the refine feature?

Leanny commented 2 years ago

Sure! (I should probably add this info to the webpage as well...) First you look for some seeds. If your abilities result in something between 2 and 10000 seeds, then the "refine" button is unlocked. After that it only uses the seeds it has in memory for the search.

Maybe I should make this configurable for the end user, so they can pick a value suited for their browser (i.e. on a PC you can easily do 1 million seeds, while on a phone it heavily depends on your phone)

miku1958 commented 2 years ago

Ok,let me reconfirm that refine will use the seeds in memory to count a new batch of seeds directly, and will this new batch of seeds be used to overwrite the seeds in memory, or will it just be used to filter the original batch of seeds?

miku1958 commented 2 years ago

And I have a quick test

  1. I first use the existing 4 skills to calculate 100 possible seeds
  2. I add the 3 predicted skills, but the refine button is disable <- Not sure if I got it right
Leanny commented 2 years ago

it will overwrite the seeds in memory then. For example: grafik

Here I have 7 slots filled and calculated it once. The refine button is unlocked now, which means that I have less than 10k possible seeds. Now I fill 8th slot and click "refine". It gives me a result immediately grafik

miku1958 commented 2 years ago

I think we have different ideas. I'd like to count new seeds over and over to filter and keep the old existing seeds, so I can save some time, money and snails to figure out which seed is for my gear

Leanny commented 2 years ago

grafik So like this? You get 1, 2, 3 via reroll, reset the game, use a drink and then get 4, 5, 6?

miku1958 commented 2 years ago
image
  1. I have 4 existing skills a.1, b.1 and c.1, this step can search for a large number of seeds, name it as s.1.
  2. I use snail to predict the 3 new skills but not save the game, this step can create new seeds(s.2) from s.1, s.2 can be used to filter s.1, and get s.3 from s.1 s.3 is a subset of s.1 s.3 is not the subset of s.3
  3. Wash all the skills directly, then drink and go to the battle to get new skills a.3 , then filter s.3 with a.3 to get a new s.4, s.4 is a subset of s.3
  4. Repeat 3 and 2, until there is only one seed in s.x

By doing this, firstly I don't need to spend any 🐚, and secondly with any luck, the a.3 step will locate the seed

miku1958 commented 2 years ago

Your code are getting BrandData brand_data from get_ability_weight(brand) and getting ability_roll from brand_data[ability].weight, but get_ability_weight(brand) return a UInt32 variable?

And what is the detail of brand.isNeutral()?

Leanny commented 2 years ago

Ah, I understand now. I need to think about how to support this!

The code is just pseudo-code, so it is not working 100% and should only give you an idea about how things work. brand.isNeutral() is true when brand has no usual/unusual ability (for example brand b99 - amiibo) grafik

Someone made a rust version for this algorithm, so maybe this can help you to understand it better https://github.com/Starwort/ability-miner/tree/master/src

Leanny commented 2 years ago

I have an update about your initial issue: I added the option to define a Refine Count (the higher the count, the more results it stores). This allows the following in an early stage:

grafik

When I do this, I get a certain number of possible seeds and "Refine Seed" is enabled. Now I can use drinks instead: grafik

So basically I can remove the old slots and replace them with drink abilities. As long as I use "Refine Seed", I will only use the stores seeds.

Is this what you were looking for?

(This will be available with the next update)