nx_hammered_zone.nx
buildroot/runtime/nx_hammered_zone.nx
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
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
structs
| none |
consts
| 53 | const NX_MAGIC_2654435761: i64 = 2654435761 |
| 54 | const NX_MAGIC_1597334677: i64 = 1597334677 |
| 55 | const NX_MAGIC_7225: i64 = 7225 |
| 56 | const NX_MAGIC_10000: i64 = 10000 |
| 57 | const NX_MAGIC_6554: i64 = 6554 |
| 58 | const NX_MAGIC_9000: i64 = 9000 |
| 59 | const NX_MAGIC_16384: i64 = 16384 |
| 60 | const NX_MAGIC_1100: i64 = 1100 |
| 61 | const NX_MAGIC_4000: i64 = 4000 |
| 62 | const NX_MAGIC_5000: i64 = 5000 |
| 65 | const NX_HZ_Q: nx_int = 16384 |
| 68 | const NX_HZ_LCG_A: nx_int = 48271 |
| 69 | const NX_HZ_LCG_M: nx_int = 2147483647 |
| 72 | const NX_HAMMER_METEOR_FIELD: nx_int = 0 |
| 73 | const NX_HAMMER_ANCIENT_BATTLE: nx_int = 1 |
| 74 | const NX_HAMMER_VOLCANIC_RUINS: nx_int = 2 |
| 75 | const NX_HAMMER_MAGIC_BLAST: nx_int = 3 |
| 77 | const NX_HAMMER_KIND_COUNT: nx_int = 4 |
| 86 | const NX_HZ_MATERIAL_PASSTHROUGH: nx_int = 0 |
| 87 | const NX_HZ_MATERIAL_RUBBLE: nx_int = 1 |
| 88 | const NX_HZ_MATERIAL_SCORCHED: nx_int = 2 |
| 89 | const NX_HZ_MATERIAL_CRYSTALLINE: nx_int = 3 |
| 90 | const NX_HZ_MATERIAL_ASH: nx_int = 4 |
| 92 | const NX_HZ_MATERIAL_COUNT: nx_int = 5 |
functions
| 95 | func nx_hammer_kind_is_valid(k: nx_int) -> nx_int |
| 103 | func nx_hz_material_is_valid(m: nx_int) -> nx_int called by 1: main |
| 113 | func _hz_hash(seed: nx_int, x: nx_int, y: nx_int) -> nx_int |
| 124 | func _hz_in_zone( |
| 139 | func _hz_edge_fade_q14( called by 1: nx_hammered_carve_at |
| 172 | func _hz_meteor_field_carve( |
| 238 | func nx_hammered_carve_at( |
| 304 | func nx_hammered_scorched_at( |
| 343 | func nx_hammered_material_at( |
| 380 | func main() -> i64 |