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

How do I make portal elevators that start at the base position?

Recommended Posts

I know that by combining linked portals with attached surfaces, I can make lifts that move you through sector portals. However so far I've only managed to start their floor height at the same value as the portal plane height. If I tried to have something like this, I failed:

+-------------------------+
|                         |
| top lift destination    |
|............+------------+
| portal     |
|************|
|            |
|     ^      +------------+
|     |                   |
|     |                   |
|  map start              |
| lift floor              |
+------------+------------+
Attaching the floors would only work if the lift floor matched the portal height, not different (either at ground or top level).

Does 385:Apply portal to front sector work? (I guess I can try, but I'm away from Eternity now)

Share this post


Link to post

The only map where I've ever seen such a construct is Vaporware. It uses #385 to copy the portal to these sectors.

That said, I noticed a small hiccup when the player transitions on the moving lift through the portal - and looking at the code that adjusts the actors when moved up/down doesn't do any portal related checks. To me this looks like it just defers to the actor's own Think function.

May be worth looking into since you seem to add all the missing functionality for portals.

Share this post


Link to post
Graf Zahl said:

That said, I noticed a small hiccup when the player transitions on the moving lift through the portal - and looking at the code that adjusts the actors when moved up/down doesn't do any portal related checks. To me this looks like it just defers to the actor's own Think function.

The "hiccup" happens because when the thing is on top of a floor portal, the floor Z is considered to be 1024 units (an arbitrary large number) below the portal. It doesn't check any sectors or lines beyond the portal, so it just assumes that it should fall through. It will then fall into it, until it teleports into the layer below. At that point it will notice that the current Z is much lower than the real floor, so it pops back up (basic Doom collision rule), returning to the top layer, from which it will fall again.

Clipping against floors, ceilings and maybe even line portals seems easy enough to implement, both for things and lines. What I have to do is extend the blockmap search to access all adjacent portal layers. I just have to look throughout all the code to make the fixes.

The sector portal teleportation is currently handled in Mobj::Think and seems stable enough.

The line portal teleportation is a special kind of spechit detection that's easy to miss by monster projectiles because their speed is greater than their radius (imp, caco, baron shots) or than twice their radius when faster than 15 (fast imp, fast caco, fast baron, mancubus shots). I need to test this more however. It happens frighteningly often with baron shots on fast mode, and I believe it's more often than passing through all-blocking walls.

Share this post


Link to post

What if you have three or more sectors stacked above each others with portals, and you're at the bottom of the top layer. Does the arbitrarily large step downward teleport you directly to the bottom layer, instead of falling normally through the intermediary levels?

Share this post


Link to post

As I understand it, no.

Normally P_TryMove ends up with the proper floor height. But if the floor is a portal, the floor height is set to 1024 below the actual floor of the sector.

So the following P_ZMovement will pull the player down again, because the function thinks he's floating. If he crosses the portal line during this event, everything will be reset immediately, because he gets repositioned. But it's far more likely that the first move down won't be far enough and stays above the portal. In that case the view height gets lowered. This will end immediately after the elevator itself crosses the portal line, the player doesn't have nearly enough time to fall that far down (maybe on an ultra-slow elevator.)

The proper solution should be for P_CheckPosition do actual checks through all portal parts the player may occupy, set the actual floor height and - more importantly - reject the move if it collides with anything in the adjoining linked sectors. This will of course require quite a bit of changes to some important movement functions. Looking at the code, this isn't currently implemented, instead it uses a teleporter-like action for the transition - with all the inherent problems of such a solution.

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  
×