Add Danger Ores - Tetrominoes map#1567
Merged
Merged
Conversation
A new Danger Ores variation whose ore field is tiled by interlocking tetrominoes. Each piece is flooded with one main ore ([item=iron-ore] [item=copper-ore] [item=coal] [item=stone]) plus the usual minor mix; no two touching pieces share a main ore, and every map seed produces a fresh arrangement. Layout engine (modules/tetromino_layout.lua, pure Lua / unit-tested): packs a toroidal super-tile with all seven tetrominoes via a 4x4-block base tiling randomised by local flips (brute-force exact cover is intractable), then 4-colours the pieces with DSATUR so adjacent pieces 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, and scenario template. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Collaborator
|
Need to add the map here too: https://github.com/Refactorio/RedMew/blob/develop/map_gen/maps/danger_ores/modules/map_poll.lua |
Addresses review: add the map to map_poll.lua so players can vote for it. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
Author
|
Good catch, thanks! Added Tetrominoes to |
grilledham
approved these changes
Jul 6, 2026
grilledham
left a comment
Collaborator
There was a problem hiding this comment.
Looks good, thanks for the contribution!
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 – Tetrominoes
A new Danger Ores preset where the ore field is a giant interlocking tetromino mosaic. Each tetromino piece is one main ore (iron / copper / coal / stone) with the others sprinkled in at low ratio — and no two touching pieces share a main ore, so every piece border is a colour change. Every map seed lays the pieces out differently.
How it works
modules/tetromino_layout.lua— pure-Lua layout engine (no Factorio deps, has a standalone test file). It packs a 32-cell toroidal super-tile using all seven tetrominoes: a 4×4-block base tiling (117 possible fills per block) randomised by local 4×4 "flips", then a DSATUR backtracking 4-colouring so adjacent pieces differ. Guarantees: 100% tetromino coverage, clean borders, deterministic from the map seed (rebuilds identically on load — nothing stored inglobal).modules/main_ores_tetrominoes.lua— builder mapping each chunk to a piece/ore;CELL_SIZEcontrols piece scale.config/tetromino_shapes.lua,config/tetromino_ores.lua,presets/danger_ore_tetrominoes.lua,scenario_templates/danger-ore-tetrominoes/.Everything else (spawn, terraforming, water, enemies, win condition) inherits the Danger Ores defaults, like the other presets. Stone is kept scarce by using the 4th colour only when it's forced.
Play it
return require 'map_gen.maps.danger_ores.presets.danger_ore_tetrominoes'Testing
lua map_gen/maps/danger_ores/modules/tetromino_layout.test.lua): orientation generation, full coverage, every piece exactly 4 cells, clean borders (incl. torus wrap), determinism, and success across 25 seeds at production size.🤖 Generated with Claude Code