Add Danger Ores - Voronoi map#1568
Merged
Merged
Conversation
A new Danger Ores variation whose ore field is partitioned into irregular Voronoi cells. Each cell is flooded with one main ore ([item=iron-ore] [item=copper-ore] [item=coal] [item=stone]) plus the usual minor mix; no two touching cells share a main ore, and every map seed produces a fresh arrangement. Layout engine (modules/voronoi_layout.lua, pure Lua / unit-tested): places jittered-grid seed points on a toroidal super-tile (seeded from the map), runs Lloyd relaxation for even cells, assigns each tile to its nearest seed (smooth, tile-resolution boundaries), then 4-colours the cell-adjacency graph with DSATUR so adjacent cells never share an ore. The layout rebuilds deterministically from the map seed, so nothing is persisted. Stone is kept scarce by using the 4th colour only when forced. Includes builder, preset, 4-ore config, scenario template, and a map preview. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
So players can vote for the map (matches the review on the Tetrominoes PR). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
Author
|
Registered Voronoi in |
grilledham
approved these changes
Jul 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Danger Ores – Voronoi
A new Danger Ores preset where the ore field is partitioned into irregular Voronoi cells. Each cell is one main ore (iron / copper / coal / stone) with the others sprinkled in at low ratio — no two touching cells share a main ore, so every cell border is a colour change. Every map seed lays the cells out differently.
How it works
modules/voronoi_layout.lua— pure-Lua layout engine (no Factorio deps, standalone test file). Places jittered-grid seeds on a toroidal super-tile (seeded from the map), runs Lloyd relaxation for even cells, assigns each tile to its nearest seed (smooth, tile-resolution boundaries), then 4-colours the cell-adjacency graph (DSATUR, lowest-first so stone stays scarce). Guarantees: full coverage, clean borders, deterministic from the map seed (nothing persisted).modules/main_ores_voronoi.lua— builder;CELL_SIZE,SEED_SPACING,RELAXATIONknobs.config/voronoi_ores.lua,presets/danger_ore_voronoi.lua,scenario_templates/danger-ore-voronoi/.Everything else (spawn, terraforming, water, enemies, build-on-ore rules) inherits the Danger Ores defaults.
Play it
return require 'map_gen.maps.danger_ores.presets.danger_ore_voronoi'Testing
lua map_gen/maps/danger_ores/modules/voronoi_layout.test.lua): full coverage, deterministic relaxation, clean borders (incl. torus wrap), determinism, 25-seed success at production size, stone-is-rarest.🤖 Generated with Claude Code