The code is not complete and is being improved
ON_CHAIN_MMORPG is a fully on-chain multiplayer online role-playing game (MMORPG) built on the Aptos blockchain. The contract is designed with modularity, interactivity, and a real economic system at its core. It implements player registration, equipment crafting, battle matchmaking, and an in-game currency system โ all executed and stored on-chain to ensure transparency and immutability.
- โ Fully On-Chain Execution: Player states, equipment, and battle results are all stored on-chain, ensuring fairness and transparency.
- โ๏ธ Weapon Crafting System: Weapons are minted with random attributes (attack and speed) using on-chain randomness, making each one unique.
- ๐ฎ Battle Matchmaking Mechanism: Fair combat logic with random critical hits ensures competitive and unpredictable outcomes.
- ๐ช GameCoin Economic System: A custom in-game token supports minting, burning, and transfers to simulate a closed-loop game economy.
- ๐งพ Event-Driven Logging: Events for weapon minting and battles are emitted on-chain, enabling frontend integrations and auditability.
- ๐ Modular and Secure Resource Design: Uses Aptos resource safety and object systems to protect user assets and enable extensibility.
- Initialize a player collection using
create_player_collection. - Mint a weapon with randomized attack and speed using
create_weapon_entry. - Each mint emits a
MintWeaponEventfor frontend listening and tracking.
- Use
match_challengeto initiate a battle challenge. - The system determines the winner based on critical hit logic and attack speed comparison.
- The winner gains the staked
GameCoin, while the loser loses part of their stake.
- Create the in-game token using
create_coin. - Supports minting, burning, and peer-to-peer transfers.
- All battle activities are driven by
GameCoin, simulating a real economic model.
aptos_framework::eventโ On-chain event emission systemaptos_framework::randomnessโ Source of randomness for weapon stats and critical hitsaptos_token_objects::tokenandcollectionโ Implementation of NFT systemsrpg_game::game_coinโ Custom module for GameCoin token management
-
๐ Native On-Chain Game Design
All core logic runs entirely on-chain, ensuring trustworthy and tamper-proof game rules. -
๐ ๏ธ Modular and Extensible
Designed for easy future expansion โ including equipment systems, quest modules, and in-game markets. -
๐ธ Real Economic Model
Built on Token and NFT standards to support asset circulation and in-game value exchange. -
๐ Scalability & Growth Potential
Early supporters can participate in governance and share economic returns through incentive mechanisms.