code wiki / (root) / nx_hammered_zone.nx

nx_hammered_zone.nx

buildroot/runtime/nx_hammered_zone.nx

23310 B538 linesdepth 2pulls 2 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_hammered_zone.nx -- heavily-impacted terrain generator. Eighth demonstration of the kind-specific-generator cardinal `feedback-kind-specific-generators-not-broad-noise`. The "this place has seen things" generator: meteor-strike fields with multiple overlapping craters, ancient battle sites with shattered stone, volcanic ruins with cooled lava, magical blast zones with crystalline shrapnel. Hammered-internal logic in v1: - Zone record (center + radius + intensity + hammer kind + seed) - Per-voxel query: applies chaotic height carving + material override based on hammer kind - 4 hammer kinds with characteristic carve pattern + material: METEOR_FIELD -- multiple overlapping impact craters, rubble material ANCIENT_BATTLE -- eroded shallow depressions + scattered stone fragments VOLCANIC_RUINS -- cooled lava flows + ash, irregular MAGIC_BLAST -- radial crystalline destruction pattern Composes with shipped nx_crater_field for METEOR_FIELD's multi- impact pattern (caller pre-generates crater list + passes count alongside hammered record). FULL CAPABILITY (per feedback-maximum-capability-no-simplification cardinal, 2026-05-16): - Smooth radial edge fade: from radius * 0.85 to radius, the carve + material amplitude ramps to 0 -- no hard boundary - METEOR_FIELD internal multi-crater field: generates N power- law-distributed sub-craters within the zone via the same algorithm as nx_crater_field (no external composition needed) - Scorched-vegetation predicate: nx_hammered_scorched_at returns 1 if a voxel falls in the vegetation-killing footprint of the hammer (so nx_forest_layout can suppress trees in burn zones) Loss audit: Q14 integer arithmetic; hash-deterministic per-pixel chaos within the zone. Soft radial edge eliminates hard rim. genealogy_id: melosh_1989_impact_cratering + neukum_1983_lunar_chronology +

dependencies 2 imports · 0 importers

nx_syscalls.nx nx_tier.nx nx_hammered_zone.nx

imports: nx_syscalls.nxnx_tier.nx

imported by: nobody (leaf or entry point)

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

main nx_hammer_kind_is_valid nx_hz_material_is_valid nx_hammered_carve_at nx_hammer_kind_is_valid ↻ _hz_edge_fade_q14 _hz_hash _hz_meteor_field_carve _hz_hash ↻ nx_hammered_material_at nx_hammer_kind_is_valid ↻ _hz_in_zone _hz_hash ↻ nx_hammered_scorched_at nx_hammer_kind_is_valid ↻ _hz_in_zone ↻ _hz_hash ↻

structs

none

consts

53const NX_MAGIC_2654435761: i64 = 2654435761
54const NX_MAGIC_1597334677: i64 = 1597334677
55const NX_MAGIC_7225: i64 = 7225
56const NX_MAGIC_10000: i64 = 10000
57const NX_MAGIC_6554: i64 = 6554
58const NX_MAGIC_9000: i64 = 9000
59const NX_MAGIC_16384: i64 = 16384
60const NX_MAGIC_1100: i64 = 1100
61const NX_MAGIC_4000: i64 = 4000
62const NX_MAGIC_5000: i64 = 5000
65const NX_HZ_Q: nx_int = 16384
68const NX_HZ_LCG_A: nx_int = 48271
69const NX_HZ_LCG_M: nx_int = 2147483647
72const NX_HAMMER_METEOR_FIELD: nx_int = 0
73const NX_HAMMER_ANCIENT_BATTLE: nx_int = 1
74const NX_HAMMER_VOLCANIC_RUINS: nx_int = 2
75const NX_HAMMER_MAGIC_BLAST: nx_int = 3
77const NX_HAMMER_KIND_COUNT: nx_int = 4
86const NX_HZ_MATERIAL_PASSTHROUGH: nx_int = 0
87const NX_HZ_MATERIAL_RUBBLE: nx_int = 1
88const NX_HZ_MATERIAL_SCORCHED: nx_int = 2
89const NX_HZ_MATERIAL_CRYSTALLINE: nx_int = 3
90const NX_HZ_MATERIAL_ASH: nx_int = 4
92const NX_HZ_MATERIAL_COUNT: nx_int = 5

functions

95func nx_hammer_kind_is_valid(k: nx_int) -> nx_int
103func nx_hz_material_is_valid(m: nx_int) -> nx_int
called by 1: main
113func _hz_hash(seed: nx_int, x: nx_int, y: nx_int) -> nx_int
124func _hz_in_zone(
139func _hz_edge_fade_q14(
172func _hz_meteor_field_carve(
called by 1: nx_hammered_carve_at calls 1: _hz_hash
238func nx_hammered_carve_at(
304func nx_hammered_scorched_at(
343func nx_hammered_material_at(
380func main() -> i64