Elevator through multiple floors [SOLVED]

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.

Elevator through multiple floors [SOLVED]

Postby P.Rex » Thu Dec 10, 2020 4:56 pm

For a map I'm working on, I'm trying to create an elevator that goes through several floors. I have four floors, with the illusion of them being stacked above one another using the "stacked sector portals" method, as described here: https://www.dfdoom.com/gzdoom-portal-tutorial/

I have successfully created the elevator "shaft", i.e. all of the portals work the way I want them to, with no ill effects, but that's only half the battle.
To create the elevator itself I want to create a platform for the player to stand on. Pressing a switch on a nearby wall would then activate a script, causing said platform to descend down the shaft until reaching the bottom floor.

This is where I'm stuck. I tried at first to just make the bottom sector's floor movable, but as it goes through several portals it becomes a glitchy mess. Then I tried the same thing using a 3D sectors and it was just as messy. Then I thought maybe I'd try to make the platform a 3D object rather than a sector floor, but I couldn't find any ACS command that allows a thing to move along the Z axis like an elevator would.

Any idea how to do this?
Last edited by P.Rex on Fri Dec 11, 2020 3:33 am, edited 1 time in total.
User avatar
P.Rex
 
Joined: 15 May 2016
Discord: P.Rex#9409

Re: Elevator through multiple floors

Postby Caligari87 » Thu Dec 10, 2020 5:13 pm

I believe the problem you're running into is because a stacked sector construct is technically separate parts of the level. Things like players and monsters are able to cleanly see and move between these areas but it's mostly an illusion.

Level geometry on the other hand, can't just teleport between different areas of the map. Aside from floor/ceiling height it's static, so the elevator is technically just going into the ceiling of your lowest portal area, not actually existing in both portal areas at once.

Two solutions I can think of:
  1. Rebuild your levels construct with 3D floors instead of sector stacks. PROS: It's real geometry in 3D space, so no portal weirdness. CONS: Depending on the complexity of your level, juggling complex overlapping 3D floors may be prohibitive.
  2. Make duplicate "elevator platform" sectors in each portal area and coordinate them so as the lower one pushes the player up through the sector portal ceiling, the next one starts rising from the floor of the next portal area. PROS: If you can pull this off, I think it should look seamless and you don't have to rebuild your level. CONS: Timing and masking the seams will probably be extremely difficult and time-consuming.

The 3D model actor elevator is an interesting idea, and I think the function you're looking for is Warp, which allows Z-axis positioning for the target actor. The downside, obviously, is that the engine treats standing on an actor slightly different than standing on a real floor, so even if it looks correct it might not feel correct, so that's a compromise you'll need to be aware of.

8-)
User avatar
Caligari87
I'm just here for the community
User Accounts Assistant
 
Joined: 26 Feb 2004
Location: Salt Lake City, Utah, USA
Discord: Caligari87#3089

Re: Elevator through multiple floors

Postby Kappes Buur » Thu Dec 10, 2020 9:12 pm

The easiest way to do this is with 3D floors.
Rex made a good tutorial to that end.

If you want to see this in action, then play his pwad Paranoid MAP01

Another example is by Rick4574 at viewtopic.php?f=39&t=69491

Some time back I made an example pwad but never got around to implement a script to call/send the elevator to a specific floor. The elevator just goes up/down one floor at a time.
You do not have the required permissions to view the files attached to this post.
User avatar
Kappes Buur
 
 
 
Joined: 17 Jul 2003
Location: British Columbia, Canada

Re: Elevator through multiple floors

Postby P.Rex » Fri Dec 11, 2020 3:33 am

Thanks to both.
Unfortunately for me, rebuilding this section of level using 3D floors one above the other isn't really an option. Both middle floors have very complex scenes, and even if I did manage to recreate them using this method it would probably lag the entire map, therefore not worth the effort.

I slept on it and managed to find a solution that is sort of a hybrid of Caligari87's last two suggestions. That is, the elevator platform is still an actor rather than a floor (I use a Hexen-style bridge as an interim, might replace it later with a 3D object) which I made descend using the ThingThrustZ command, then teleport into the next sector after a set amount of time, rinse and repeat until reaching the bottom. It's not a "perfect" solution, due to how the engine handles actor collisions it is a bit of a shaky ride, but I guess that works fine for an old industrial elevator...

Here's what the code looks like, in case someone else might need it later:

Code: Select allExpand view
   ThrustThingZ(15,10,1,0);
   Delay(410);
   Thing_Move(15,16,1);
   ThrustThingZ(15,10,1,0);
   Delay(440);
   Thing_Move(15,17,1);


Thing tid 15 is the platform, things 16 and 17 are map markers in the sectors I want the platform to teleport to.
User avatar
P.Rex
 
Joined: 15 May 2016
Discord: P.Rex#9409

Re: Elevator through multiple floors [SOLVED]

Postby Exl » Fri Dec 11, 2020 10:41 am

I've done this exact thing in Verdant Citadel, and it also was rather painful. The solution I ended up with was having a 3D floor be the floor of the elevator, which is tagged (present) in every floor of the shaft. Then you can move the dummy sector's ceiling and floor around with ACS to wherever you want. The only downside is that the 3D floor must be the only one, without holes or anything fancy. The result is almost seamless, except for ambient occlusion and actor z positions glitching slightly when transitioning between portals.
User avatar
Exl
 
Joined: 01 Jul 2009

Re: Elevator through multiple floors [SOLVED]

Postby Caligari87 » Fri Dec 11, 2020 11:35 am

That's a great solution Exl, I'll have to remember that.

8-)
User avatar
Caligari87
I'm just here for the community
User Accounts Assistant
 
Joined: 26 Feb 2004
Location: Salt Lake City, Utah, USA
Discord: Caligari87#3089


Return to Mapping

Who is online

Users browsing this forum: No registered users and 2 guests