code wiki / _hdl_build / nx_game_gen.nx

nx_game_gen.nx

buildroot/runtime/_hdl_build/nx_game_gen.nx

5827 B133 linesdepth 3pulls 3 transitivereach 0 importersview sourcekind tooltopic game
docsdependenciesstructsconstsfunctions

about

nx_game_gen.nx -- the GENERATIVE game front-end ("mythos level"): a high-level INTENT (theme + difficulty) in, a complete game-SPEC out. This is the top of the Nishi game ecosystem: you author at the description level; nx_game_gen writes the data game-spec, nx_game_emit turns the spec into a per-game module, nx_game_engine_lib runs it native. So the whole chain is: describe -> spec -> playable game, hands-off. usage: nx_game_gen <name> <THEME> <difficulty> name module name, e.g. _game_forest THEME one word, becomes the title "THE <THEME>" difficulty easy | normal | hard | nightmare (scales walls/foes/hp/dmg/loot; hard+ use a NO-FLEE combat FSM = scarier) Writes knowledge/specs/<name>.spec. HONEST: this front-end is TUTOR tooling; the GAME it leads to is emitter output. Difficulty->params is a deterministic design table (no magic numbers buried in logic -- the tiers ARE the data). license_tier: ORIGINAL

dependencies 2 imports · 0 importers

nx_syscalls.nx nx_itoa_lib.nx nx_game_gen.nx

imports: nx_syscalls.nxnx_itoa_lib.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main p_w sys_write sys_exit tier_of streq sys_mmap build_spec_path sys_openat_wr p_wn nxi_fd sys_mmap ↻ ccz_cat_num sys_write ↻ sys_munmap p_c sys_mmap ↻ sys_write ↻ sp_kv p_w ↻ p_c ↻ p_wn ↻ write_fsm sys_mmap ↻ p_w ↻ p_c ↻ p_wn ↻ sys_close

structs

none

consts

none

functions

19func p_w(fd: i64, s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(fd, s, n); return 0 }
called by 3: sp_kvwrite_fsmmain calls 1: sys_write
20func p_c(fd: i64, c: i64) -> i64 { let b: *u8 = sys_mmap(8); b[0] = c as u8; sys_write(fd, b, 1); return 0 }
25func p_wn(fd: i64, v: i64) -> i64 { nxi_fd(fd, v); return 0 }
called by 3: sp_kvwrite_fsmmain calls 1: nxi_fd
26func streq(a: *u8, b: *u8) -> i64
called by 1: tier_of
32func sp_kv(fd: i64, key: *u8, val: i64) -> i64 { p_w(fd, key); p_c(fd, 32); p_wn(fd, val); p_c(fd, 10); return 0 }
called by 1: main calls 3: p_wp_cp_wn
35func tier_of(d: *u8) -> i64
called by 1: main calls 1: streq
43func build_spec_path(name: *u8, out: *u8) -> i64
called by 1: main
57func write_fsm(fd: i64, noflee: i64) -> i64
called by 1: main calls 4: sys_mmapp_wp_cp_wn
82func main(argc: i64, argv: *i64) -> i64