code wiki / _hdl_build / nx_game_gen.nx
nx_game_gen.nx
buildroot/runtime/_hdl_build/nx_game_gen.nx
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
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
structs
| none |
consts
| none |
functions
| 19 | func 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 } |
| 20 | func 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 } |
| 25 | func p_wn(fd: i64, v: i64) -> i64 { nxi_fd(fd, v); return 0 } |
| 26 | func streq(a: *u8, b: *u8) -> i64 called by 1: tier_of |
| 32 | func 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 } |
| 35 | func tier_of(d: *u8) -> i64 |
| 43 | func build_spec_path(name: *u8, out: *u8) -> i64 called by 1: main |
| 57 | func write_fsm(fd: i64, noflee: i64) -> i64 |
| 82 | func main(argc: i64, argv: *i64) -> i64 |