Thanks to visit codestin.com
Credit goes to github.com

Skip to content

eclouder/aptos_rpg_figame

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

7 Commits
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ›ก๏ธ ON_CHAIN_MMORPG - Aptos On-Chain Role-Playing Game Smart Contract

Overview

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.


๐ŸŒŸ Key Highlights

  • โœ… 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.

โš™๏ธ Core Functionalities

๐Ÿ”จ Player Creation & Weapon System

  • Initialize a player collection using create_player_collection.
  • Mint a weapon with randomized attack and speed using create_weapon_entry.
  • Each mint emits a MintWeaponEvent for frontend listening and tracking.

โš”๏ธ Battle Matchmaking

  • Use match_challenge to 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.

๐Ÿช™ GameCoin Mechanics

  • 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.

๐Ÿ“ฆ Dependencies

  • aptos_framework::event โ€“ On-chain event emission system
  • aptos_framework::randomness โ€“ Source of randomness for weapon stats and critical hits
  • aptos_token_objects::token and collection โ€“ Implementation of NFT systems
  • rpg_game::game_coin โ€“ Custom module for GameCoin token management

๐ŸŒŸ Project Advantages

  • ๐ŸŒ 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.

About

RPG games on the aptos chain

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages