Super Auto Pets First Round Teams and Equilibria
July 1st , 2023 by Rohan Rao
Super Auto Pets
Super Auto Pets is an auto-battler game by Team Wood Games https://teamwoodgames.com/, where players build a team of pets that will battle other playersβ teams of pets. Each round a player has choices to add pets to their team and the options available each round have some level of randomness and differ round to round.
There are 2 stages to a round.
(1) you add pets to your team. You choose what order to add pets in, and what order the pets are placed in your team. Pets have certain effects that are triggered when they are added to a team.
Hereβs an example of two team constructions. As you can see, the horse has triggers when pets are added after it, and the otter has a trigger when it is added to the team.
(2) Your team battles another team. The other team you are battling isnβt known to you at the time of the battle (we can pretend that you and the opponent simultaneously pick your teams as per (1) then battle). Some pets (like the Mosquito) have start-of-round effects that trigger before the actual battling begins.
During the battle the front pets of each team simultaneously deal damage to each other. The damage dealt is equal to the pets attack stat and decreases the health of the pet receiving the damage. Once a pet is out of health it faints. Throughout the battle pets might have special abilities that get triggered (like the Ant and Cricket)
A Single Round Super Auto Pets Game
Lets imagine a simplified version of this game where we only play a single round of the game and in the first stage of the game we can choose any of the possible round 1 pets that might appear. Weβll try and analyze the strategies/teams each player can pick and look for equillibria. Lets take a look at the full set of pets available in round 1.
pet | attack | health | trigger | ability |
---|---|---|---|---|
π | 2 | 1 | Faint | Give one random friend +2 Attack and +1 Health |
π¦ | 2 | 3 | Sell | Give shop pets +1 Health |
π¦ | 2 | 2 | Start of battle | Deal 1 Damage to one random enemy |
π | 2 | 1 | Friend summoned | Give it +1 Attack until end of battle |
𦦠| 1 | 2 | Buy | Give one random friend +1 Attack and +1 Health |
𦫠| 3 | 2 | Sell | Give two random friends +1 Health |
π¦ | 2 | 1 | Faint | Summon one 1/1 Zombie Cricket (doesnβt respawn when killed) |
π | 2 | 2 | Level up | Give all friends +1 Attack and +1 Health |
π | 4 | 1 | Sell | Gain +1 Gold |
Since we only care about the first round we can ignore sell triggers (π¦, π¦«) or level up triggers (π). Additionally the π effect isnβt as helpful as we only play one round so the +1 gold doesnβt do much in our simplified game. Weβll simulate all possible teams against each other and analyze the results.
There are 4374 teams that we will consider. There are 9 choices for each team slot (in the first round we can only afford 3 pets and buying fewer than 3 pets canβt help improve a teamβs round one win probability), and there are 6 orderings of purchase (ordering of purchase matters due to the way that the buy triggers work). There are a few cases where purchasing ordering doesnβt matter but this wonβt really be a big deal to double count these.
Hereβs an example of a team battle:
π¦ bought 1st, π bought 2nd, 𦫠bought 3rd,
VS
π bought 1st, π¦ bought 2nd, π bought 3rd,
start π(4,1) π¦(1,2) π(4,1) VS π¦«(3,2) π(2,2) π¦(2,3)
start π(4,1) π¦(1,2) π(4,1) VS π¦«(3,2) π(2,2) π¦(2,3)
play π(4,1) π¦(1,2) π(4,1) VS π¦«(3,2) π(2,2) π¦(2,3)
play π(4,1) π¦(1,2) VS π(2,2) π¦(2,3)
play π(4,1) π¦(1,1) VS π(2,1) π¦(2,3)
play π(4,1) VS π¦(2,3)
play VS
0.5
0.5
The above output shows the game tree where indented lines indicate game subtrees.
Here there is only one path because the entire battle is deterministic but to solve for the exact probability of a teamβs win when the team has some random effects, we have to compute the possible branches and the win probabilites along each of the branches. Although we could estimate the probabilities by repeated simulation, the error on these estimates might be high enough for us to have a hard time eliminating weakly dominated strategies.
Hereβs a log including pets with nondeterministic triggers (π and π¦)
π¦ bought 1st, 𦫠bought 2nd, π bought 3rd,
VS
π bought 1st, π bought 2nd, π¦ bought 3rd,
start π(4,1) π(4,1) π¦(2,2) VS π(2,1) π¦«(3,2) π¦(2,3)
start π(4,1) π(4,1) π¦(2,2) VS π(2,1) π¦«(3,2) π¦(2,2)
play π(4,1) π(4,1) π¦(2,2) VS π(2,1) π¦«(3,2) π¦(2,2)
play π(4,1) π(4,1) VS π¦«(3,2) π¦(4,3)
play π(4,1) VS π¦(4,3)
play VS
0.5
play π(4,1) π(4,1) VS π¦«(5,3) π¦(2,2)
play π(4,1) VS π¦(2,2)
play VS
0.5
start π(4,1) π(4,1) π¦(2,2) VS π(2,1) π¦«(3,1) π¦(2,3)
play π(4,1) π(4,1) π¦(2,2) VS π(2,1) π¦«(3,1) π¦(2,3)
play π(4,1) π(4,1) VS π¦«(3,1) π¦(4,4)
play π(4,1) VS π¦(4,4)
play VS
0.5
play π(4,1) π(4,1) VS π¦«(5,2) π¦(2,3)
play π(4,1) VS π¦(2,3)
play VS
0.5
start π(4,1) π(4,1) π¦(2,2) VS π(2,0) π¦«(3,2) π¦(2,3)
play π(4,1) π(4,1) π¦(2,2) VS π¦«(3,2) π¦(4,4)
play π(4,1) π(4,1) VS π¦(4,4)
play π(4,1) VS
1.0
play π(4,1) π(4,1) π¦(2,2) VS π¦«(5,3) π¦(2,3)
play π(4,1) π(4,1) VS π¦«(5,1) π¦(2,3)
play π(4,1) VS π¦(2,3)
play VS
0.5
0.5833333333333334
The above log reflects three possibilities for which pet the Mosquito deals damage to, and then a second branch reflecting which teammate the ant gives health to. It looks like in the case where the mosquito hits the ant, then team 1 wins, but otherwise it ends in a draw.
There are also non-deterministic buy triggers.
Imagine we have
π¦ bought 1st, 𦫠bought 3rd, 𦦠bought 2nd,
VS
π bought 1st, π¦ bought 2nd, 𦦠bought 3rd,
start π¦(2,3) π¦«(3,2) π¦¦(1,2) VS π¦¦(1,2) π¦(2,3) π(5,2)
start π¦(2,3) π¦«(3,2) π¦¦(1,2) VS π¦¦(1,2) π¦(2,3) π(5,2)
play π¦(2,3) π¦«(3,2) π¦¦(1,2) VS π¦¦(1,2) π¦(2,3) π(5,2)
play π¦(2,3) π¦«(3,2) π¦¦(1,1) VS π¦¦(1,1) π¦(2,3) π(5,2)
play π¦(2,3) π¦«(3,2) VS π¦(2,3) π(5,2)
play π¦(2,3) VS π(5,2)
play π¦(1,1) VS
1.0
start π¦(2,3) π¦«(3,2) π¦¦(1,2) VS π¦¦(1,2) π¦(3,4) π(4,1)
start π¦(2,3) π¦«(3,2) π¦¦(1,2) VS π¦¦(1,2) π¦(3,4) π(4,1)
play π¦(2,3) π¦«(3,2) π¦¦(1,2) VS π¦¦(1,2) π¦(3,4) π(4,1)
play π¦(2,3) π¦«(3,2) π¦¦(1,1) VS π¦¦(1,1) π¦(3,4) π(4,1)
play π¦(2,3) π¦«(3,2) VS π¦(3,4) π(4,1)
play π¦(2,3) VS π¦(3,1) π(4,1)
play π¦(1,1) VS π(4,1)
play VS
0.5
0.75
here there are only two non-deterministic branches based on whether team 2βs otter buffs the pig or duck (team 1βs otter will always buff the cricket). In the case where the team 2 otter makes the pig stronger then team 2 wins but otherwise it is a draw.
For each combination of two teams we simulate the outcome and end up with a 4374 by 4374 matrix \(P\) where \(P_{i,j} = \mathbb{P}(\) Team i beats Team j \()\)
Team Matchups
Once we have our matrix \(P\), if we consider two vectors \(\textbf{a}, \textbf{b} \in \mathbb{R}_{\geq 0}^{n}\) with \(\|\textbf{a}\| = \|\textbf{b}\| = 1\) where \(\textbf{a}_i, \textbf{b}_i\) is the probability that player a and player b respectively choose team choice \(i\). Then the probability player a wins is:
\[p_{a\_win} = \textbf{a}^TP\textbf{b}\]To make this tangible, if player a knows that player b is going to uniformly randomly pick a team, we can find the optimal team for player a to pick by right multiplying \(P\) by a uniform distribution to get some vector \(c\) and picking a distribution of teams \(a\) that has highest dot product with \(c\) (which would be 0 everywhere and 1 at the index where \(c\) has maximum entry)
Team: π¦ bought 2nd, π bought 1st, π¦ bought 3rd,
Win %: 91
and the worst team (for fun)
Team: π bought 2nd, π bought 3rd, 𦦠bought 1st,
Win %: 8
This makes sense as buying the horse last and otter first means their special abilities arenβt used at all.
Next, lets assume we are playing strategic players.
We can think of this as a matrix game where one player chooses a row of \(P\), and another player chooses a column simultaneously. Lets first look for pure Nash Equillibria. One necessary condition for this is that there is some strategy for player \(b\) such that \(a\) canβt do better than 0.5 (and the symmetric condition for \(a\)).
A symmetric game like this needs to have all of its equillibria at 0.5 otherwise the disadvantaged player can deviate to match the opponent and have a 0.5 win %. Player 1 can always deviate from a given strategy to get a better win rate (and symmetrically for the other player).
worst best response that a has to b's strategy gives a a win probability of 0.75
Looks like there are no pure equillibria. Next we iteratively remove strategies (rows and columns) from \(P\) which are dominated. This reduced matrix will make it easier for us to do further analysis.
new matrix size: 605
In our simplified matrix, against a uniform distribution of undominated teams we get a different optimal team
team: π bought 1st, π¦ bought 2nd, π¦ bought 3rd, with win prob of 0.804
and a different worst team (which makes sense as our old worst team was clearly dominated)
team: π bought 1st, π bought 2nd, 𦦠bought 3rd, with win prob of 0.155
Next with our simplified matrix we can look for a mixed equillibrium (where players randomly choose a team to play according to some distribution)
For more complicated mixed equillibria we can modify a code snippet from (https://code.activestate.com/recipes/496825-game-theory-payoff-matrix-solver/) to compute this
We get the following mixed strategy
prob: 34.9 team π¦ bought 1st, π¦ bought 2nd, π¦ bought 3rd,
prob: 15.7 team π¦ bought 2nd, π bought 1st, π¦ bought 3rd,
prob: 15.0 team 𦦠bought 3rd, 𦦠bought 2nd, π¦ bought 1st,
prob: 11.6 team π¦ bought 3rd, π bought 1st, π bought 2nd,
prob: 6.5 team 𦦠bought 2nd, π bought 3rd, π¦ bought 1st,
prob: 6.5 team 𦦠bought 2nd, π bought 3rd, π¦ bought 1st,
prob: 4.0 team 𦦠bought 2nd, π¦ bought 1st, π¦ bought 3rd,
prob: 2.0 team 𦦠bought 2nd, π¦ bought 1st, π bought 3rd,
prob: 1.6 team 𦦠bought 2nd, π¦ bought 3rd, π bought 1st,
prob: 1.0 team 𦦠bought 2nd, π¦ bought 3rd, π¦ bought 1st,
prob: 0.5 team π¦ bought 2nd, π¦ bought 3rd, π bought 1st,
prob: 0.4 team π¦ bought 2nd, π bought 1st, π¦ bought 3rd,
prob: 0.3 team π¦ bought 2nd, π bought 1st, π¦ bought 3rd,
We can test a few strategies against this equillibrium. Lets see what the best pure strategy is against this distribution. A necessary condition is that it canβt do better than \(0.5\) win probability
best response is team: π¦ bought 1st, π¦ bought 2nd, π¦ bought 3rd, with win prob of 0.5
Note that against our equillibrium, since the best pure strategy gives win probability of 0.5, it must be the case that the best mixed strategy canβt do better than 50%. This has to be true as the best mixed strategyβs win probability is an average of terms each of which is \(< 0.5\)
Just for fun, we can see that if we play π¦π¦π¦ all the time its not too hard for someone to beat this with π¦π¦π¦.
best response to best response is team: π¦ bought 1st, π¦ bought 2nd, π¦ bought 3rd, with win prob of 0.8889
Against a uniform distribution the mixed strategy also does reasonably well (though we know we could do better against a uniform distribution).
73.56 %
How does this strategy translate to actually playing Super Auto Pets
The two main differences between our simplified game and the actual Super Auto Pets game are:
-
In our game there is a single round (so pet abilities that make your team stonger in future rounds are functionally ignored)
-
In our game players can choose any pets to form their team but in the game there is a randomly generated limited selection of pets
These are pretty big differences but there are some initial takeaways.
Looking at the simplified game the lack of pure equillibria tells us that there are no βbrokenβ teams such that if you play them you will always at least draw.
Our baseline of how a team does against a randomly chosen team might give us an idea of how we expect to perform against an opponent that has a very limited random selection of teams (because of (2)).
The composition of the mixed strategy Nash equillibrium also gives us some interesting intuition as to what your opponent can exploit if you systematically underplay one of the options (for example it is interesting that some of the elements of the strategy contain π¦ in the last position and π second to last).
Acknowledgements
Super Auto Pets was created by and is the property of Team Woods Games https://teamwoodgames.com/ - screenshots come from the iOS version of the game.