Jump to content

Portals in GZDoom


Recommended Posts

I've been playing Heartland recently and I got impressed by its verticality. I know it's all done with portals as Eternity doesn't have 3D floors. I always thought portals are kind of limited, I never really got my head round what is possible with them and what not but all the examples I looked at were complex to set up and were limited to just one sector being a portal. I didn't really know you can have this concept of slicing the map into layers and have complex architecture on each layer with not just one or two "holes" to look through but really the whole "empty" area (composed of many sectors) being a portal. I opened MAP02 of Heartland in the editor to see how it was done and I noticed that there were UDMF properties "portalfloor" and "portalceiling" on each sector that was part of the portal (and sector tags are not used for that purpose). I noticed that GZDoom doesn't have those UDMF properties in its UDMF specification. Then I looked at Eternity documentation of Portal_Define and it all looked different (arguably easier to use but that might be subjective) than what I read on ZDoom's wiki about stacked sectors (which I think are GZDoom's equivalent of Eternity's linked portals on floors/ceilings).

 

I thought it would be a cool idea to combine this approach of map sliced into layers with GZDoom's 3D floors - this way you can have multiple layers built of proper architecture but you don't need to define an extra layer just for some small detail like a table or an odd bridge here or there, which can be easily done with 3D floors.

 

And here comes the question - I know that Heartland doesn't work in GZDoom but would this kind of architecture be possible in GZDoom without using 3D floors - i.e. only using portal functionality available in GZDoom? I am asking purely about portals used to slice the map into layers, I'm not asking if ALL features of Heartland are possible in GZDoom. Are there limitations in GZDoom to portal functionality that are not present in Eternity that would prevent this kind of setup (and/or force constructing half of the map of 3D floors)? Or it's just a matter of using slightly different ways to set things up in terms of "metadata" to lines and sectors but generally architecture in the editor would look more or less the same?

Share this post


Link to post
11 minutes ago, jacnowak said:

I know that Heartland doesn't work in GZDoom but would this kind of architecture be possible in GZDoom without using 3D floors - i.e. only using portal functionality available in GZDoom?

Actually, no. While GZDoom has portals, Heartland uses edge portals (a portal on lower/upper walls) quite a bit, which GZDoom lacks.

Share this post


Link to post
20 minutes ago, Edward850 said:

Actually, no. While GZDoom has portals, Heartland uses edge portals (a portal on lower/upper walls) quite a bit, which GZDoom lacks.

 

Isn't it that Heartland uses edge portals for "fine detail" rather than slicing the map into layers? Sorry I'm still trying to get my head round how this works and I probably wasn't very specific what I'm asking about. For example MAP02 of Heartland (the one with the construction site) is composed of 6 layers stacked on top of each other, each defined separately in the editor and connected by floor/ceiling portals. The question is: is this kind of setup possible in GZDoom? Or would you need to make 5 out of 6 of these layers out of 3D floors or be very limited in terms of the structure of the map and pay attention what is visible from what angle (see "limits" section in here: - https://zdoom.org/wiki/Portal#Stacked_sectors - unfortunately I can't get my head round this example but this looks like a severe limitation of how complex your "hole in the floor/ceiling" can be or maybe I just don't understand it)?

Edited by jacnowak

Share this post


Link to post

Yes, slicing the map into layers is of course possible with GZDoom's portals. For example this map makes  use of it (it uses 9 layers or so):

 

Share this post


Link to post

Ah, yeah, I played this map, no idea how I could forget about this one! Interesting to compare how these things are set up in GZDoom and Eternity. So I *think* that the answer to my question is that it seems that the same stuff is possible, it just needs to be set up differently regarding metadata (linedef specials, tags, properties) but architecture can remain the same (in order to convert Eternity's linked portal on floor/ceiling to GZDoom "stacked sector" and vice versa).

 

Btw it's great for Doom that you can look at maps in editor and learn from them, which is not the case for Quake engine maps (unless the author gives the source).

Share this post


Link to post

The edge portals are just one thing, but what's far more problematic is that the mod uses portal setups that are not compatible with GZDoom's collision code.

 

Obviously, you can make maps that work with both engines, but you'd have to restrict yourself to compatible features, meaning no edge portals or not building wall portals with insufficient space behind.

Both engine share enough portal definition features that this would be possible.

Share this post


Link to post
1 hour ago, jacnowak said:

Ah, yeah, I played this map, no idea how I could forget about this one! Interesting to compare how these things are set up in GZDoom and Eternity. So I *think* that the answer to my question is that it seems that the same stuff is possible, it just needs to be set up differently regarding metadata (linedef specials, tags, properties) but architecture can remain the same (in order to convert Eternity's linked portal on floor/ceiling to GZDoom "stacked sector" and vice versa).

 

Basically yes, in terms of splitting a map into layers using Sector Portals, GZDoom can do it just as well as Eternity, albeit with different Linedef actions. There are larger differences with the set up for with line portals, but you weren't asking about those.

 

However, in reality slicing an entire map into multiple layers is a bit of a resource hog, and I would be conscious of the slow-down it can cause if you have anything in the way of complex geometry or lighting. If you went down the multiple-layer portal route, I would advocate keeping the rest of the level perhaps simpler than something like Coma Moonlight, or else be prepared for players to need beefy PCs.

Share this post


Link to post
10 hours ago, jacnowak said:

Isn't it that Heartland uses edge portals for "fine detail" rather than slicing the map into layers?

I'm not sure where it gets used exactly, but it is possible to conjure up sliced structures in a playable area that require edge portals depending on how your level is laid out, such as if you don't have room to put in the rest of the horizontal slice in the same place.

Edited by Edward850

Share this post


Link to post

Thanks everyone for answering!


I've been playing around a bit with portals recently and I have a different question now - but as it's also related to portals in GZDoom I won't create a separate topic.

 

I am trying to create an Eternity map that uses portals but also works in GZDoom.
I found on GZDoom's wiki that it supports a subset of Eternity maps through a map translator as long as they use features that both ports share so I was naively hoping that stuff will "just work" if I limit myself to portal types that both ports support.

 

I made a map (in Eternity UDMF format) which I cut into 3 slices and I made 2 linked portals on floors/ceilings between them, using Portal_Define linedef action and portalfloor/portalceiling UDMF properties on sectors being a portal. In Eternity everything works fine. I experimented a bit what is possible and what not and I got pretty happy with the results :) I basically did it in the same way Heartland does it (and Eternity wiki says that's how it should be done in UDMF format).

 

Now, I can load the map in GZDoom but unfortunately the portals do not work at all.

 

So I converted the map in the editor to set up portals so that they work in GZDoom, following GZDoom's wiki. I changed Portal_Define (300) special to Sector_SetPortal (57) and added sector tags to sectors that had portalfloor and portalceiling set.

 

Now the map works in GZDoom, in exactly the same way as it used to work in Eternity.

 

I expected it to not work in Eternity anymore after these changes, but interestingly it works partially - only the portal between first and second layer works but portal between second and third doesn't. I opened the map in the editor as Eternity map again and it looks that linedef action 57 is described here as "Sector Set Portal (legacy encapsulation)". This linedef action is not described on Eternity wiki but it's there, probably a leftover from an old method or something? The reason it only works partially is that in Eternity you can only have one tag per sector, even in UDMF format, and when I have a multi-layered layout of portals I need to assign two tags to sectors that have the portal both on the floor and on the ceiling and only the first one is ever taken into account.

 

So the question is: is there a way to define portals so that they work both in Eternity and GZDoom? Talking only about floor/ceiling linked portals in Eternity a.k.a. stacked sectors in GZDoom. Note that I can achieve exactly the same results in both ports but currently I can't have it as one map that works in both ports without modification. Conversion between Eternity and GZDoom way can almost be automated but unfortunately it's slightly more complex than just changing linedef actions/tags/UDMF fields as GZDoom requires 4 control linedefs (with Sector_SetPortal) per two-way portal and Eternity only needs two (one with Portal_Define and another one tagged with portal number). But if I created missing linedefs as placeholders (let's say they would have a custom UDMF field with portal number), would it be achievable to create a map translator for GZDoom and embed it in the MAPINFO lump? Or is there a different way?

Share this post


Link to post

Okay, replying to myself as I'm still fiddling with it :) It looks that GZDoom's default map translator for Eternity supports portals defined through linedef actions 358-361 : those described on Eternity wiki as the way to do portals for maps in Doom format (non-UDMF). Unfortunately they suffer from the same limitation of using sector tags and supporting only one tag per sector, so not very useful for multi-layer setup (as you would need one tag for ceiling portal and one for floor portal for all sectors in the "middle" layer). There is linedef 385 "Apply portal to front sector" that is meant to go around this limitation (and GZDoom supports it) but on the wiki it says it's for lifts and the like - I haven't tested if that would work to set both ceiling and floor portals on one sector but even if it does that would be a real pain to need to set it up for EVERY such sector. But it looks that GZDoom's map translator translates things if they can be mapped one-to-one and that's probably the reason it doesn't support Portal_Define linedef type - so I don't think it's possible to write a custom one... So it looks that the only approach is to have maps in both formats in a WAD and use EMAPINFO/ZMAPINFO to select the right one depending on the port - sounds like a pain too...

Share this post


Link to post

OK, not sure if anyone still reads my lengthy posts here but here are the outcomes of my research - maybe someone finds them useful :)

 

TL;DR - no, it's not possible to make a map that uses floor/ceiling portals and works both in Eternity and GZDoom

 

I tried using Eternity linedef actions 358-361 but they don't work at all in UDMF format so I needed to convert the map back to "Doom" format. Here they work, as expected. Also, linedef 385 works fine for setting both floor and ceiling portal on one sector. But, well, I lose a lot of editing possibilities by not being able to work in UDMF format.

 

Unfortunately it looks that there is a bug in GZDoom because after using map translator (-xlat eternity) the portals do not work as intended in GZDoom - instead they cause some weird flickering and it looks that GZDoom tries to create the portal on the wall instead of on the ceiling. Strangely, I analysed the translation in xlat file and it looks correct. Indeed, after converting the map to GZDoom format and changing linedef actions in the exactly the same way as defined in xlat file (there is one-to-one mapping between linedef actions 358-361 and Sector_SetPortal linedef action 57 with appropriate arguments), everything works fine. So something very weird is going on. I had a look and I'm actually using GZDoom 4.6.1 so there is a (very low I think) possibility that this got fixed in the latest release of GZDoom. ( @Graf Zahl I will check that and I can submit a sample map that manifests this problem if you are interested)

 

The only thing that technically worked to some extent is using linedef action 57. Eternity supports it, even though it's not documented, but because of the limit of only one tag per sector you can't do multi-layer layouts. And you need to work in UDMF format for that and linedef 385 does not work in UDMF format, so you cannot use Eternity's way to go around that limitation.

 

So all in all, unfortunately what I tried to achieve is not possible. I thought it would be a nice idea to make a map that works in both ports but it looks that they are too many incompatibilities for that to be worth the effort...

Edited by jacnowak

Share this post


Link to post
1 hour ago, jacnowak said:

So all in all, unfortunately what I tried to achieve is not possible. I thought it would be a nice idea to make a map that works in both ports but it looks that they are too many incompatibilities for that to be worth the effort...

When it comes to fancier features they don't both agree on, yeah, that pretty much is the case.

 

If you don't get mega-fancy like that, you can definitely make both work - EMAPINFO for Eternity, ZMAPINFO for (G)ZDoom.

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...