Skip to main content
Built by Best ROI MediaMITScheduled · Wave 4BestRoiMedia/bestroi-game-tools

anchors

Painted-feature anchor detector and 2D room placement validator.

2D level-art validator that drafts feature anchors on painted backgrounds using classical CV and OWLv2, then checks that animated props, lights, and foliage attach to real painted features without floating or occluding.

Follow BestRoiMedia on GitHub ↗
Upcoming public release (Wave 4)Planned repo: BestRoiMedia/bestroi-game-tools (MIT)
GitHub repositoryBestRoiMedia/bestroi-game-tools
Module path_tools/anchors/
LicenseMIT
Release waveWave 4
LanguagesPython

Why we built it

In painted 2D games, animated flames, curtains, or plants can easily drift off their painted sconces or get buried behind foreground tiles and HUD elements. anchors replaces guesswork with pixel-accurate composite and parallax checks.

Architecture & how it works

anchors.py draft combines classical computer vision with OWLv2 open-vocabulary detection and GrabCut polygons to locate windows, candles, shelves, plants, and pipes. After human/agent confirmation (confirm), check composites the full native room via a scene2d/1 adapter, simulates camera parallax samples, and flags FLOATING, WRONG_KIND, BAD_SCALE, OCCLUDED, or PARALLAX_MISMATCH issues alongside overlay and crop PNGs.

Key capabilities

  • Drafts polygon anchors on painted rooms using classical CV, GrabCut, and OWLv2
  • Interactive CLI workflow to confirm, reject, re-label, or manually add anchors
  • Simulates camera parallax offsets against world-fixed tile, door, and HUD occluders
  • Enforces category-aware scale bounds relative to hero height and anchor attachment
  • Format-agnostic scene2d/1 JSON core with a clean adapter pattern for any 2D engine

Usage example

Draft anchors on a room painting, confirm, and run placement checksPython
python3 anchors/anchors.py draft ./room_master.png --out ./room.anchors.json
python3 anchors/anchors.py confirm ./room.anchors.json --accept all
python3 anchors/anchors.py check --scene ./scene.json --anchors ./room.anchors.json --out ./out/anchors
Pass --no-model to draft using classical CV only without downloading OWLv2.