Wearable Sets calculation in Rarity Farming

As RF season 4 has been proposed, it’s time to bring this up again.

There is currently a bug with the calculation of Wearable Sets for rarity farming, when there are multiple sets to choose from. This is inconsistent and has actually varied across different RF seasons/rounds.

I discovered this while building the Rarity Farming pages on my site, because I only had the final rankings to work with, so had to retrospectively calculate their rarities at the time of the round snapshot. After doing this, my calculated rankings didn’t match up with the rewards that were actually distributed.

I posted about this back in March in the discord (aarchitects channel) and messaged coderdan, but naturally since the launch of the gotchiverse it’s been low priority :slight_smile:

The core problem is that the wearable set and final rarity score displayed for your gotchi on its main page can be different to that used for the RF ranking.

This has mainly affected Sushi Chefs, Aagents, and also the Godlike/Apex sets - so it actually changed some top 10 rankings.

Here’s an example with Winklevoss (8845):

image

In the leaderboard, Winklevoss gets a suboptimal set assigned and is 906 rather than 907.
In Rarity Farming Season 2 round 4, this made him lose out on a tie, and should have been #3 not #4

You can see the different calculations for all of Seasons 2 and 3 on Aadventure.io - in “Advanced table config” check the option “(devs) Display alternate Rarity Scores for Wearable Set debugging”.

You’ll then see extra columns in the ranking table showing

  1. the actual RF ranking used for awarding prizes
  2. the data in the subgraph (which is usually very wrong)
  3. the ‘best’ score, which is also usually closest to what gets displayed on your gotchi page on the main site.

Some more examples:




Main findings:

  • The Rarity Farming Leaderboard, Aavegotchi website, and subgraph all use different approaches to find the equipped wearable set. This does have different results in some cases, including different final Rarity Score.

  • For the leaderboard, this affects Master Sushi Chefs and some Aagents, who are ranked lower (worse) than they should be. It also affects some high ranking gotchis where the Godlike set is picked over the better Apex set.

  • Important for community devs to know: the subgraph’s equippedSetID and withSetsRarityScore should NOT be used: as well as the differences in calculations, it is also missing or out-of-date for many gotchis.

  • (extra bug) The onchain wearable sets aren’t up-to-date with the latest fixes. The subgraph uses these, which is why it doesn’t detect the Long Distance Runner set correctly (water/wine mixup).

  • (extra bug) Sets with two of the same hand item (Gunslinger) are NOT being strictly checked anywhere. The code will pick the set even if the gotchi only has one hand item equipped.

Key actions needed:

  • Define and publish the algorithm for picking the best wearable set. This needs to have multiple levels of tiebreaker, with a final fallback that is guaranteed to produce a consistent order. (E.g. it is not enough to say ‘order alphabetically’, because there are multiple sets that have the same name.)
  • Implement this algorithm for Rarity Farming leaderboards

For example:

  1. highest total set bonus (BRS plus magnitude of NRG, AGG, SPK, BRN bonuses)
  2. highest number of wearables in the set
  3. index of when the set was added onchain (earliest wins)

Tiebreaker 1. is the most important one for the leaderboard. The current leaderboard code only looks at the set bonus BRS, which is why it doesn’t pick the best one.

2 and 3 are arbitrary, but are also important to define clearly, because different sets can tweak traits in different ways, which may be good or bad for the gotchi. This can affect the leaderboard when the trait is used for the tiebreaker. The important thing is to decide on an approach and be consistent, so that what the player sees as the current set (in both official and community-built websites) matches what’s used in the leaderboard. Right now the set-matching relies implicitly on ordering of sets and the way each algorithm is written.

Edit: for completeness, I guess I should mention the ‘historical’ leaderboards on the main site (available when you click on ‘Block’). That feature was added after my research back in March. They seem to be generated simply by querying the subgraph for a particular block and applying the current algorithm: unfortunately, as you will realise if you read the above, the actual algorithm for ranking as well as the wearable sets data has changed over time, so these generated leaderboards do not match reality :wink:

10 Likes

wow…really interesting + was not aware of this. thank you!!

one more reason to bump RF to Sept-Oct.

we have a lot of mechanics to work on…lincluding this.

Added it to the meeting, can you write up a proposition right away? we can get this fixed in no time. WTF will be there tomorrow, and we can fast track a fix.

If you would please come and talk, that would be amazing.

It’s a simple bug, and all the info is above. It shouldn’t require a proposal!
It was just hard to see before because no one had made the historical information available or double-checked the rarity farming leaderboard calculations. Now I have, the information is there, it should be obvious that it should be fixed.

2 Likes


I bet ya 5 GHST Dan just sees it and fixes it.

2 Likes

For future reference, for those who missed Dan’s reaction in the call - If you find stuff like this that is definitely a typo or bug, you can just send them a spreadsheet and they will fix it :slight_smile: