code wiki / _hdl_build / nx_vn_critic.nx

nx_vn_critic.nx

buildroot/runtime/_hdl_build/nx_vn_critic.nx

6276 B103 linesdepth 3pulls 3 transitivereach 0 importersview sourcekind tooltopic vn
docsdependenciesstructsconstsfunctions

about

nx_vn_critic.nx -- the GAME-QUALITY CRITIC bot (the operator's vision: not a bot that BEATS the game, a bot that OPTIMIZES the game). It reads a VN as DATA and judges it like a reviewer of highly-rated visual novels, emitting ACTIONABLE design feedback + a score + an HONEST verdict that can say NEEDS-WORK: FUNCTIONALITY (must-pass): every scene reachable from the start, no broken choice links, >=2 endings. FUN / PACING (graded, grounded in VN norms): scene length ("~N words ~= Ns to read before you can act -- too long for a human to enjoy" past a threshold), ILLUSORY choices (options that all go to the same scene = the choice doesn't matter), branching/replay value (#endings), interactivity. It gates EVERY engine-owned VN (vn_sample + vn_sample2) so the whole published catalog is quality-verified, and optionally EMITS a VN's playable HTML. Build->CRITIQUE->fix->re-critique. license_tier: ORIGINAL expect_exit: 0

dependencies 2 imports · 0 importers

nx_vn.nx nx_syscalls.nx nx_vn_critic.nx

imports: nx_vn.nxnx_syscalls.nx

imported by: nobody (leaf or entry point)

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

main w sys_write gate_vn sys_mmap vn_sample vn_scene vn_choice vn_sample2 vn_scene ↻ vn_choice ↻ critique w ↻ wn w ↻ sys_mmap ↻ sys_write ↻ sys_mmap ↻ vn_emit_html vp vnum sys_mmap ↻ sys_mkdir sys_openat_wr sys_write ↻ sys_close vn_words sys_exit

structs

none

consts

12const MAX_MAGIC_131072: i64 = 131072
14const MAX_SCENE_WORDS: i64 = 120 // past this, the human is reading too long before the next beat/choice
15const SHIP_SCORE: i64 = 80

functions

17func w(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 }
called by 3: wncritiquemain calls 1: sys_write
18func wn(v: i64) -> i64 { var m: i64=v; if m<0{w("-" as *u8);m=0-m} let t:*u8=sys_mmap(24); var k:i64=0; if m==0{t[0]=48 as u8;k=1} while m>0{t[k]=(48+(m%10)) as u8;m=m/10;k=k+1} var i:i64=0; let o:*u8=sys_mmap(24); while i<k{o[i]=t[k-1-i];i=i+1} sys_write(1,o,k); return 0 }
called by 1: critique calls 3: wsys_mmapsys_write
21func critique(title: *u8, txt: *i64, nc: *i64, ct: *i64, cl: *i64, n: i64, emit_path: *u8) -> i64
84func gate_vn(id: i64, title: *u8, emit_path: *u8) -> i64
92func main(argc: i64, argv: *i64) -> i64