Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix map gen settings #1480

Merged
merged 1 commit into from
Jan 2, 2025
Merged

Conversation

RedRafe
Copy link
Contributor

@RedRafe RedRafe commented Jan 2, 2025

IIRC, in 1.1 the default map gen settings were not specified (other than ore patches), so our system to build redmew surface relied on whitelisting new properties to make sand-only, grass-only maps.
In 2.0, all properties are always listed by default, so whitelisting same properties would only overwrite existing ones, but fails at excluding those unwanted (i.e. passing the preset "grass_only" with whitelisted grass tiles would not have any effect as those are already enabled, and so are other unwanted tiles like sand...).

So I've added a check and if any of the map gen presets we're applying is blacklisting others (treat_missing_as_default = false) it will proceed to empty that property in the default's nauvis preset, so whitelisting would now work again.

I'm not 100% convinced this is best practice (especially with mods, what if they already added their settings we're not accounting for?). On the other hand, this is how 1.1 worked, and if maps have very special needs needs regarding MGS, they will simply take care themselves and/or pass those additional parameters to the merge table.

So far I've tested it with a handful of our maps, modded and not, and everything seems to work as expected (some decoratives might seem off sometimes, maybe this will need further customization to pass decorative presets along with tile presets, but not a relevant issue imo).

I've tested it with these maps:

--return require 'scenario_templates.minimal.map_selection'
--return require 'map_gen.maps.frontier.scenario'
--return require 'map_gen.maps.crash_site.presets.normal'
--return require 'map_gen.maps.crash_site.presets.arrakis'
--return require 'map_gen/maps/april_fools/2024'
--return require 'map_gen/maps/danger_ores/presets/danger_ore_patches'
--return require 'map_gen/maps/danger_ores/presets/danger_ore_landfill'
--return require 'map_gen/maps/danger_ores/presets/danger_ore_gradient'
--return require 'map_gen/maps/diggy/presets/danger_ores'

Here's a BEFORE --> AFTER w/ normal crash site (uses grass_only). Before it's just standard Nauvis, and after the changes it's effectively grass-only

Screenshot from 2025-01-02 12-18-50

@grilledham grilledham merged commit 70af05f into Refactorio:develop Jan 2, 2025
1 check passed
@RedRafe RedRafe deleted the map-gen-settings branch January 3, 2025 09:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants