floAr / SecretHeroes

Entry for #ETHHack 2021 https://hack.ethglobal.co/showcase/secret-heros-reckb8Gx0K55ezLIA
4 stars 5 forks source link

Show expected results of hero upgrades #44

Open floAr opened 3 years ago

SCRTHodl commented 2 years ago

I'm going to dive into this part so stop me if you already have worked on this part.

As it goes, we show 33% chance of success and 33% chance of failure but I know that we have two different heroes being burned in the process and that they will have different strengths.

Intuitively, I assume that they will be weighted somehow depending on their strengths. Statistically, I don't thing it would be much more complex than a simple weighted average for the first part:

Simply multiply each number by its weight factor and then sum the resulting numbers up, the same way you would take the average of any other data set.

So for tech stats it would be one weighted average and so forth for each stat. Now that we have a weighted average we need to compare it to the actual value of our hero card in order to determine if we award more or less than 33% probability...

A very rudimentary example is written below, as it still takes a little effort to write code and so it's easier to discuss it as a simple mathematical equation or hybrid of economic equations and stats with programming.

var techH1 var techH2 n = weightedaverage g = randomrangeoutcome x = CurrentTech

if n > x then xPositiveprobability = basestat 1.10f else if n > x+1 then xPositiveprobability = basestat 1.15f else if if n > x+2 then xPositiveprobability = basestat * 1.20f else Debug.Log("Failed to upgrade tech stat");

I think this is a critical part of the game and I would love to use some of my background in Economics and Statistics to write as much of this script as possible and use Unity to solve the UI portion

SCRTHodl commented 2 years ago

Cost Benefit Analysis of Burning new Secret Heroes

Hero A cost .2sSCRT to mint Hero B cost two Hero A's at a success rate of .33.
WP of 2 = .33? .165 or 16.5% chance two Hero A's will produce a Hero B So in order to find the value of a Hero B (or C, D, E, F...), we need to take the value of two Hero A's divided by .165. In this case that is .2 plus .2, or .4 times .165.

2 times preview generation value /.165 probability = New generation value or 2.42 for B 2 x 2.42 / .165 = Generation C

Because this is all programatic we should design it to achieve the greatest sense of wellbeing. Although this is hypothetical and I introduced the notion of using variable other than 33%, the linear result of using .165 shows the eventual growth trajectory of any given random value used in the wild, as long as .165 successfully represent the sum of averages of an adequate number of samples in the real population of random stats. A population and sample that we can quickly prove by demonstrating enough outcomes or random upgrades to prove they fall into the same average from one generation to the next. It's an obvious outcome based on their algorithm.

The problem with this is that everyone follows the same trajectory and it can quickly become tedious work to compete and there's also a lack of scarcity for NFTs.

The answer I have for this on the Unity side is to use modifiers to simulate the most beautiful number patterns in nature. Such perfect algorithms that they provide a sense of wellbeing and accomplishment we don't get as perfectly anywhere else. One where we can spend limited resources of time and money to compete in a repeatable game. We do all of this by using the Fibonacci sequence as a game design pattern.

1 +1 = 2 1 +2 = 3 2 + 3 = 5

It's a simple algorithm to take the past two generations to create the modifier for the next...

How can we also make this happen in the NFT smart contract to make forging Heroes just as enjoyable? Could we instead of forging 2 random heroes, require them to meet a certain criteria before they succeed and therefore inherit these qualities?

Maybe this is an unspoken skill based feature that people learn by playing the game. Instead of clear levels or generations they are numbers that change as they increase and these numbers could be calculated but most will just have to feel it.

If we move from the an actual Fib number of 55 from 34 in an example case, what hero stat number represents 34/55 in relation to the levels in our algorithm? If this hypothetical game produced random outcomes 17, 22, 53, 23, 34 and 10 then maybe in this example a "level 2" plus a "level 3" (for the most optimal outcome to produce a level 5) equates to Level 2 = 15-30 and Level 3 = 31-51. And this gives the outcome possibility of a level 3-6 with an average level 5 as its median value, of course.

There are just layers and layers of complexity and I can get pretty deep and add work which is why I ask for feedback as much as I do. I would love to add this to a game and it probably shouldn't be this project (would increase workload and add new steps) and so you'll have to tell me that it's okay to just go with 33% so we can move to build it out.