Inspiration
As a fan of board games, I particularly enjoy strategy games that are meant to be played with 4 to 5 players. However, I have always had a desire to design a strategic game that can accommodate a large number of players playing together.
As a strategic gamer, I place a high value on fairness and transparency in game rules, down to the smallest details. This is why I believe web3 games are the ideal platform to bring my ideas to life. With all game rules and player moves recorded on the blockchain, there is complete visibility and accountability in the game.
What it does
"Momentum" is a massive player strategy game that features a very simple game mechanism. To be successful, you must possess the skill to make the right move at the right moment.
The full game rules can be found at https://github.com/hiukim/thirdweb-game/blob/master/Rules.md and summarized as follows:
Each player starts with 1 million coins and the objective is to earn as much as possible during the game. The game board is comprised of various treasure spots, each containing coins and players, with the coins being divided among the players on the spot. The only action players can take is to move between spots, with a cost to pay that increases over time.
The game is played in rounds, with no set limit to the number of rounds, each lasting for one day followed by a settlement phase. During this phase, players collect their share of coins from the treasure spots. At the start of each new round, players contribute 1000 coins to the pool, which are then evenly distributed among the treasure spots to be contested.
A leaderboard displays the top-performing players, with the key to success being the timing of moves. While players may not need to make many moves every day, they are always playing the game passively and need to continuously evaluate their position and seize opportunities as they arise.
How we built it
We utilized ContractKit by thirdweb to build and deploy the smart contract, which acts as the backend in this game. All player information and actions are recorded on the blockchain, allowing everyone to access the rules by reviewing the code at https://thirdweb.com/goerli/0x938Af7c6AcED64619e6825B1e57f36bC11A1574b.
We also employed thirdweb GamingKit to create the frontend interface, which was deployed on IPFS. GamingKit allows us to connect with a wallet and execute game moves (i.e. blockchain transactions) through the smart contract. You can access a test version of the game at https://gateway.ipfscdn.io/ipfs/QmUudgzEzso4p3AJA4BmJGJbcu8qGJJP2sz77rdrDWUFJ9/.
All source code can be found here: https://github.com/hiukim/thirdweb-game
Challenges we ran into
The GamingKit has a user-friendly interface, but it has a limitation. It cannot run the game directly in the Unity Editor to interact with the smart contracts. The game logic is stored in the smart contract, which makes it challenging to test inside Unity.
While it's possible to perform a "Build and Run" in Unity for local testing, the build process takes some time, slowing down the development iteration cycle. To overcome this, we wrote a mock of the entire game logic in a C# class, allowing us to run the complete game in Unity.
Accomplishments that we're proud of
Developing and releasing a comprehensive gaming experience from start to finish.
What we learned
Gaining knowledge and staying up to date with the latest web3 game development kits is valuable.
What's next for Momentum
Enhance the mathematical calculations. Many of the numerical aspects in the game rules, such as the cost of movement, have not been thoroughly evaluated and there is a likelihood of a dominant strategy present. I think it's crucial to establish a more balanced game.
Convert the in-game coins into an ERC20 token, which will bring in a new level of ownership and transferability for players.
Links
Live Game: https://gateway.ipfscdn.io/ipfs/QmUudgzEzso4p3AJA4BmJGJbcu8qGJJP2sz77rdrDWUFJ9/
GitHub: https://github.com/hiukim/thirdweb-game
Contract: https://thirdweb.com/goerli/0x938Af7c6AcED64619e6825B1e57f36bC11A1574b
Log in or sign up for Devpost to join the conversation.