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

Minefields spawn fix #39505

Merged
merged 6 commits into from
Apr 13, 2020
Merged

Minefields spawn fix #39505

merged 6 commits into from
Apr 13, 2020

Conversation

Night-Pryanik
Copy link
Contributor

Summary

SUMMARY: Bugfixes "Made "minefield" map extra actually spawn."

Purpose of change

Closes #38289 - Minefields don't spawn.

Describe the solution

Previously minefield map extra's conditions were so strict that effectively it won't spawn at all. Every road overmap terrain had to roll one-in-75 = 1.33% check to decide whether this particular location should spawn map extra at all. If this 1-percent roll succeeded, an attempt to select mx_minefield map extra from a set is made. mx_minefield has a weight of 80, and there is plenty of other map extras with this weight or even larger in this set. If we're lucky to successfully roll these two checks on a particular road overmap terrain, we then need to check if this OT has a bridge nearby. The resulting chance to successfully all satisfy these three checks was very tiny. So I reworked the conditions to make this map extra actually spawn.

Created a separate bridge set of map extras and filled it with mx_minefield map extra with 20% chance to spawn on every bridge entry. Updated most coordinates in map extra's mapgen to reflect change from road to bridge spawning location.

Describe alternatives you've considered

None.

Testing

Teleported around map to find bridges, checked these bridges' entries for spawning of minefields.

Additional context

The chance to spawn (currently 20% per every bridge entry) could be lowered or increased if needed.

Thanks @ralreegorganon for looking into matter of this issue and explaining me how to fix it.

Filled it with the sole "minefield" map extra with 20% chance to spawn on every bridge entry
@Night-Pryanik Night-Pryanik added Map / Mapgen Overmap, Mapgen, Map extras, Map display Spawn Creatures, items, vehicles, locations appearing on map <Bugfix> This is a fix for a bug (or closes open issue) labels Apr 12, 2020
@jbytheway
Copy link
Contributor

Hopefully the test in map_extra_test now passes reliably? If so, please remove the [!mayfail] tag therefrom.

@Night-Pryanik
Copy link
Contributor Author

Yes, test passes now. Updated tests file, removed theoretical spawn case.

@ralreegorganon
Copy link
Contributor

I don't see a reason to nuke the mx_minefield theorertical spawn case--just update the setup in it so that it sets up a valid case again, reflecting the changes you made for it to pass.

@kevingranade kevingranade merged commit 7c10b35 into CleverRaven:master Apr 13, 2020
@Night-Pryanik Night-Pryanik deleted the minefields-spawn-fix branch April 13, 2020 15:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
<Bugfix> This is a fix for a bug (or closes open issue) Map / Mapgen Overmap, Mapgen, Map extras, Map display Spawn Creatures, items, vehicles, locations appearing on map
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Minefields don't spawn
4 participants