Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
KVELLER

[GZDoom] Can't get sector portals to work

Recommended Posts

I was watching a tutorial, and while I managed to make some line portals easily enough, I can't seem to be able to make working sector portals. You can look through them, but not pass or shoot through them, and I really don't know what I'm doing wrong. I've attached a ZIP file with the WAD, if someone could be nice enough to take a look at it and tell me what's wrong I'd appreciate it a lot.

PORTALS.zip

 

EDIT: Hang on, I think I found the problem. I made the portals in completely separate sectors and it worked now. Is there really no way to make two sector portals in the same area?

Edited by KVELLER

Share this post


Link to post

Check the console for a very informative error message. To summarize: If you want a portal to be passable, both sides need to be in different unconnected sections of the map. Your two sectors are direct neighbours.

 

Share this post


Link to post

I get it... and the ceiling in the lower sector has to be at the same height as the floor in the upper sector. These are far more limited than I expected, but I guess they were primarily designed to give an illusion of a 3D space instead of allowing nonsensical connections between rooms.

Share this post


Link to post

The different portal types (and I guess we can even include teleportation effects here) are on a spectrum going from "very little restriction, but very noticeable seam" to "very restricted, but seamless".

 

Linked portals, the most restricted (and most powerful) type, results in the two connected areas to be completely superposed -- audio is attenuated accordingly, monsters AI is aware of the portals and monsters may attempt to cross it to reach you, etc. The downside is that to allow this fully seamless interconnection, then the connected sectors have to have always the same offset between them when you travel to and fro through linked portals. This also means they can't be connected directly. Because then the sectors would layer over themselves recursively.

 

Let me illustrate:

ZGElNKt.png

On the top, two areas connected by a tunnel portal. On the bottom, the result in-game -- notice the minor overlap between both areas, with the prongs of the right sector. This works.

 

Now, we have pretty much the same idea of a tunnel portal, however, the two sides are also connected by longer, "nomal" paths. This doesn't work with linked portals.

YTL40v1.png

As you can see, if the engine attempted to layer the two sides of the portal on each other, then it'd end layering the same area recursively over and over again, in an infinite loop. Programs react poorly when they have to make an infinite amount of iterations in a finite amount of time, so GZDoom will simply not allow a portal to be linked in such a situation.

 

You can still have portals, but they'll be simpler portals that do not translate sounds and object positions to make them fit fully seamlessly. In other words, anything that depends on distance or direction will use the real coordinates instead of the coordinates offseted by the portal.

 

In addition, all portals are 2D. Graf abandoned pretty quickly the idea of having a vertical component to the offsets, so you can't make things like an infinite stairway. This was briefly implemented but it caused problems and was removed. Too bad. Because of that, sector portals can't loop upon themselves, either.

Share this post


Link to post

Well, technically you can do the latter case... if you're willing to break it up into yet more portals. Discovered that quirk while making my 150 Hell Knight map. Breaking it into only two chunks wouldn't suffice, it has to be at least three to avoid the infinite recursion problem. A quick, obvious way to break it up would be to have the north and south passageways be separate sectors connected to the west and east rooms by a portal each (so, two passageways connecting to two rooms each resulting in four more portals total).

 

EDIT: For the helluvit, have a sample WAD - for posterity, if nothing else.

ThreeTunnelsButOneIsShorter.7z

Edited by Shadow Hog

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×