Skip to content

Comments

Map loading & wzmaplib refactoring#4193

Merged
past-due merged 29 commits intoWarzone2100:masterfrom
past-due:2025_01_multi_map_packaging_1
Jun 1, 2025
Merged

Map loading & wzmaplib refactoring#4193
past-due merged 29 commits intoWarzone2100:masterfrom
past-due:2025_01_multi_map_packaging_1

Conversation

@past-due
Copy link
Member

@past-due past-due commented Feb 6, 2025

Note: This PR adds libzip as a required dependency.

  • Lots of wzmaplib improvements (including to WzMapZipIO)
  • Gracefully handle failures to load map / level
  • Simplify buildMapList and use wzmaplib directly
  • Refactor map loading

Maps are now loaded directly using wzmaplib, without having to mess with mounting map packages in the search path.

Simplifies rebuildSearchPath, handling & processing of in-memory map archives (for replays), loading map previews, etc. Also speeds up map-handling performance, and removes a bunch of edge case failure possibilities that could lead to the game crashing while attempting to load a broken or outdated map package.

These changes also mean that "map mods" are officially unsupported, and will just be treated as maps. When trying to load a "map mod", the map part will load - but none of the "mod" part. This is largely an improvement, as previously most older map mods would either crash the game or not load their mod files (as they modded older files that are no longer used), or some other weird combination of bad state / breaking graphics / etc.

(Mods are, of course, still supported - and can themselves include maps.)

@past-due past-due force-pushed the 2025_01_multi_map_packaging_1 branch 2 times, most recently from d657043 to 2c95e83 Compare February 8, 2025 17:45
@past-due past-due force-pushed the 2025_01_multi_map_packaging_1 branch from a52d201 to 356e286 Compare February 20, 2025 23:45
@past-due past-due force-pushed the 2025_01_multi_map_packaging_1 branch from 80c3834 to b8768eb Compare April 21, 2025 20:42
@past-due past-due changed the title [WIP] Map loading & wzmaplib tweaks Map loading & wzmaplib tweaks Apr 21, 2025
@past-due past-due force-pushed the 2025_01_multi_map_packaging_1 branch from f40388a to 589eaf8 Compare May 30, 2025 17:50
@past-due past-due force-pushed the 2025_01_multi_map_packaging_1 branch 3 times, most recently from e897f54 to cd40faa Compare May 31, 2025 17:37
@past-due past-due marked this pull request as ready for review May 31, 2025 17:41
@past-due past-due added this to the 4.6.0-beta1 milestone May 31, 2025
@past-due past-due changed the title Map loading & wzmaplib tweaks Map loading & wzmaplib refactoring May 31, 2025
@past-due past-due force-pushed the 2025_01_multi_map_packaging_1 branch 2 times, most recently from 72051d6 to 0e29da7 Compare June 1, 2025 02:22
past-due added 12 commits June 1, 2025 11:14
Use the WzMap::Map instance to do so, attempting to load the map itself earlier. Move loadTerrainTypeMap to map.cpp.
Maps are now loaded directly using wzmaplib, without having to mess with mounting map packages in the search path.

Simplifies rebuildSearchPath, handling & processing of in-memory map archives (for replays), loading map previews, etc. Also speeds up map-handling performance, and removes a bunch of edge case failure possibilities that could lead to the game crashing while attempting to load a broken or outdated map package.

These changes also mean that "map mods" are officially unsupported, and will just be treated as maps. When trying to load a "map mod", the map part will load - but none of the "mod" part. This is largely an improvement, as previously most older map mods would either crash the game or not load their mod files (as they modded older files that are no longer used), or some other weird combination of bad state / breaking graphics / etc.

Mods are, of course, still supported - and can themselves include maps.
@past-due past-due force-pushed the 2025_01_multi_map_packaging_1 branch from 0e29da7 to 2b43a8c Compare June 1, 2025 15:15
@past-due past-due merged commit 934c049 into Warzone2100:master Jun 1, 2025
37 of 39 checks passed
@past-due past-due deleted the 2025_01_multi_map_packaging_1 branch June 1, 2025 16:22
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.

1 participant