action-visualizer

command
v0.2.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 24, 2026 License: MIT Imports: 11 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

Action Space Visualizer

Interactive web tool for exploring the game's decision space. Shows which actions are available in different game states and how aggressively the action space can be pruned.

Usage

# Using hardcoded action registry (default):
go run ./cmd/tools/action-visualizer/

# Using OpenAPI spec (auto-discovers new commands):
go run ./cmd/tools/action-visualizer/ -spec server_docs/openapi.json

Opens a browser at http://localhost:8077.

With -spec, the tool parses all commands from the OpenAPI spec, merges them with annotated preconditions from pkg/actionspace/annotations.go, and warns about any new commands that need precondition annotations.

Layout

  • Top bar — Branching factor, valid/total actions, pruned %, top pruning reason
  • Left panel — Toggleable game state controls (docked/undocked, combat, resources, location, etc.)
  • Main area — D3 radial dendrogram: center = current state, middle ring = 15 action categories, outer ring = individual actions

Valid actions are colored by category. Pruned actions are greyed out. Hover any action leaf for details including failed preconditions.

Architecture

The Go server embeds all static assets via go:embed and exposes a single API endpoint:

  • POST /api/evaluate — accepts a GameContext JSON body, returns the evaluated ActionSpace (tree + stats)

The browser builds a GameContext from the toggle/slider state, POSTs it on every change, and re-renders the D3 tree from the response.

Dependencies

  • pkg/actionspace — action registry, preconditions, evaluation engine
  • D3.js v7 (vendored in static/)

Documentation

Overview

Action Visualizer — interactive web tool for exploring the game action space. Run with: go run ./cmd/tools/action-visualizer/ With OpenAPI spec: go run ./cmd/tools/action-visualizer/ -spec server_docs/openapi.json

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL