Log inGet started
World

Tabletop Minis: Original Miniature Unit Looks for Tactics Games

README.md

tabletopMinisTests

Checks the tabletopMinis package end to end in edit mode:

  • Catalogue: 9 roles x 4 styles = 36 baked figures in the manifest, each with base, body and primary parts and a sane triangle count; heavy and duelist have body meshes of their own (not shared with another role); describe gives every figure a distinct name within its style.
  • Unit type mapping: Minis.ROLE_FOR maps all nine tacticsKit unit types (soldier, scout, heavy, sniper, medic, grenadier, shield, commander, duelist) to nine different roles, and Minis.roleFor falls back to a role of the same name or the given fallback.
  • Spawning and schemes: every style x role spawns every part its manifest lists, with the team parts tinted to the team scheme; setScheme swaps to another scheme, to custom colours and to a defineScheme scheme; base = false drops the base.
  • Poses: every pose samples a frame through opts.t; rest resets; attack returns to idle and hit with after = "rest" ends in rest on the pose driver; restart replays.
  • Portraits: Minis.portrait answers a square texture handle with a guid (what a UI image takes as src), cached per role, style, scheme, size and background, accepting unit type ids; all 36 render; the staging camera and figure are taken down; clearPortraits frees the cache. A portrait reads "pending" until every mesh of its figure was on the GPU and a readback shows the figure (coverage over PORTRAIT_MIN_COVERAGE, never 0 as a blank texture reads); a result that stays blank ends "failed", is never cached as finished, and the next call re-renders it into the same handle.

It does not judge how the figures or portraits look: that is checked by eye from captures. Run it alone with asset.resolve("tabletopMinisTests", "testSuite"):run() or tools.use("tests", "run", { suite = "tabletopMinisTests" }).