Let’s Make An Ethereum Simulation Game
Part 1: Inception

Introduction
I recently wrote an article on ERC721 tokens. To demonstrate their use, I used the example of a Pokemon-like game. It got me thinking of some of the games I couldn’t get enough of as a kid.
The hours I spent on my Gameboy Colour trying to catch ’em all must number in the hundreds if not thousands. As I grew older, my taste moved towards simulation games like The Sims, SimCity, and sports-oriented sims. One game, in particular, stands out more than others: Football Manager.
Sports Simulations
“Take over a football team and make it completely your own. From tactics and training, to transfers and trophies.” — footbalmanager.com
It’s an enticing prospect. You can finally compare yourself to the pros by running your team the way you think it should be run.
Backing up a little… Before I found out about Football Manager, there was a similar online game which took up a lot of my after-school time.
Sundayleague.com is of the same premise, except instead of simulating against a computer, you manage your team against other people. You play with fake generated players with funny names like Ben Dover. The pyramid system of leagues spans tens of levels with promotion and relegation. There are online forums for tactics, training, buying players, etc. All of these aspects contribute to the success of your team.
It’s time-based, so only one game is played per day at a scheduled time. Training your team is also limited and time-based.
In-game money can be won, but it can also be bought with real money if you want to progress your team faster.
You can bid for and buy players, increasing the quality of your team.
Whilst I was reminiscing about all of this, it struck me that these in-game football players could be considered ERC721 compliant if the game was running on the Blockchain. How easy could it be to recreate a game like this on the Blockchain?
Breaking It Down
Let’s assume that each player is an ERC721 token. In each squad, there are 20 players.
Each player has several attributes dictating their ability: fitness, speed, strength, creativity, work rate, aggression, passing, shooting, tackling.
Each player has an age, which increases depending on some metric (actual time, in-game time or matches played perhaps).
Training the players increases their stats depending on age, current stats, etc.
Managers can pick the formation, tactics and starting lineup for future matches. Matches take into account each player in each team, the starting eleven and the bench.
Each one of these decisions has some bearing on the result of each match, with some element of chance thrown in also.
At this point, the scale of the game is getting a little out of hand. We’re starting to rack up a lot of computing time for a lot of calculations, meaning lots and lots of gas.
Maybe team sports aren’t a great starting point. Let’s try something simpler, like a solo sport. At least then we only have one ERC721 token to deal with when performing calculations for training, and two for competing. How about Tennis?
Tennis Manager
I’m not a Tennis expert, but I’ve watched a few Wimbledon tournaments so I can make an educated guess to the kinds of attributes tennis players would consider important.
Each tennis player is an ERC721 token and has basic attributes:
- Personal: name, age, height
- Physical: technique, power, agility, stamina, condition
Let’s assume that we can train our player to increase their stats, and we can set up matches to compete against other players.
Training
Increase specific physical attributes by training, whether that be agility, power, stamina or technique. It also has the side effect of decreasing the condition of the player, which can be increased by resting the player.
All of these operations should cost something. Let’s call it XP.
XP is gained by playing matches against other players.
Note: In its current state, XP is another attribute in the Tennis Player ERC721 token. However, there could be scope to convert this into an ERC20. Explore this later on.
Matches
Matches can only be played against players which have registered to be available to play matches. They can only play if their condition is higher than a certain value, otherwise, they’re considered not match fit.
Tactics can be set before each match which influences the payer’s stats temporarily for that game.
For example, The Attack tactic increases the power attribute but reduces stamina. The Patient tactic increases technique but reduces power.
The mechanism for calculating match-winners is yet to be decided. (Initial thoughts: weightings on attributes and tactics, or numeric rules based on those same things.)
Both players gain XP from playing matches, but the winner gains more. Both player’s conditions decrease as a result of playing matches, which can be recuperated by rest.
The First Smart Contracts
ERC721
Given that the game is based around ERC721, I’m starting with the TennisPlayerBase ERC721 token. Figure 1 shows the token at this stage.

