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

ruins_4x4_camp: Fix intermittent CI error #55636

Merged
merged 1 commit into from
Feb 25, 2022

Conversation

hexagonrecursion
Copy link
Contributor

@hexagonrecursion hexagonrecursion commented Feb 24, 2022

WIP: this PR includes #55627 to (hopefully) get green CI (pray with me, if you are religious)

Summary

None

Purpose of change

CI has failed on me twice with:

ERROR : src/mapgen.cpp:2589 [virtual void jmapgen_terrain::apply(const mapgendata&, const jmapgen_int&, const jmapgen_int&, const string&) const] In nested mapgen ruins_4x4_camp in mapgen desolatebarn on desolatebarn_west, setting terrain to t_dirtfloor (from t_dirt) at (6,11) when furniture was f_rubble.  Resolve this either by removing the terrain from this mapgen, adding suitable removal commands to the mapgen, or by adding a suitable flag to the innermost mapgen: either ERASE_ALL_BEFORE_PLACING_TERRAIN if you wish terrain to replace everything previously on the tile or ALLOW_TERRAIN_UNDER_OTHER_DATA if you wish the other items to be preserved225.142 s: overmap_terrain_coverage

Describe the solution

I have looked at a couple of fixes for similar errors and found that the solution was to add ERASE_ALL_BEFORE_PLACING_TERRAIN

Testing

  • TODO
  1. The game loads
  2. debug -> [m]ap -> [M]ap editor -> [o]vermap
  3. Find desolate barn
  4. Hold down "regenerate". w/o this patch you would eventually hit a debug assertion at this step

@github-actions github-actions bot added astyled astyled PR, label is assigned by github actions json-styled JSON lint passed, label assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions labels Feb 24, 2022
@PatrikLundell
Copy link
Contributor

The solution is to add either ERASE_ALL_BEFORE_PLACING_TERRAIN or ALLOW_TERRAIN_UNDER_OTHER_DATA. The problem is to figure out which one to add, which means you have to actually understand what the usage of the blueprint is trying to achieve.
If the intention is to replace what was there before ERASE is the correct choice, while if it is to add to it ALLOW is the correct one.

It can be noted that the behavior before the introduction of the flags and the checks was NOT to remove things (except when walls are placed, in which case special code older than the flags is invoked). Thus, blindly applying ERASE to anything flagged changes the behavior, but on the other hand, most of the mapgen probably desires the new behavior...
The situation is a significant mess, and the warnings shouldn't have been introduced until after a major effort to update all map gen and base camp construction had been performed.

@hexagonrecursion
Copy link
Contributor Author

In this case the base mapgen places rubble at random coordinates that sometimes just happen to land in the wrong place. I think erase is correct here

@Maleclypse Maleclypse added <Bugfix> This is a fix for a bug (or closes open issue) Code: Tests Measurement, self-control, statistics, balancing. Map / Mapgen Overmap, Mapgen, Map extras, Map display labels Feb 25, 2022
ERROR : src/mapgen.cpp:2589 [virtual void jmapgen_terrain::apply(const mapgendata&, const jmapgen_int&, const jmapgen_int&, const string&) const] In nested mapgen ruins_4x4_camp in mapgen desolatebarn on desolatebarn_west, setting terrain to t_dirtfloor (from t_dirt) at (6,11) when furniture was f_rubble.  Resolve this either by removing the terrain from this mapgen, adding suitable removal commands to the mapgen, or by adding a suitable flag to the innermost mapgen: either ERASE_ALL_BEFORE_PLACING_TERRAIN if you wish terrain to replace everything previously on the tile or ALLOW_TERRAIN_UNDER_OTHER_DATA if you wish the other items to be preserved225.142 s: overmap_terrain_coverage
@hexagonrecursion hexagonrecursion marked this pull request as ready for review February 25, 2022 10:57
@ZhilkinSerg ZhilkinSerg merged commit 41279b9 into CleverRaven:master Feb 25, 2022
@hexagonrecursion hexagonrecursion deleted the fix-ruins branch February 25, 2022 15:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions <Bugfix> This is a fix for a bug (or closes open issue) Code: Tests Measurement, self-control, statistics, balancing. json-styled JSON lint passed, label assigned by github actions Map / Mapgen Overmap, Mapgen, Map extras, Map display
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants