Skip to content

Repository files navigation

OpenMagick

OpenMagick currently contains a runnable pixel-engine foundation for the game described in docs/design. One Go process owns the indexed world, collision, A* path, movement, camera, final-pixel composition, and client recovery history. The browser is a thin WebGL2 viewer: it sends click destinations and renders only palette-index snapshots and changed pixel runs.

Requirements

  • Go 1.25 or newer
  • Node.js 22 or newer
  • A current desktop browser with WebGL2

Run the prototype

Install and compile the browser client:

npm install
npm run build

Start the authoritative server:

go run ./cmd/server -world assets/world -web web/dist

Open http://127.0.0.1:8080. Left-click a visible walkable destination to move the gold 5x5 square. Clicks in black letterbox bars, on solid terrain, or at unreachable destinations are ignored without cancelling the active route.

Press H to cycle the development acknowledgement exercise through four held revisions, six held revisions, and normal delivery. Four revisions recover with one cumulative delta; six revisions force a new snapshot. Connection state is shown in the small overlay.

Verify

Run the complete automated checks:

go test ./...
npm test
go vet ./...

The focused coverage includes indexed-map round trips, 5x5 collision and corner-safe A*, integer movement and camera clamping, dirty composition, five-revision merging, binary protocol validation, HTTP health/static delivery, circular texture addressing, and pointer-to-world mapping.

Author a map

The checked-in development source is an indexed 1024x640 PNG. Recreate it and import it through the same path used by any authored map:

go run ./cmd/devmap -out assets/source/dev-map.png
go run ./cmd/mapimport -source assets/source/dev-map.png -palette assets/source/palette.json -out assets/world

mapimport accepts indexed PNGs up to 10,000x10,000, requires metadata for every used palette index, and writes independently loadable 256x256 chunks plus a versioned manifest.

Repository layout

  • cmd/server: HTTP/WebSocket host and 30 Hz foundation loop
  • cmd/mapimport: indexed-PNG validator and chunk importer
  • cmd/devmap: deterministic authored development-map generator
  • internal/world: manifest, palette, terrain collision, and lazy chunks
  • internal/path: bounded integer A* with a complete 5x5 footprint
  • internal/sim: authoritative movement and integer camera
  • internal/compositor: dirty final-pixel composition and exposed edges
  • internal/history: five-revision cumulative recovery
  • internal/protocol: explicit versioned binary codecs
  • internal/game: single-match orchestration
  • web: TypeScript/WebGL2 client
  • assets: source and imported development world

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages