code wiki / _hdl_build / nx_game_companion.nx

nx_game_companion.nx

buildroot/runtime/_hdl_build/nx_game_companion.nx

5319 B137 linesdepth 3pulls 6 transitivereach 9 importersview sourcekind librarytopic game
docsdependenciesstructsconstsfunctions

about

nx_game_companion.nx -- the OWNERSHIP core of the beat-Veloren companion-collector. The research (SDT + operator's pillars, gamebench round 14) says Veloren wins on AUTONOMY but has no OWNERSHIP; the endowment effect (Pokemon) is the pillar we can build because our certified parts already hold its substrate. This part composes them into a companion whose OWNERSHIP is STRUCTURALLY REAL and MEASURABLE: - UNIQUE by construction (a per-companion rolled trait vector; no two alike -- the IV/nature equiv), - PERSISTENT (rides nx_gamesave bit-exact -- what you own does not evaporate), - INVESTMENT-DIVERGENT (nx_rpgstats: what you pour XP into grows distinct -- the IKEA effect), - individually addressed (nx_entity_store handle=index+generation; a companion is a THING, not a row). ⚠HONEST SCOPE: these are the measurable PREREQUISITES for the endowment effect, NOT the psychological bond itself (unmeasurable). A game can have all three and still feel hollow; but a game LACKING them cannot produce ownership at all -- so they are necessary, gate-able, and red-teamable. LIB, no main. license_tier: ORIGINAL

dependencies 4 imports · 3 importers

nx_syscalls.nx nx_entity_store.nx nx_rpgstats.nx nx_gamesave.nx nx_game_companion.nx nx_creature_demo.nx nx_game_breed.nx nx_game_companion_gate.nx

imports: nx_syscalls.nxnx_entity_store.nxnx_rpgstats.nxnx_gamesave.nx

imported by: nx_creature_demo.nxnx_game_breed.nxnx_game_companion_gate.nx

structs

none

consts

17const COMP_MAGIC_2654435761: i64 = 2654435761
18const COMP_MAGIC_40503: i64 = 40503
20const COMP_NC: i64 = 8 // components
21const C_SPEC: i64 = 0
22const C_IV0: i64 = 1
23const C_IV1: i64 = 2
24const C_IV2: i64 = 3
25const C_IV3: i64 = 4
26const C_XP: i64 = 5
27const C_LVL: i64 = 6
28const C_NICK: i64 = 7
29const COMP_NSPEC: i64 = 6
30const COMP_XB: i64 = 20
31const COMP_XQ: i64 = 10
32const COMP_HPB: i64 = 10
33const COMP_HPC: i64 = 2
34const COMP_HPL: i64 = 4

functions

36func comp_rng(s: i64) -> i64
called by 1: comp_new_roster
46func comp_new_roster(ros: *i64, cap: i64, n: i64, seed: i64, variety: i64) -> i64
70func comp_vec(ros: *i64, h: i64) -> i64
79func comp_dup_count(ros: *i64) -> i64
called by 2: mainmain calls 3: en_counten_nthcomp_vec
99func comp_invest(ros: *i64, h: i64, xp: i64) -> i64
106func comp_power(ros: *i64, h: i64) -> i64
called by 2: mainmain calls 2: en_getrs_derived_hp
112func comp_serialize(ros: *i64, S: *i64) -> i64
called by 2: mainmain calls 3: en_counten_nthen_get
125func comp_restore(ros: *i64, cap: i64, S: *i64) -> i64
called by 2: mainmain calls 3: en_initen_spawnen_set