Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Sign in to follow this  
Mordeth

Help needed with portals

Recommended Posts

First off, I can make simple anchored portals without too much trouble. But I run into problems when I try to incorporate those portals into a "real" level.

For example: a corridor consisting of several identical segments. One of the segments has a portal attached to it, making the ceiling higher. Looks ok, but when the player moves two segments away from this portal segment I get some nasty HOM at the portal ceiling. WTF?

And how to use portals in area's with several different other tags (lights, etc)..? What in-level sectors do you need to tag when dealing with more complex architecture which you want to 'bridge' with a portal?

Help is sure appreciated! Links to levels with several examples of portals are also welcome :)


-- EDIT: I changed the "DUMB" pic to "TECHIE" -- Quasar

Share this post


Link to post

Can you send me a quick level that illustrates your problems? That would probably be better than me trying to figure out your situation exactly.

Share this post


Link to post

James explained some things to me yesterday night on IRC. Turns out you can't move too far away from the anchor camera, or you'll get HOM as I described. Well, time for more experiments :)

Share this post


Link to post
Mordeth said:

James explained some things to me yesterday night on IRC. Turns out you can't move too far away from the anchor camera, or you'll get HOM as I described. Well, time for more experiments :)


well, the problem is that the anchor camera basically follows you wherever you go, only offset on the x and y plane. So what you have to do is make sure you have space for the anchored portal camera to go for whatever place the player can see the portal from. That should clear up some of your hom issues. Also, please note that upper/lower walls inside anchored portals can be a problem as the doom renderer won't render anything above/below them.

So when you use an anchored portal on a ceiling, don't put any lower walls in the portal area (not the actual level area, the portal area) and if you put an anchored portal on a floor, don't use any upper walls that the camera can get behind, those cases will cause hom as well...

Share this post


Link to post

SoM said:
Also, please note that upper/lower walls inside anchored portals can be a problem as the doom renderer won't render anything above/below them.


That's not a problem, but a feature :) I'm interested in using the 'boundary layer' between level and portal to 'glue' two halves of a structure together which together makes a 3D-looking object. Which works just fine... except when moving away and thus fuxoring the camera. I'm still experimenting, to find out these rules :)

You know, you should release some portal demos.

Is there a way to visualise this camera? Maybe in some kind of debug mode? I have a hard time trying to understand where that camera is located, and how exactly it moves with the player.

Share this post


Link to post

SoM can probably explain the anchored portal relationship to your location better than I can. I understand how it works, but would have trouble describing it unambiguously.

As for demo levels, there was that one, but it is broken because of the editing ref change to anchored portals and thus needs to be fixed before I can relink it from the main page (I'm really not up to doing this myself). SoM is also working on an Eternity map which utilizes them, although it may be a bit extensive to qualify as a good map for demonstration purposes (ie it would a bit of work to locate and isolate everything related to only the portals).

Share this post


Link to post

Mord, I'm working on a tutorial for portals that I'm going to put on my site. The tutorial should explain the whole mess pretty well.

Share this post


Link to post
SoM said:

Mord, I'm working on a tutorial for portals that I'm going to put on my site. The tutorial should explain the whole mess pretty well.

Thank you!!! I've been having trouble figuring this stuff out from the documentation myself...

Share this post


Link to post

The tutorial is going to have to wait until after Lava factory is finished... It just isn't writing itself like my writing projects usually do. The entire portal issue is complicated and I can understand it in my mind without words if that makes any sense...

Share this post


Link to post

Sorry to bump this :) I'm still struggling with those portals. Most of times things work fine, but I just cannot explain why they sometimes don't render properly.

Here's another example that has me scratching my head:

(1) Anchored portal, looking fine
(2) Same shot, moving back
(3) Another example
(4) And again after moving back

As you can see, the level geometry renders just fine but sprites sometimes get "cut off"..?

[EDIT] Example level (with darn ugly textures :)

[EDIT 2] For the curious: talked to SoM on IRC, said I found a "special case" bug. See? I am so special :) He fixed it apparantly.

Share this post


Link to post

For the curious: talked to SoM on IRC, said I found a "special case" bug. See? I am so special :) He fixed it apparantly.


Yes you are special... that anchored portal looks awesome in those screenshots btw. :P Thanks for outshining my WIP...

Share this post


Link to post

Heh.

Anyway, I figured out a way around the anchored portal camera restrictions mentioned above and thought to share with other level designers. Slight recap: when moving away from an anchored portal you might see the portal going HOM due to the position of the (virtual) portal camera. This usually happens in 'skylight'-type constructions (a structure with a portal in its center) but never in 'world'-type stuff (portal with a structure in its center).

Last night I found out that this HOM can be remedied by placing a similar tagged dummy anchored portal behind the current player position in the void.

An example:

--------------------------- 
| A                       |  
|                         |   
|       --------          |                --------
|       | B    |          |                | C    |
|       |      |          |                |      |
|       --------          |                -------- 
|                         |
|                         |
|          P              |
|                         |
|                         |
|                         |
---------------------------                     
Sector B is the tagged sector. The portal itself is sector C (although you usually have C surrounded with other sectors that make up the rest of the portalview). Assuming you have everything correctly set up, the player at position P will see a nice portal C above sector B. But when moving back far enough the ceiling of B will go HOM, due to the player getting too far removed from the virtual camera.
--------------------------- 
| A                       |  
|                         |   
|       --------          |                --------
|       | B    |          |                | C    |
|       |      |          |                |      |
|       --------          |                -------- 
|                         |
|                         |
|          P              |
|                         |
|                         |
|                         |
---------------------------    

---------------------------      --------------------------- 
| D                       |      |E                        |
---------------------------      --------------------------|
Now we've placed a sector D (which does not have to have the same properties as B) behind the player in the void. It has the same tag as sector B. Sector E is the corresponding portal for D. Take care that the level geometry of B/D matches that of C/E. Now the HOM is gone. Rinse and repeat for all troublesome angles. Yes, you're actually emulating a 'world'-type structure. This does pretty much eliminate all structural restrictions on portal usage :)

[EDIT] This does raise the question if things can be coded such as to assume a dummy portal behind the player without actually placing one..?

Share this post


Link to post
Quasar said:

What the hell? Why does this work? o_O

No clue, but it proves the portals can work better which is good.

Share this post


Link to post

And another helpful tip for level designers.

Portals are apparantly also drawn from faked floor/ceilings, made by the transfer flat property trigger (242). Evil indeed :) But most 'underwater' situations will get ruined by this.. This can be solved by creating a similar deep water effect for the portal sector. That way you can see the normal sector and the portal when above the surface, and just the underwater part when below the surface.

Share this post


Link to post

Hey Mordeth, could you have a look at this post? Are you saying that the specific HOM issues I'm whining about there (basically I'm trying to put structures on a building roof) are removable with this fix? Because I tried it and either did something wrong or misunderstood what it was supposed to fix. If so, I'll at least continue with the design and worry about the fix later.

Share this post


Link to post

Mordeth, I've been trying forever to recreate the portal problem you describe here but I can't, can you send me map that displays the bug? Thanks.

By the way, *BUMP*

Share this post


Link to post
SoM said:

Mordeth, I've been trying forever to recreate the portal problem you describe here but I can't, can you send me map that displays the bug? Thanks.

By the way, *BUMP*


What do you know, a new post on exactly the same day I happen to look here again ;)

Will whip one example up. See you on IRC soon ;)

Share this post


Link to post
Mordeth said:

What do you know, a new post on exactly the same day I happen to look here again ;)

Will whip one example up. See you on IRC soon ;)


so.... you got those examples done?

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
Sign in to follow this  
×