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

Test reveals bugged mx_minefield generation #79889

Open
PatrikLundell opened this issue Feb 27, 2025 · 0 comments · May be fixed by #79908
Open

Test reveals bugged mx_minefield generation #79889

PatrikLundell opened this issue Feb 27, 2025 · 0 comments · May be fixed by #79908
Labels
(S1 - Need confirmation) Report waiting on confirmation of reproducibility

Comments

@PatrikLundell
Copy link
Contributor

PatrikLundell commented Feb 27, 2025

Describe the bug

General build matrix / Basic Build and Test (Clang 10, Ubuntu, Curses) (pull_request) fails because a 4x4 vehicle is generated (or pushed?) right at the edge of the overmap tile and then is subjected to bashing at a tile outside of the map. This causes an out of bounds check to fail.

Attach save file

N/A. It's a github test failure.

Steps to reproduce

  1. Run the mx_minefield_real_spawn test until the cows come home or this kind of failure happens, depending of what occurs first.

Expected behavior

Map generation should respect overmap tile boundaries, or at least not violate them in a manner that causes trouble.

Screenshots

No response

Versions and configuration

N/A as it's whatever code github has mashed together from master and the PR provided code of:

  • OS: Windows
    • OS Version: 10.0.19045.5487 (22H2)
  • Game Version: cdda-experimental-2024-11-13-1444-3415-g28e320de53 [64-bit]
  • Graphics Version: Tiles
  • Game Language: System language []
  • Mods loaded: [
    Dark Days Ahead [dda],
    Disable NPC Needs [no_npc_food],
    Portal Storms Ignore NPCs [personal_portal_storms],
    Slowdown Fungal Growth [no_fungal_growth]
    ]

Additional context

I've looked at the code for mx_minefield, and failed to find it generating any 4x4_car_diesel vehicle (mentioned in the error log), while finding humvee, military transport, and FBI vehicles.

Thus, I suspect the vehicle may come from overmap generation of the underlying terrain.

The error report an out of bounds check failure for a vehicle part that's to be removed at (26, 15, 0), which is indeed out of bounds for a tinymap. It also states that the part is mounted at (3, -1) of the vehicle located at the submap relative location of (11, 4), which will indeed result in the stated part position if the submap is the (1, 1) submap of the OMT.

The error report is generated by the vehicle::remove_part operation in vehicle.cpp.

I fail to locate what vehicles can be generated on "road" terrain.

I suspect the smashing and whatnot happens when a preexisting mapgen generated vehicle ends up overlapping a map extra generated vehicle. The mx_minefield code doesn't actually mess with its own OMT, but rather an adjacent one, with different generation based on the relative locations. If the bridgehead is south of the bridge, the road to the south of it gets a humvee at (5, 3, 0) , which probably isn't it.
In the reverse orientation, (bridge to the south, road to the north), however, there's a 50% chance for two humvees to spawn, with the second one at (15, 20, 0), which is a collision candidate.
The bridge west, bridgehead, road east configuration gets an FBI car at (7, 7, 0), which doesn't seem to be causing trouble.
The bridge east, bridgehead, road west configuration get a mil cargo truck at (15, 11, 0), which shouldn't cause trouble either.

@PatrikLundell PatrikLundell added the (S1 - Need confirmation) Report waiting on confirmation of reproducibility label Feb 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
(S1 - Need confirmation) Report waiting on confirmation of reproducibility
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant