After reading the teamx docs for structures/formats I could trace the program and understand it better.
The 0x0FFF mask from epax roof tiles just comes from the frm ID format, where the lower 12 bits hold the index. (
teamx). Without the mask, some other maps (other than epax) are displayed incorrectly, like the Glow maps.
The problem with EpaMain1 is that there are 17 objects with nonsensical values in elevation 3 HexID:0 (botanical garden, top right corner). Even in BISMapper and the game itself the map crashes if you move the viewport there and try to render the objects (disable edge clipping in high res patch). I deleted them with a hex editor and the map now loads (and doesn't crash in BISMapper/game engine)
EpaMain1
The problem with EpaMain2 is slightly worse. It also has again 17 objects with nonsense values in elevation 3 HexID:0, but also it is a map with elevations {1+3}. 2 is missing. Dims can do elevations {1},{1+2},{1+2+3}, but the other 4 ({2} {3} {2+3} {1+3}) don't really work. Technically it wouldn't be difficult to make it load the map, it's just ~2 lines of code, but the rest of the code (adding objects, deleting objects etc.) would have to be adjusted which would require work.
NewR1a, NewR2a, oacave, oaenter, oamain are the same problem really. Some are {1+3}, some {2+3} etc...
I guess the takeaway from this would be, what are the 17 objects in EpaMain1/EpaMain2? Is this some sfall scripting map hackery? Both have precisely 17, which makes me believe they aren't part of some sfall scripts? But I don't know scripting
...
Output from BISMapper ->
epamain1 epamain2
all of them have pid -1 and some other nonsense. And therefore crash the game.