Ogame-Cairo
Ogame logic implementation written in Cairo for Starknet.
What is ogame
OGame is a browser-based, money-management and space-war themed massively multiplayer online browser game with over two million accounts. OGame was created in 2002 and is produced and maintained by Gameforge. Players can have multiple planet, a fleet and attack each other to steal resources.
Roadmap
- Account can create a planet and upgrade mines. Only mines are available.
✔️ - Integration of ERC721: planets will be NFTs.
✔️ - Integration of ERC20: resources will be tokenized.
✔️ - Add energy production requirements for mines.
✔️ - Add time constraints for buildings upgrades.
✔️ - Implementation of Robot Factory.
✔️ - Add research lab.
✔️ - Add technologies.
✔️ - Add Shipyard.
✔️ - Add ships.
- Implement logic for space travel between planets.
- Implement lagic for ships combat.
This will most likely keep me busy for a while. The rest of the roadmap is yet to be decided.
Game Deployment Workflow
- Deploy minter contract:
nile deploy erc721_minter --network goerli [owner.contract_address]
- Deploy ERC721:
nile deploy --network goerli ERC721 0x6f67616d6556302e31 0x4f474d302e31 [minter.contract_address] 3 0x68747470733a2f2f676174657761792e70696e6174612e 0x636c6f75642f697066732f516d56696a7632465a547841706e4e54 0x356250384355356466724e573336733239784a566a636b6b736e36733733
-
On minter contract invoke setNftAddress with ERC721 as parameter.
-
Deploy main game contract:
nile deploy Ogame --network goerli [erc721.contract_address] [owner]
-
On minter invoke setNftApproval with Ogame.contract_address as operator.
-
Invoke mint_all function on erc721_minter contract with parameters n = 150 and token_id.low starting from 1. Minting more >= 200 planets in a single transaction triggers MAX NUMBER OF STEPS error from Starknet.
-
Deploy metal token:
nile deploy ERC20_Mintable --network goerli 0x6f67616d65206d6574616c2076302e31 0x4f674d455476302e31 18 0 0 [game.contract_address] [game.contract_addres]
- Deploy crystal token:
nile deploy ERC20_Mintable --network goerli 0x6f67616d65206372797374616c2076302e31 0x4f6743525976302e31 18 0 0 [game.contract_address] [game.contract_addres]
- Deploy deuterium token
nile deploy ERC20_Mintable --network goerli 0x6f67616d652064657574657269756d2076302e31 0x4f6744455576302e31 18 0 0 [game.contract_address] [game.contract_addres]
- Invoke erc20_addresses on Ogame contract with resources token addresses as params.