code wiki / (root) / nx_scene_contract.nx

nx_scene_contract.nx

buildroot/runtime/nx_scene_contract.nx

7206 B186 linesdepth 6pulls 7 transitivereach 2 importersview sourcekind librarytopic scene
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_tier.nx nx_procgen_preset.nx nx_scene_contract.nx nx_scene_contract_test.nx nx_scene_render.nx

imports: nx_syscalls.nxnx_tier.nxnx_procgen_preset.nx

imported by: nx_scene_contract_test.nxnx_scene_render.nx

structs

none

consts

25const NX_MAGIC_1103515245: i64 = 1103515245
26const NX_MAGIC_12345: i64 = 12345
27const NX_MAGIC_65536: i64 = 65536
28const NX_MAGIC_32768: i64 = 32768
31const NX_STYLE_REALISTIC: nx_int = 0
32const NX_STYLE_ANIME: nx_int = 1
33const NX_STYLE_CARTOON: nx_int = 2
34const NX_STYLE_VN: nx_int = 3
35const NX_STYLE_COUNT: nx_int = 4
45const NX_ENT_IDENTITY: nx_int = 0 // identity seed (provenance)
46const NX_ENT_KIND: nx_int = 1 // 0 = human (sealed for later kinds)
47const NX_ENT_HEIGHT_Q10: nx_int = 2 // canonical body height (Q10 of world relief)
48const NX_ENT_BUILD_Q10: nx_int = 3 // 768 slim .. 1280 broad (shoulder factor)
49const NX_ENT_SKIN_RGB: nx_int = 4 // 0xRRGGBB
50const NX_ENT_HAIR_RGB: nx_int = 5
51const NX_ENT_OUTFIT_RGB: nx_int = 6
52const NX_ENT_EYE_RGB: nx_int = 7
53const NX_ENT_ANCHOR_X: nx_int = 8 // world cell the feet stand on
54const NX_ENT_ANCHOR_Y: nx_int = 9
55const NX_ENT_POSE: nx_int = 10 // 0 standing (sealed for later poses)
56const NX_ENT_SLOTS: nx_int = 16
160const NX_SW_LAND: nx_int = 0 // *Landscape
161const NX_SW_STYLE: nx_int = 1
162const NX_SW_SEED: nx_int = 2
163const NX_SW_PRESET: nx_int = 3
164const NX_SW_SLOTS: nx_int = 8

functions

37func nx_style_is_valid(s: nx_int) -> nx_int
called by 1: nx_scene_world
59func _ent_lcg(state: *i64) -> nx_int
called by 1: nx_entity_human
68func _ent_skin(i: nx_int) -> nx_int
called by 1: nx_entity_human
76func _ent_hair(i: nx_int) -> nx_int
called by 1: nx_entity_human
85func _ent_outfit(i: nx_int) -> nx_int
called by 1: nx_entity_human
94func _ent_eye(i: nx_int) -> nx_int
called by 1: nx_entity_human
104func nx_entity_human(identity_seed: nx_int) -> *i64
127func nx_style_head_ratio_q10(style: nx_int) -> nx_int
called by 2: main_scn_entity
135func nx_style_px_height(style: nx_int) -> nx_int
called by 1: _scn_entity
141func nx_style_outline(style: nx_int) -> nx_int
called by 1: _scn_entity
146func nx_style_eyes(style: nx_int) -> nx_int
called by 1: _scn_entity
152func nx_style_terrain_bands(style: nx_int) -> nx_int
called by 1: _scn_terrain
166func nx_scene_world(world_seed: nx_int, preset: nx_int, style: nx_int) -> *i64
182func nx_scene_place(e: *i64, x: nx_int, y: nx_int) -> nx_int