r-j/pyw icon
public
Published on 6/15/2025
Piece tester

rules for making the piece tester

Rules

Build & Development Commands- PIECE TESTER

🎯 Purpose: The Piece Tester allows users to simulate and validate the behavior of custom chess pieces defined in the Piece Editor. It offers an interactive 8x8 board with real-time turn simulation, movement validation, ability testing, cooldowns, resurrection, and full state tracking — all in an isolated environment.


🖼️ UI Layout Overview (PyQt)

+--------------------------------------------------------------+ | Piece Tester Window | +--------------------------------------------------------------+ | Load Piece: [ Dropdown, color picker ] | | | Piece on Board Info: [ Live Preview Panel ] | | | | 8x8 Test Board (QGraphicsView / QTableWidget) | | - Drag/drop or click to place pieces | | - Click piece to view info + highlight valid actions | | - Double-click to trigger ability if applicable | | | | Turn Controls: | | [ Next Turn ] [ Reset Board ] [ Clear Log ] [ Save State ] | | | | Log / Status Console: | | - Action feedback, point changes, ability triggers | | | +--------------------------------------------------------------+


📚 Core Features & Behaviors

🔹 Piece Placement

  • Allow placing multiple pieces from the same or different definitions
  • Toggle placement mode: Place, Move, Test Ability, Erase
  • Limit occupancy based on canStack, shareSpace, carryPiece
  • Drag-and-drop OR click-to-place UX

🔹 Interactive Board

  • Visual overlays: • Blue = valid moves • Red = attack tiles • Orange = AoE • Green = summon targets • Yellow = LoS tiles
  • Show cooldowns, point totals, and ongoing resurrection status
  • Allow undo per turn if possible

🔹 Turn Simulation

  • 1 Turn = 2 actions
  • On Next Turn: • Apply recharge logic • Reduce cooldowns • Tick down resurrection • Trigger passive behaviors (e.g. prayer, adjacency gain)

⚔️ Ability Testing

Each piece should be able to:

  • Trigger its ability from the board using: • Context menu (double-click) • Action buttons (e.g., "Use Ability", "Summon", "Revive")
  • Show required cost and prevent invalid usage
  • Display affected tiles for: • Ranged • AoE • Resurrection zones • Teleport targets
  • Show line-of-sight (LOS) highlight if required

🧩 State Tracking Per Piece

| Property | Description | |---------------------|---------------------------------------------------| | Position | x, y grid coords | | Current Points | Tracks ability usage/recharge | | Cooldowns | Dict of abilities currently cooling down | | Resurrection Status | Countdown (if applicable) | | Shared Tile | Tracks stacked or carried pieces (if allowed) |


🔍 UI Panels & Components

| Section | Details | |------------------------|------------------------------------------------------| | Piece Picker Panel | Select from saved /data/pieces/ .json files | | Active Piece Panel | Shows currently selected piece’s: name, points, abilities, cooldowns | | Board Grid | Click-based or drag interaction | | Log Output | Scrollable QTextEdit log of moves/abilities | | Ability Buttons | Dynamically appear for piece with active abilities | | Overlay Layer | Paint visual effects: move range, AoE, LoS, etc. |


📦 Data & File Handling

  • Load from same folder as Piece Editor: data/pieces/
  • Allow saving tester sessions (optional) to data/tester_logs/
  • No internet required
  • Optionally allow export of test results or state as .json

✅ Suggested File Structure

  • piece_tester.py: UI layout and board management
  • tester_engine.py: Handles all test logic
  • tester_session.json: Stores piece states and positions
  • overlay_renderer.py: Paints highlight tiles --