Dynamic Geometry
by DarthDoctorSo you want to have the player have to explore different areas at different difficulty levels? Not a problem, keys. But wouldn't it be really nice to have that whole hanger not there? Just an inoperable door, or, even better, a wall? Sound like a futuristic wonder world? No, just a little technique.
As you know, with INF, that all is possible. You can adjoin sectors. However, there isn't a line like, if difficulty = easy; so we're not getting away that easily. However, it is entirely possible.
Consider what we can vary. Objects. Now, in INF, can't we specify an entity_mask? That's all we need.
Go out and insert a triangle, just to save .lev space. Keeping on its center, create a triangle subsector inside. The outer radius should be about 4, the inner about 1. At the center of the inner circle, add a generator.
SEQ LOGIC: GENERATOR I_OFFICER DELAY: 1 INTERVAL: 2 NUM_TERMINATE: 1 MAX_ALIVE: 1 MAX_DIST: 20000 MIN_DIST: 0 MASTER: ON SEQEND
And difficulty at –1 (easy only.)
Take the outer sector and add inf, making it a trigger to detect when an enemy enters sector. Ta-da! You now have an elevator called when difficulty is on easy. That wasn't bad, was it? Hard is just like it. The only problem is with medium.
There is no independent "medium only" difficulty. There is one for easy\medium (for powerups) and medium\hard (for enemies). The easiest way to start medium-sensitive INF is using double elevators and delays.
Consider you want to start a medium inf sensitive block. You have two sectors set up, EASY_INF and MEDIUM_INF. Each has double triangle trigger, EASY_TRIG and MEDIUM_TRIG.
Timetable:
0: Level finishes loading.
1: Enemy appears in MEDIUM_TRIG, and trips it.
1.1: MEDIUM_INF sends EASY_INF a master: off message.
2: Enemy appears in EASY_TRIG, and trips it.
2.1: EASY_INF hears the message, but has done nothing. MEDIUM_INF continues on its merry way.
Key–Sensitive Forcefields
In one of my levels, I came up with a nice looking key-sensitive forcefield. It is easy to create, though, and I hope you enjoy it.
Essentially, we want the player to enter a hallway, and, if he doesn't have the yellow key, the locked sound sounds and a forcefield appears in front of him. Actually, not bad. Here's a mainline description of the situation:
______________________ ______________________ | | |----| <-- That's the trip line |====| <-- That's where the forcefield appears. | |
We'll need four dummy elevators, although we might only need 3. I'll call the sector in between the trip line and the main corridor y1trip, the sector between the trip line and the forefield yff1. The dummies are called y1key, y1lock, y1clear, respectively. Don't forget to put a BM like the one in Harkov's for the forcefield, and set up the scrolling walls.
Now for the almost Object-Oriented INF. Remember, the FF is event driven, so don't worry about timing.
Taking the dummies in order named:
y1key
SEQ CLASS: ELEVATOR MOVE_FLOOR KEY: YELLOW STOP: @0 hold STOP: @0 0.1 STOP: @0 0 MESSAGE: 2 y1clear next_stop SEQEND
Okay, perhaps I'm getting a bit ahead. The principle is this: when the player crosses the trip, it "locks" down the FF unless the player has the key. When the player backs away, it "unlocks" the FF. So, the purpose of y1key is to unlock the door if the player has the key. That's what the KEY: YELLOW line is for. What happens is if the player has the key, it clears the FF. The small delay is to avoid having the FF turned on a split second after we just told it to go off!
y1lock
SEQ CLASS: ELEVATOR MOVE_FLOOR STOP: @0 hold STOP: @0 0 MESSAGE: 1 yff1(0) set_bits 3 10 MESSAGE: 1 yff1(0) set_bits 1 33 SEQEND
So that's our locking mechanism. No delay, so as soon as called, it'll start the FF. Then, y1lock will turn it off. Brilliant. You can guess what y1clear looks like.
y1clear
SEQ CLASS: ELEVATOR MOVE_FLOOR STOP: @0 hold STOP: @0 0 MESSAGE: 1 yff1(0) clear_bits 3 10 MESSAGE: 1 yff1(0) clear_bits 1 33 SEQEND
Okay. We can lock, clear, and test for the key at a single message. Let's do this.
y1trip(0) - door way to the hall
SEQ CLASS: TRIGGER EVENT_MASK: 1 CLIENT: y1clear SEQEND
So, if you back away, power down the forcefield.
y1trip(2) - trip the FF
SEQ CLASS: TRIGGER EVENT_MASK: 1 CLIENT: y1lock CLIENT: y1key SEQEND
And if you walk towards it, lock and see if the player has the key. Brilliant. Go ahead and test it out. Sweet. But I can think of an improvement.
Okay, let's take that forcefield we made. Really, the thing that allows you access is not the key per se, but the sector that relies on it. If only we could call it some other way. Let's take out the KEY: YELLOW line and instead put MASTER: OFF or something to set the master off just after the level begins. Now try the forcefield. It won't let you through! (Big step) Add one of those codes thingy, like in the detention center. Instead of a door, though, tell it to send a MASTER: ON message to y1key. Nice. Say, I'm getting an idea.
Remember that fourth dummy? Name it y1ding. Let's put in some INF.
y1ding
SEQ CLASS: ELEVATOR MOVE_FLOOR STOP: @0 hold STOP: @0 0 PAGE: 1 LOCKED-1.VOC MASTER: ON SEQEND
Now, edit y1trig(2) to send a message to y1ding. Try it now. Why, except for a message, it could almost be locked! Add a message, if you wish, something like, "You need the green key".
Now, further off in the level, make a sector, say, g1 * and add some INF.
(* I know, all the others are named for the yellow key, and thus have a y- prefix. However, we are changing over. Change them if you wish.)
g1
SEQ CLASS: TRIGGER EVENT_MASK: 1 CLIENT: g1dum SEQEND
g1dum
SEQ CLASS: ELEVATOR MOVE_FLOOR STOP: @0 HOLD STOP: @0 0 MESSAGE: 1 y1ding MASTER: OFF MESSAGE: 1 y1lock MASTER: ON STOP: @0 TERMINATE SEQEND
Yes, I know, I didn't mention g1dum before. But as you see, it is needed. So, try it. Walk up to door. Locked. Enter sector g1. Walk up to the FF. Open. Nice. Now you don't have to waste a key!
Oops, did I just say door?
Okay. Take the sector behind yff1 and make it into an INF door. Change the messages in y1lock and y1clear to MASTER: OFF and MASTER: ON respectively. Try it out.
What I've tried to do here is a semi-coherent method to make Dynamic Geometry, as in difficulty shaped terrain, and synthetic keys. These methods were thought up completely on my own, and they are things I am implementing in my levels. I just thought they were so strong that I wanted to share them with everyone.
-DD