Cheeze Wizards Duels: External Gameplay Analysis on our Smart Contracts

Cheeze Wizards is an Ethereum game where players use NFT Wizards in on-chain duels against each other to win power, glory, and a whole lot of ETH

Cheeze Wizards 🧀
Dapper Labs
6 min readOct 26, 2019

--

a massive duel where ~4 ETH worth of Power was exchanged

Watch our Duel Mechanic video as a primer before you duel!

Given the complexity of Cheeze Wizards relative to other Ethereum dapps, we engaged an external security firm to perform security reviews of our key smart contracts, cataloged below:

As part of their security review, the firm, Sigma Prime, also performed a gameplay analysis we felt would be interesting to all power duelers.

We’ve shared their analysis with few edits for style, below:

Per-move Expectation Value

There are three moves a Cheeze Wizard can perform: fire (F), water (W), air (A). Elemental wizards have an affinity to one of these elements. When an elemental wizard uses a move that matches their affinity, i.e a fire wizard uses a fire move, the result of that match (a single move encounter) has its weight increased by 30% (regardless of who wins). A match’s weight can be increased by 69% if both wizards play their affinity move.

This leads to interesting expectation values for elemental wizards playing against each other. If one takes the unrealistic assumption that its opponent will play any move, fire, air or water with equal probability, the following
expectation matrix can be derived per move for an elemental wizard (a win is valued as 1 and a loss as -1).

Wait, define those terms for me

The terms used in this table can be given more explicitly, by considering an elemental wizard with an affinity of X, then:

  • Strong Opponent — An elemental wizard who has an affinity to an element which is the weakness of X.
  • Equal Opponent — An elemental wizard who has an affinity to an element that is equal to X.
  • Weak Opponent — An elemental wizard who has an affinity to an element which to which X is strong against.

And the move played column more explicitly is;

  • Strength — Playing X’s affinity move.
  • Neutral — Playing the move that X is not weak against (for fire this is air).
  • Weakness — Playing the move that is X’s weakness (for fire this is water).

Give me an example!

An explicit example for a Fire elemental Wizard is

  • Strong Opponent — Water
  • Equal Opponent — Fire
  • Weak Opponent — Air
  • Strength — Fire
  • Neutral — Air
  • Weakness — Water

Thus under the assumption that an opponent plays randomly, there are clear moves that an elemental wizard should play given an opposing elemental wizard’s affinity. [Ed: but of course, no-one plays “randomly”…]

Watch our Duel Mechanic video explainer

Power Transfer Calculation

The testing team simulated 10M duels. These duels included both elemental and neutral wizards (chosen at random) and assumed each wizard chose their moves independently of their opponent and randomly. This was
to verify a gaussian-like probability distribution function (PDF) in the normalized score of the duel.

The PDF (Figure 1a) does behave like a gaussian (drawn in black). The tail ends are larger due to capping larger scores to the range [-1,1] (which naturally grow beyond this due to the affinity weighting).

To estimate the power transfer, the PDF is square rooted which flattens the distribution. The square root function is an approximation, used for gas savings reasons and after applying this function the PDF becomes Figure 1b.

As expected, this becomes more uniformly distributed apart from the score of 1, which has the highest probability due to the capping mentioned above. The final power distribution is an exponential with the square-rooted score as the base and the ratio of the losing wizard's power to the winning wizard's power as the exponent. This exponential is calculated using the gas-saving solidity function _fakePowQ10(). The final power distribution (as a percentage of the losing wizard's power) is given as contour graphs in Figure 1c (theoretical) and Figure 1d (actual due to solidity gas-saving function). The vertical axis of these figures is the ratio of the winning wizard’s power to the losing wizard’s power and the contours show the percentage of the losing wizard's power that will go to the winning wizard.

There are a few interesting points to note here:

  • Wizards of equal power have their power distributed linearly with respect to the square-rooted score, which as discussed is mostly uniform (although there is a higher chance a winning wizard will take all the power due to the capping).
  • Higher powered wizards (> 5×opponent’s power) will most likely (a normalized score > 0.4) take >90% of their opponent's power.
  • Higher powered wizards should refrain from using their affinity, especially in later moves. This is because a higher-powered wizard is relatively indifferent in normalized scores > 0.4 (they get > 90% of their opponent's
    power). If they lose, they would prefer lower normalized scores. Using affinities skews scores towards the extremes and losing to a normalized score of 1, the higher-power wizards will lose all their capped power.
  • Due to the high chance of the square-rooted normalized score being 1, there is a greater chance (than a true uniform distribution) that a higher-powered wizard will lose all of their power (capped to at most 7x their opponent) to a weaker opponent.
  • It seems that the gas-saving exponentiation function appears to benefit winning wizards, especially high-powered winning wizards (greater power transfer occurs for the winner) compared to true exponentiation.

What does this mean for me?

There are many ways to play Cheeze Wizards, and you need to find what works for you. Besides the specific duel math and mechanics outlined above, there are a few other things power players should keep in mind:

  • Psychology matters: a Fire wizard being a Fire wizard comes with its own pre-set expectations for your opponent. Remember that!
  • Pick your battles: just because you’re challenged doesn’t mean you should fight — hit x to reject unworthy opponents to conserve energy
  • Know your strategy: there is only one Big Cheeze, but lots of ways to win along the way — have a plan and stick to it!

To read more about the different Cheeze Wizards strategies we suggest you explore, check out our launch blog post and scroll to the part about the Mother of Dragons… 🐉🧙‍♀️

Happy dueling!

--

--

Cheeze Wizards 🧀
Dapper Labs

Cheeze Wizards is the world's first blockchain battle royale with cheese.