Combat is 9-unit formation warfare. Both pixels field a 3×3 squad, the units swing in waves until one side is wiped out, and the surviving side takes the contested pixel. There’s no manual control during the fight — your strategy lives in the layout you committed beforehand.Documentation Index
Fetch the complete documentation index at: https://docs.basepixel.io/llms.txt
Use this file to discover all available pages before exploring further.
What you need to attack
- Your own pixel in Action mode with a committed layout
- An enemy target in Action mode with its own committed layout (Unaction pixels are immune)
- 0.0005 ETH to pay the attack fee — paid as
msg.valueon the lock transaction (no escrow)
- The Engine validates your intent and signs off on it (off-chain).
- You submit
lockBattleand pay the 0.0005 ETH attack fee in the same call. - The Engine simulates the fight off-chain the moment the lock event fires (eager simulation; both layouts were uploaded at commit time).
- The full replay streams to your screen over SSE — usually within ~30ms of the lock confirming.
- The Engine submits
resolveBattleon-chain, transferring the NFT and insurance pool to the winner.
The 9-unit formation
Each side has a 3×3 grid (9 slots). Slots are arranged in three waves:| Code | Class | ATK | HP | Notes |
|---|---|---|---|---|
| W | Warrior | 4 | 12 | Balanced bruiser |
| A | Archer | 3 | 10 | Lower HP, fires from distance (animation only — combat math is symmetric) |
| S | Shield | 2 | 16 | Tankiest body |
Outcomes
| Outcome | Meaning | Result |
|---|---|---|
| AttackerWin | Defender’s 9 units all dead, attacker has survivors | Attacker takes the pixel |
| DefenderWin | Attacker’s 9 units all dead, defender has survivors | Defender keeps the pixel |
| Draw | Both sides annihilated in the same step (mutual KO) | Defender holds — by spec |
| Timeout | 30 rounds reached, both sides still alive | Defender holds — by spec |
| Forfeit | Defender’s plaintext layout is missing from the Engine | Attacker wins by default |
What transfers when the attacker wins
The NFT moves to the attacker's wallet
The pixel’s faction color flips. The map updates as soon as the indexer picks up
BattleResolved.The defender's insurance pool transfers to the attacker
Whatever ETH was bonded inside the captured pixel comes along with it.
The 0.0005 ETH attack fee joins the new owner's insurance pool
The fee you paid at lock time isn’t burned — it tops up the pixel you just captured.
The captured pixel resets to Unaction
actionEnabled is cleared on transfer, so you choose when to re-arm and re-commit a layout.The 24h redeem window opens for the loser
The previous owner can buy the pixel back at premium for 24h — see Redeem.
What transfers when the defender wins or the battle draws
The attacker’s pixel transfers to the defender — it’s symmetric. Lose the fight and you lose the pixel you attacked from. The 0.0005 ETH attack fee accrues to the defender’s insurance pool. The same 24h redeem window opens for the attacker on the lost pixel. This is the load-bearing part of the design: attacking is a real risk. You’re not paying 0.0005 ETH for a one-way coin flip — you’re putting your attacker pixel up against the defender’s, and a misjudged matchup costs you the NFT.Strategy: where formations matter
Since combat is deterministic given the inputs, the layout is the entire strategy surface:- Wave ordering. Front-loading Shields buys time for your DPS to pile on. Front-loading Warriors maximizes opening burst but you lose tanks early.
- Mutual damage discipline. A Warrior trading into a Shield (4 dmg vs 2 dmg counter) is favorable; a Shield trading into a Warrior (2 dmg vs 4 dmg counter) loses the exchange.
- Initiative randomness. The 50/50 coin flip means a single round can swing on luck. Build redundancy — don’t bet the fight on a single Warrior surviving Wave 1.
Lost a pixel? You have 24 hours
Learn how to redeem