Skip to content

Cross-kit composition

import { Aside } from ‘@astrojs/starlight/components’;

You want KayKit Medieval Hexagon Pack tiles for the gameboard, but characters from KayKit Adventurers 2.0 (FREE) for the player + NPCs, plus a tower asset from Kenney’s Castle Kit as a special landmark.

import {
analyzeExternalAssetCompatibility,
declareGameboardPiecesFromCompatibilityReports,
createGameboardPieceRegistry,
createGameboardPieceSourceUrlMap,
} from 'declarative-hex-worlds';
const knightReport = await analyzeExternalAssetCompatibility({
assetUrl: '/assets/adventurers/knight.gltf',
intendedRole: 'unit',
});
const pieces = declareGameboardPiecesFromCompatibilityReports([
{ name: 'adventurer:knight', report: knightReport, role: 'unit' },
]);
const registry = createGameboardPieceRegistry(pieces);
const urlByAssetId = createGameboardPieceSourceUrlMap(registry, {
sourceRoots: { 'adventurers': '/assets/adventurers' },
});
  • GLTF inspection. Reads bounds, rig presence, animation clips, material slots from any GLTF; reports placement compatibility.
  • Piece declaration. Wraps the report into a GameboardPieceDeclaration that fits the manifest schema.
  • URL resolution. Per-source-pack URL maps so the renderer knows where to load each cross-kit asset from.