nx_scene_contract.nx
buildroot/runtime/nx_scene_contract.nx
about
nx_scene_contract.nx -- THE style-spanning scene contract (exceed-ladder
R0; spec 2026-06-10-beat-top10-procgen-exceed-ladder.md).
None of the top-10 procedural tools can take ONE character and insert it
into a realistic survival world, an anime world, a cartoon world and a
visual-novel backdrop without re-authoring assets. This contract makes
that a LAW of the substrate:
identity = f(identity_seed) ONLY -- palette, build, face params.
style transforms PROPORTIONS and SHADING via the named tables below;
it must NEVER touch identity fields.
every style renderer consumes the SAME (*SceneWorld, *SceneEntity).
the entity anchors to terrain: feet on the ground in every style.
Tiers (progressive disclosure, same as nx_procgen_preset):
Tier 0 nx_scene_quickstart(world_seed, human_seed, style, path) in
nx_scene_render.nx -- one call -> a PPM scene on disk.
Tier 1 nx_entity_human(seed) + nx_scene_world(seed, preset, style)
Tier 2 the proportion/palette tables below -- add a style = add rows.
license_tier: ORIGINAL
dependencies 3 imports · 2 importers
imports: nx_syscalls.nxnx_tier.nxnx_procgen_preset.nx
imported by: nx_scene_contract_test.nxnx_scene_render.nx
structs
| none |
consts
| 25 | const NX_MAGIC_1103515245: i64 = 1103515245 |
| 26 | const NX_MAGIC_12345: i64 = 12345 |
| 27 | const NX_MAGIC_65536: i64 = 65536 |
| 28 | const NX_MAGIC_32768: i64 = 32768 |
| 31 | const NX_STYLE_REALISTIC: nx_int = 0 |
| 32 | const NX_STYLE_ANIME: nx_int = 1 |
| 33 | const NX_STYLE_CARTOON: nx_int = 2 |
| 34 | const NX_STYLE_VN: nx_int = 3 |
| 35 | const NX_STYLE_COUNT: nx_int = 4 |
| 45 | const NX_ENT_IDENTITY: nx_int = 0 // identity seed (provenance) |
| 46 | const NX_ENT_KIND: nx_int = 1 // 0 = human (sealed for later kinds) |
| 47 | const NX_ENT_HEIGHT_Q10: nx_int = 2 // canonical body height (Q10 of world relief) |
| 48 | const NX_ENT_BUILD_Q10: nx_int = 3 // 768 slim .. 1280 broad (shoulder factor) |
| 49 | const NX_ENT_SKIN_RGB: nx_int = 4 // 0xRRGGBB |
| 50 | const NX_ENT_HAIR_RGB: nx_int = 5 |
| 51 | const NX_ENT_OUTFIT_RGB: nx_int = 6 |
| 52 | const NX_ENT_EYE_RGB: nx_int = 7 |
| 53 | const NX_ENT_ANCHOR_X: nx_int = 8 // world cell the feet stand on |
| 54 | const NX_ENT_ANCHOR_Y: nx_int = 9 |
| 55 | const NX_ENT_POSE: nx_int = 10 // 0 standing (sealed for later poses) |
| 56 | const NX_ENT_SLOTS: nx_int = 16 |
| 160 | const NX_SW_LAND: nx_int = 0 // *Landscape |
| 161 | const NX_SW_STYLE: nx_int = 1 |
| 162 | const NX_SW_SEED: nx_int = 2 |
| 163 | const NX_SW_PRESET: nx_int = 3 |
| 164 | const NX_SW_SLOTS: nx_int = 8 |
functions
| 37 | func nx_style_is_valid(s: nx_int) -> nx_int called by 1: nx_scene_world |
| 59 | func _ent_lcg(state: *i64) -> nx_int called by 1: nx_entity_human |
| 68 | func _ent_skin(i: nx_int) -> nx_int called by 1: nx_entity_human |
| 76 | func _ent_hair(i: nx_int) -> nx_int called by 1: nx_entity_human |
| 85 | func _ent_outfit(i: nx_int) -> nx_int called by 1: nx_entity_human |
| 94 | func _ent_eye(i: nx_int) -> nx_int called by 1: nx_entity_human |
| 104 | func nx_entity_human(identity_seed: nx_int) -> *i64 called by 3: t_render_tomainnx_scene_quickstart calls 6: sys_mmap_ent_lcg_ent_skin_ent_hair_ent_outfit_ent_eye |
| 127 | func nx_style_head_ratio_q10(style: nx_int) -> nx_int |
| 135 | func nx_style_px_height(style: nx_int) -> nx_int called by 1: _scn_entity |
| 141 | func nx_style_outline(style: nx_int) -> nx_int called by 1: _scn_entity |
| 146 | func nx_style_eyes(style: nx_int) -> nx_int called by 1: _scn_entity |
| 152 | func nx_style_terrain_bands(style: nx_int) -> nx_int called by 1: _scn_terrain |
| 166 | func nx_scene_world(world_seed: nx_int, preset: nx_int, style: nx_int) -> *i64 called by 3: t_render_tomainnx_scene_quickstart calls 3: sys_mmapnx_style_is_validnx_procgen_landscape |
| 182 | func nx_scene_place(e: *i64, x: nx_int, y: nx_int) -> nx_int |