📜Creating an algorithm
It's essential to create a unique battling strategy for your gladiator.
Using gtest before uploading code onchain
run
cargo build --release
in vara-arena/contracts directoryfind .wasm examples from character / mage / berserk templates in vara-arena/target/wasm32-unknown-unknown/release/
run
cargo test
(for all tests) in /contracts/arena directory or only character algorithm test -cargo test --package arena --test tests -- game --exact --nocapture
make changes to existing templates or create you custom code within lib.rs
customise /arena/tests/tests.rs to upload your custom code
Creating an algorithm
Create a strategy using gstd
(gear standard library), 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.
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
Go to Arena dApp
Connect Substrate wallet, and click Create New Gladiator
Click on the Default strategy dropdown field and click Upload code
Use your
Code id
for creating a character
Choose your initial character attributes and proceed by clicking
Mint character
Please note that each player (wallet) can own only one gladiator.
Last updated