How do I create portal into solid block?

Ask about mapping, UDMF, using DoomBuilder/editor of choice, etc, here!

Moderator: GZDoom Developers

Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.
Post Reply
User avatar
MartinHowe
Posts: 2022
Joined: Mon Aug 11, 2003 1:50 pm
Location: Waveney, United Kingdom
Contact:

How do I create portal into solid block?

Post by MartinHowe »

I am experimenting with portals as I have an outdoor building in a level, which is shorter than the ceiling. What I would like to do is have an area of the side of it be a portal into another part of the map, which will be a completely inside area. The "door" in the portal is shown in red below. The player (if they have an ARTIFLY derived class), and any flying monsters, need to be able to pass over the block on which the portal door is painted.

The idea is to do the 3D-floors to put a sloped roof on the building, then draw the inside geometry separately; trying to do it all with hundreds of tiny 3D-floors would be a nightmare!

Can anybody tell me if this is even possible and how do I do it? Indeed, if it isn't, then what's the point of having portals at all; this is the stand-out obvious use for them as far as I can see :? My experiments so far indicate that portals seem to be infinitely high :(
block.jpg
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49067
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: How do I create portal into solid block?

Post by Graf Zahl »

Portals always span the full height of a linedef. What you are trying to do is not possible. The limitation is not on the rendering side - that part would be easy to add - but on the gameplay side. The movement and collision detection code simply cannot handle such a setup.
Gez
 
 
Posts: 17835
Joined: Fri Jul 06, 2007 3:22 pm

Re: How do I create portal into solid block?

Post by Gez »

A possibility would be to have a ceiling portal. The top of the building with its sloped roof is beyond that portal.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49067
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: How do I create portal into solid block?

Post by Graf Zahl »

Portal + portal do not mix that well, though. That ceiling portal better be purely visual then.
User avatar
Rachael
Posts: 13562
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: How do I create portal into solid block?

Post by Rachael »

I may have committed unholy hackery with that with 20 Heretics' map FINAL. <_<

In fact, you'd probably have a LOT to say about it, mostly negative, if you ever opened it up in an editor and saw it. >_>
User avatar
MartinHowe
Posts: 2022
Joined: Mon Aug 11, 2003 1:50 pm
Location: Waveney, United Kingdom
Contact:

Re: How do I create portal into solid block?

Post by MartinHowe »

Wow. I wondered about that, but is it not possible to give portals two parameters for floor and ceiling height and then code "If object colliding with portal line is above portal entrance height then ignore the portal line in the first place as if it wasn't there", thus avoiding the need to code for that? Kind like turning off the portal line special action (ala setlinespecial) for that monster at that time.

Though I must look at that Heretic thing and see if the hacks there are anything like what I have been trying :)
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49067
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: How do I create portal into solid block?

Post by Graf Zahl »

Just one piece of advice: Don't hack around with portals! They are an anomaly in Doom physics and trying to stretch their boundaries may easily end up in catastrophic failure - like crashing or hanging the engine.
User avatar
MartinHowe
Posts: 2022
Joined: Mon Aug 11, 2003 1:50 pm
Location: Waveney, United Kingdom
Contact:

Re: How do I create portal into solid block?

Post by MartinHowe »

Graf Zahl wrote:Just one piece of advice: Don't hack around with portals! They are an anomaly in Doom physics and trying to stretch their boundaries may easily end up in catastrophic failure - like crashing or hanging the engine.
Don't you mean ... "or opening a gateway to Hell?" :p This is DOOM we're talking about :)

But joking aside, I have already found that the line special cannot be turned off via script, so portals are clearly set during level startup. It's as if the destination area of the map is fudged to be mapped in where the real back side would be, possibly by a blockmap hack.

I have, however, found that using Line_SetPortalTarget to the same line itself clears the visual glitch of a tall strip of sky (or whatever); thus if the visible area (seen from outside the portal) of the target is irrelevant when the player is a long distance away or flying, it is possible to hide the fact that a portal is there. Is that hacky enough for you, or has Rachel done even worse? :p

Can any of the developers give me a better explanation of how they work, please?
Last edited by MartinHowe on Wed May 30, 2018 1:04 am, edited 1 time in total.
User avatar
Rachael
Posts: 13562
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: How do I create portal into solid block?

Post by Rachael »

It depends on what type of portal you're talking about.

Static portals will group all adjacent and connected sectors into portal groups - in order to exclude any area from a group it must be separated by a complete void.

I am not 100% positive that this is how they work, but from observation (without looking at the code) this is what I would guess:

Once each portal group is compiled together, the engine then creates virtual coordinates for each of them, and puts them (at least virtually, but not physically) on top of each other. So Portal Group "A" appears to be on top of Portal Group "B", at least in terms of sound and AI processing. Each object's real coordinate remains unchanged, though, this is only for appearances and combat.

Once they're on top of each other (virtually), now it is possible to connect each area together seamlessly in terms of combat - so now bullet hitscans will pass through them, and any objects that pass their borders will be moved to the other side.

Static portals also listen for dynamic lights that hit their walls, as well - when that happens, they'll replicate those lights to the other side.

As far as the player is concerned, because the combat and sound are all happening in one virtual location, they perceive the area to be directly connected together, but it really is not.
User avatar
MartinHowe
Posts: 2022
Joined: Mon Aug 11, 2003 1:50 pm
Location: Waveney, United Kingdom
Contact:

Re: How do I create portal into solid block?

Post by MartinHowe »

Ninja'd LOL. But thanks.

Thinking about it, wouldn't that be a way to avoid the excessive collision detection problems GZ mentioned above? In UDMF at least, there are two spare arguments to Line_SetPortal, which could be used as floor and ceiling of portal. For any portal that that has these parameters used, create an extra portal group that duplicates the area behind the portal in the "real world", as if setting the portal target to the line itself. Then if a hitscan, projectile, or ray of light in the player's LOS hits the line, choose which portal group to use, depending on if the vertical co-ordinate is within the portal height.

EDIT: FAoD, I'm talking specifically about Interactive portals on walls here as these are the holy grail for making outside buildings in a sky-roofed area with realistic insides, without having to resort to hundreds of 3D floors.
Last edited by MartinHowe on Wed May 30, 2018 9:33 am, edited 3 times in total.
User avatar
ramon.dexter
Posts: 1529
Joined: Tue Oct 20, 2015 12:50 pm
Graphics Processor: nVidia with Vulkan support
Location: Kozolupy, Bohemia

Re: How do I create portal into solid block?

Post by ramon.dexter »

Floot/ceiling portal means that the floor/ceiling is a portal, not that the portal touches floor or ceiling. You know, for collision detection, the floor and ceiling is the same.
User avatar
printz
Posts: 2648
Joined: Thu Oct 26, 2006 12:08 pm
Location: Bucharest, Romania
Contact:

Re: How do I create portal into solid block?

Post by printz »

Why not just use a 3d floor for that structure?
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49067
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: How do I create portal into solid block?

Post by Graf Zahl »

MartinHowe wrote:In UDMF at least, there are two spare arguments to Line_SetPortal, which could be used as floor and ceiling of portal. For any portal that that has these parameters used, create an extra portal group that duplicates the area behind the portal in the "real world", as if setting the portal target to the line itself. Then if a hitscan, projectile, or ray of light in the player's LOS hits the line, choose which portal group to use, depending on if the vertical co-ordinate is within the portal height.
You first have to make it work with the collision detection, which is not that easy. It was hard enough to get it to its current state and still isn't free of bugs.
User avatar
MartinHowe
Posts: 2022
Joined: Mon Aug 11, 2003 1:50 pm
Location: Waveney, United Kingdom
Contact:

Re: How do I create portal into solid block?

Post by MartinHowe »

OK, well that's some explanation - thanks. I guess this sort of thing always takes a while to mature from experimental stage :(
Post Reply

Return to “Mapping”