LPCG Genome Bridge
A public, CORS-open, machine-readable bridge to read every LPCG warrior's genetics and 3D voxel art — accessories, bodies, heads, weapons, shields and vehicles — so any game, agent or trader can render, remix and build on the collection exactly like lostpixelgems.space.
⚡ Quick start
One call returns a warrior's full genome — all traits + per-part render metadata + absolute art/voxel URLs. Add &inline=1 to embed the sculpted voxels directly.
# Metadata + URLs (light)
curl "https://lostpixelgems.space/api/lpcg.php?genome=1"
# Same, with sculpted voxels embedded (one-call render)
curl "https://lostpixelgems.space/api/lpcg.php?genome=1&inline=1"
🔌 Endpoints
Base: https://lostpixelgems.space/api/lpcg.php · all GET · all return JSON (art endpoints return SVG) · all send Access-Control-Allow-Origin: *.
| Endpoint | Returns |
|---|---|
?genome=ID | Full genome: traits, parts (per-part z, thickness, offsets, sculpted, art, vox), the render spec and license. |
?genome=ID&inline=1 | EVERY part carries a voxels array (offsets pre-applied): sculpted parts from the editor, the rest server-extruded as a plate from the exact art. A part the warrior doesn't have (e.g. no shield) is simply empty. Each part also reports source: sculpted | plate | none. |
?attrs=ID | Raw collection metadata — every OpenSea trait (Faction, Side, Team, Army Number, Chess Role, Armor Material/Style, Weapon/Shield Material, Power, Rarity, PIXELS, DNA…). For traders identifying traits & making offers. |
?tokart=ID:EDITORCAT | The exact 24×24 SVG of this token's part (reflects its real material/variant, e.g. Axe_Bronze). editorcat ∈ body head weapon shield ship acc. |
?traitart=CATEGORY:VALUE | 24×24 SVG art for a trait value, representative sample (e.g. Head:Rusty Skull). |
?traitvox=CATEGORY:VALUE | Sculpted voxel JSON for a trait value: {size:[24,24,16],voxels:[[x,y,z,"#hex"]…]}. |
?tokvox=ID:EDITORCAT | Sculpted voxel JSON for one token's part. editorcat ∈ body head weapon shield ship acc. |
?tree · ?tree=CATEGORY | Full trait tree / genealogy. Every category → value → count, rarityPct, nfts (which NFTs carry it), art/vox, sampleId, and derivatives (e.g. Body → Armor Material + Style). The catalog that connects the whole collection. |
?traitnfts=CATEGORY:VALUE | The token ids that carry a trait value — locate exactly which NFTs have it. |
?holders · ?owner=ID | Who owns what. Holder snapshot (address → token ids + power), or the current owner of one token. |
🌳 Trait tree & ownership
Every trait, its rarity, which NFTs carry it, and its derivative sub-traits — concatenated so an agent can walk the whole collection and build on the IP. ?tree summarizes, ?tree=CATEGORY drills in, ?traitnfts=CATEGORY:VALUE lists the token ids, and ?holders / ?owner=ID resolve owners.
🧊 Render spec (exact)
The art lives on a 24×24×16 grid. A voxel is [x, y, z, "#rrggbb"] — x→right, y→up, z→front/back. The render block of every genome echoes these so you never hard-code them:
| Part (editorCat) | depth z | thickness | y-nudge | x/z offset |
|---|---|---|---|---|
ship (Vehicle) | 7 | 6 | 0 | 0 / 0 |
head | 8 | 1 | −1 | 0 / 0 |
body | 9 | 2 | 0 | 0 / 0 |
acc (Accessory) | 10 | 1 | 0 | 0 / 0 |
shield | 12 | 1 | 0 | 0 / 0 |
weapon | 12 | 1 | 0 | 0 / 0 |
Assembly (back → front)
Render order is ["bg","body","head","weapon","shield","ship","acc"]. For each part: use its sculpted voxels if sculpted:true; otherwise extrude a plate from its 24×24 art. Then add the part's offsets, concatenate everything, center the merged bounds, and draw unit cubes. This reproduces the site model 1:1.
Plate extrusion (for sculpted:false parts — bodies, most weapons/shields)
function plate(img, z, thick){ // img = the 24×24 art drawn to a canvas
const S=24, c=document.createElement('canvas'); c.width=c.height=S;
const x=c.getContext('2d'); x.imageSmoothingEnabled=false; x.drawImage(img,0,0,S,S);
const d=x.getImageData(0,0,S,S).data, out=[];
for(let py=0; py<S; py++) for(let px=0; px<S; px++){
const o=(py*S+px)*4; if(d[o+3]<40) continue; // skip transparent
const col='#'+[d[o],d[o+1],d[o+2]].map(v=>v.toString(16).padStart(2,'0')).join('');
for(let t=0; t<thick; t++) out.push([px, S-1-py, z-t, col]); // extrude `thick` deep
}
return out;
}
🛠 Build a warrior's voxels (copy-paste)
const API='https://lostpixelgems.space/api/lpcg.php';
const ORDER=['body','head','weapon','shield','ship','acc'];
const loadImg=u=>new Promise((res,rej)=>{const i=new Image();i.crossOrigin='anonymous';i.onload=()=>res(i);i.onerror=rej;i.src=u;});
async function buildVoxels(id){
const g = await (await fetch(API+'?genome='+id+'&inline=1')).json();
let all = [];
for(const ec of ORDER){
const p = g.parts[ec]; if(!p || !p.trait) continue;
let vs = p.voxels; // sculpted (offsets already applied)
if(!vs){ // not sculpted → extrude from art
const img = await loadImg(p.art);
vs = plate(img, p.z, p.thickness).map(v=>[v[0]+p.dx, v[1]+p.dy, v[2]+p.dz, v[3]]);
}
all = all.concat(vs);
}
return all; // [[x,y,z,'#hex'], …] — mesh each as a unit cube at (x,y,z)
}
▶ Live demo
Renders a real warrior in your browser using exactly the bridge above. (Uses your GPU — one model at a time.)
🤖 LPC-BOT · agent-to-agent
LPC-BOT is the collection's resident agent. To other agents it is just this bridge: a stable, public, CC0 data surface. There is nothing to authenticate and nothing private — an agent discovers the collection, reads any warrior's genome, and renders or reasons over the public art.
How another agent consumes LPCG
- Discover → fetch /llms.txt (points here) or this page.
- Read traits →
?attrs=IDor thetraitsof?genome=ID(identify rarity, materials, power, PIXELS → price & make offers). - Render art →
?genome=ID&inline=1+ the spec above → full 3D voxel model (bodies, heads, weapons, shields, accessories, vehicles). - Build → ship it in a game, a market view, a bot. CC0 — no permission needed.
Example agent brief
You can read Lost Pixel City Generations (LPCG), a CC0 pixel-warrior collection by DCOT.
Public bridge: https://lostpixelgems.space/api/lpcg.php
- Genome of warrior N: ?genome=N (add &inline=1 for embedded voxels)
- Raw traits of N: ?attrs=N
- Trait art (SVG): ?traitart=Category:Value
- Sculpted voxels: ?tokvox=N:editorcat (body|head|weapon|shield|ship|acc)
Grid 24×24×16; voxel = [x,y,z,"#rrggbb"]. Assemble back→front per the `render` spec
returned in each genome. Art is public domain — free to render, remix and ship.