🔮
Impulse DAO
DiscordTwitter
  • 👋Get started
  • Overview
    • 💡Introduction
      • What?
    • 🛠️Community
      • 📝Roles
      • 🛤️Rituals
    • ✨Governance
  • games for developers
    • 🏟️Arena
      • 📗Arena almanac
      • 🦀Vara-Arena
        • ⚔️Introduction
        • 💡Step-by-step guide
        • 📜Creating an algorithm
        • 🏰Creating a Lobby
        • 🤼Lobby results
        • ⬆️LevelUp
        • 🏆Leaderboard and prize distribution
      • 🤝Update priorities
        • ▶️Playtesting
Powered by GitBook
On this page
  • Using gtest before uploading code onchain
  • Creating an algorithm
  • In-game actions
  • Battle Map
  • TODO :: Use GPT Agent
  • Upload strategy as code
  1. games for developers
  2. Arena
  3. Vara-Arena

Creating an algorithm

It's essential to create a unique battling strategy for your gladiator.

PreviousStep-by-step guideNextCreating a Lobby

Last updated 1 year ago

Using gtest before uploading code onchain

  1. git clone

  2. run cargo build --release in vara-arena/contracts directory

    1. find .wasm examples from character / mage / berserk templates in vara-arena/target/wasm32-unknown-unknown/release/

  3. run cargo test (for all tests) in /contracts/arena directory or only character algorithm test - cargo test --package arena --test tests -- game --exact --nocapture

  4. make changes to existing templates or create you custom code within lib.rs

  5. customise /arena/tests/tests.rs to upload your custom code

Creating an algorithm

Create a strategy using gstd (), compile, and upload your .wasm strategy file as a smart-contract onchain.

Find strategy examples in the Arena repository:

Please note that each player (wallet) can own only one gladiator.

In-game actions

Algorithms fight on 1D map by exchanging message onchain.

AttackKind { 
Quick, 
Normal, 
Hard, 
}

Spell {
    FireWall,
    EarthSkin,
    WaterRestoration,
    Fireball,
    WaterBurst,
    FireHaste,
    EarthSmites,
    ChillingTouch,
}

BattleAction {
    Attack { kind: AttackKind },
    MoveRight,
    MoveLeft,
    Rest,
    Parry,
    Guardbreak,
    CastSpell { spell: Spell },
}

Battle Map

The initial distance between characters is ten cells.

Total arena map range = 0..15 cells, ie 16. Plater 1 starts at 6, and Player 2 starts at 10.

TODO :: Use GPT Agent

Upload strategy as code

Pre-requirements: Using gtest before uploading code onchain

  1. Click on the Default strategy dropdown field and click Upload code

  1. Use your Code id for creating a character

  1. Choose your initial character attributes and proceed by clicking Mint character

Please note that each player (wallet) can own only one gladiator.

Go to

Connect Substrate wallet, and click

🏟️
🦀
📜
https://github.com/ImpulseDAO/Vara-Arena.git
gear standard library
Berserk
Quick attacker
Mage
Arena dApp
Create New Gladiator