Add Danger Ores - City Blocks map#1572
Conversation
A grid of isolated 4x4-chunk one-ore rooms (stone rooms rare) separated by paved rail corridors carrying a ready-made double-track network: continuous lines ring every room and cross at every corner. The rails are ordinary and minable -- a head start, not a constraint. Only rail infrastructure (rails, signals, train stops, power poles) and trains can be built on the corridors, and belts cannot span them: trains are the only inter-room logistics. The spawn room carries all four ores, one per quadrant, and rail techs come pre-researched with a starter train kit. Includes map preview. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
RedRafe
left a comment
There was a problem hiding this comment.
I've left a few suggestions. Additionally, have you tested this map by saving, closing, & reloading the savefile?
| local ORE_WEIGHTS = { 3, 3, 3, 1 } | ||
| local ORE_WEIGHT_TOTAL = 10 |
There was a problem hiding this comment.
Shouldn't theses be computed from danger_ores/config/*_ores.lua?
I think it would be better for reusability if this module could accept ore config as input to be reused in other presets
|
|
||
| -- === strip placement rule ================================================== | ||
|
|
||
| local ALLOWED_ON_STRIP = { |
There was a problem hiding this comment.
for allowed entities, I think it would be better for mod compatibility if it was whitelisted by LuaEntity::type and not by LuaEntity::name.
Also, you could look at entity_placement_restriction module that already implements entity destroying/saving, just need to pass the validation function to it which you already have
| -- Order is significant: it maps to room ore indices 1..4 from the city_blocks module. | ||
| -- Heavier dominant ratio (85/15) than the vanilla sectors: each room is meant to be | ||
| -- one resource, so hauling between rooms by train stays essential. | ||
| return { |
There was a problem hiding this comment.
Adding this comment here but I think it covers last 5 maps: each maps doesnt necessarily need a new ore config, especially if it's vanilla.
Having 4x files with same vanilla ore distribution (iron>copper>coal>stone) does not carry any benefit, especially if we decide to tweak ore percentages, having 1 file with all the ore numbers is easier to maintain.
Evaluate if it's possible to remove the latest ore configs in favor of using vanilla_ores.lua (yes, stone is "missing" but stone is not really used aside from SpaceAge
| return | ||
| end | ||
| data.generated = true | ||
| assign_ores() |
There was a problem hiding this comment.
Not sure what the usage of data.generated is since it's only read and assigned once here and nowhere else. on_init functions will only run once on_init so no need to check that, can simply pass Event.on_init(assign_ores)
…eric ore count - Drop city_blocks_ores.lua in favor of the shared vanilla_ores config (rooms now iron/copper/coal; stone stays in the mixed ratios) - register(config) derives ore count from the passed config; optional room_ore_weights; spawn quadrants split whatever ores exist - Corridor rule now runs through the shared entity_placement_restriction module (type-based whitelist, ghosts/refunds handled there) - Drop redundant data.generated flag; Event.on_init(assign_ores) directly Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Thanks for the review! All four points addressed in the new commit:
Save/close/reload tested on the local scenario (both before and after these changes) — layout, room ores and corridor rules all persist correctly; the layout lives in Global so nothing regenerates. Also refreshed the preview image to match the current map. |
|
Thanks for applying the changes! Looks good
Happy to accept follow-up PRs if you want to. I see two issues hanging:
|
Danger Ores – City Blocks
It's always been a little sad how little use trains get on danger ores maps — belts rule everything. Maybe this map changes that.
A grid of isolated one-ore rooms (4×4 chunks; stone rooms rare) separated by paved rail corridors carrying a ready-made double-track network: continuous lines ring every room and meet at a signalled roundabout on every corner. The rails are ordinary and minable — a head start, not a constraint. Only rail infrastructure (rails, signals, train stops, power poles) and trains can be built on the corridors, and belts cannot span them: trains are the only inter-room logistics.
Details
modules/city_blocks.luagenerates everything chunk-locally (no cross-chunk writes, generation-order independent); room ores assigned once on init (weighted, BFS-guaranteed all four ores adjacent to spawn).map_poll.lua(danger_ore_normal) and the danger ores changelog.Play it
return require 'map_gen.maps.danger_ores.presets.danger_ore_city_blocks'Testing
Layout harness (ore coverage/weighting/spawn guarantee) + playtested in-game through several iterations: corridors, roundabouts, signals, train routing, build restrictions.
🤖 Generated with Claude Code