xMAPINFO prioritization and inheritance

Sun Jan 23, 2022 11:39 am

I'm trying to understand how GZDoom loads MAPINFO data, and more specifically how it decides which lump to give priority to when multiples are present. From what I can determine (at least in 4.7.1) this is the order in which it loads the map data:
1. all the base definitions for all maps from the appropriate ZMAPINFO lump in gzdoom.pk3 depending on which IWAD is loaded
2. if MAPINFO or ZMAPINFO lump are present in the PWAD, map definitions in these lumps override #1. If a map is not redefined then #1's definition is used. All lumps are loaded and later map definitions override previous ones. ZDoom Wiki states that MAPINFO lumps get ignored if a ZMAPINFO is present, but from what I can see this doesn't seem to be the case anymore and both are being parsed (and sometimes MAPINFO old syntax definitions even seem to override ZMAPINFO's new syntax definitions if the same map is defined in both)
3. if a UMAPINFO is present for given maps, only specific keys that are in UMAPINFO are replaced, other keys default to whatever was loaded in #2, or if one wasn't defined there then defaults back to #1

Do I have the gist of it right?

And speaking of MAPINFO/ZMAPINFO priorities, how does GZDoom decide which order to load the files in? If they're all within the same WAD file I'm guessing whichever is later "wins". What happens if you load a ZMAPINFO alongside a WAD with an integrated MAPINFO, is there a way to tell GZDoom which one should be loaded last (and therefore has the "final" definitions)? When I try to do this it seems to always load the integrated one last, whereas I want the "outside" one to take precedence since I'm trying to replace some of the integrated definitions.

Thanks!

Re: xMAPINFO prioritization and inheritance

Mon Jan 24, 2022 3:54 am

Just one question: Do you have any reason to have a MAPINFO alongside ZMAPINFO in one wad/pk3? Common use is that use either MAPINFO or ZMAPINFO. Not both.

Re: xMAPINFO prioritization and inheritance

Mon Jan 24, 2022 8:36 am

Fair question. I'm changing the map definitions of someone else's wad (for personal use) and as a general rule I like to leave the original wad untouched if at all possible (especially if the permissions forbid modifications). The wad already has an old-MAPINFO; if I can load a ZMAPINFO alongside the wad and get GZDoom to take its cues from it over the built-in MAPINFO, that would be best.