BNA!@Posted: Fri Aug 06, 2004 10:07 pm :
Hi everybody - here's the second D3W tutorial:
How to connect two rooms, add working doors and block efficiently the visibility so you wont have to render more than what you really see.
Basically it's a 3in1 tutorial, but you'll like it, wont take you too much time and what you learn is something you will need every single day as a mapper.

I'm referencing to the first D3W tutorial often, so make sure that you at least take a look at it:
D3W Tutorial: Getting started with your first map

That's the map I've created with this little tutorial:
http://www.doom3world.org/doom3/tut/bna ... _doors.rar

This said we start with two boxes, one of them has an info_player_start in it and both are lit as in the first tutorial (by now you sould be able to crank out these two boxes in less than 60 seconds).

Just in case you don't know yet:
When you select something in DoomEdit and hit the space bar it'll clone it so you have a perfect copy, you'll need that a few times now.
If you want to select the whole box at once to duplicate it, just make a brush which encloses the whole thing - right click into the grid, selection > select inside.

Top down starting view like this:

Image

Next step is to create a good cut into the wall, otherwise we wouldn't be able to walk from room 1 to room 2 :)

So just select the wall in front of you by shift+lmb clicking it:

Image

Then we ctrl+tab to side view (or was it frontview? doesn't matter - just look at the screenshot, you can't go wrong):

Image

Now drag outside the selected brush and resize it so it looks like this:

Image

Now clone this, place it to the right side, clone it one more time, place it in the middle an resize it so it looks like this:

Image

Done that? Fine - go to room2, delete the wall we just edited, go back to room1, select the three brushes now making our wall with entry, clone them and drag them over to room2 so it looks like room1.
Sounds complicated, but it's only because it's my second language and I'd rather play Doom now :)

Let's progress - we need an infamous claustrophobic corridor to walk from room1 to room2.
The fastest way is to select the floor of room1 (or room2, doesn't matter), clone it, drag it outside to line up exactely with the floor, resize it so that it extends the opening in the wall for one unit on both sides and make it a similar shape as shown below:

Image

Now you clone that and drag it over to room2.
Clone it one more time and hit the z-axis rotate button - will rotate your clone at 90degrees. Line it up so it looks like this (make sure the brushes touch each other perfectly and line up with the floors in the rooms):

Image

Select the three floor brushes, clone them and drag them upwards to form the ceiling. Make sure to align them with the top part of our nice hole in the wall:

Image

Now we need walls - clone one of the floor brushes, drag it upwards so it just sits on the floor (don't leave a gap open and don't overlap them).

Then you resize it so it's only a unit thick (that's why we extended the floor and the cieling one unit beyond the hole in the wall) and resize it upwards to match up with the cieling:

Image

Continue, repeat, z-axis rotate till it looks like this - always make sure not to leave any gaps open!!

Image

Claustrophobic and dark is cool, but pitch black is not, so we quickly add a light in the middle of the corridor.

Watch your map from all sides and make sure the light is not outside the corridor tho:

Image

Now we add a door. To do so we right click and choose func_door.
This will insert something that looks like a random brush, don't mind at this stage:

Image

Since we want our door to look cool, we use a model for it.
To do so we right click and select the option new model.
This will open the fancy model browser (in the preview window: rotate the model with the lmb and resize it with alt + rmb)

In our case: models/mapobjects/doors/airlockdoor/separates/airdoor.lwo ffor the door and
models/mapobjects/doors/airlockdoor/separates/airdoorfrm.lwo for the frame.

Both models will show up just as boxes when you add them - select the boxes and clone them, then the models will show up nicely (most famous Radiant bug since ever). Delete the old boxes, keep the models (these are func_statics now).

We wont really need them, but now you've learned how to add models.

Image

Now select your func_door and switch to the entity tab in the inspector window.

In the lower right click the "model" button which will bring up the already shown model browser. Select the door model we've talked about previously.

As usual you'll still see the box - select it, clone it delete old box...
Now you have a nice model as a door.
Use the z-axis rotate button so it faces the wall hole.

Then move it into the hole:

Image

Should look like this:

Image

Now select the frame we've brought into the map earlier and line it up with the func_door and the wall.

You'll see small red dots in the view - these are the pivot points of the models. id software had modeled both in a fashion so that these points should line up (pure design decision, not a functionality you need to learn now).

Drag the models into places:

Image

Select both, the func_door and the func_static showing the door frame, clone them and move the copy to room2:

Image

Now make a brush that fits just nicely into the wallhole and the func_door we've created earlier - this will be our visportal. Make it a little thinner than the func_door.

Assign the visportal material: textures > editor > visportal to the brush face either facing towards or away from us, no real difference.

The other faces you texture with textures > common > nodraw.

Quick workflow / tool tip:

Select the brush you want to act as a visportal and give it the nodraw material, then deselect it and select only designated visportal face by ctrl+shift clicking it in the cam window. Then assign the visportal material.

Image

Copy, clone roate... till it looks like this:

Image

Save the map, compile it and load it up.

Enjoy your initial pleasure seeing a working door :)

Beyond that you've achieved a seond goal - you have learnt how to block sufficiently the visibility.

Quick explanation:
The engine draws every part of the level eve when you can't see it.
This obviously is a bad idea for performance.

That's why you use visportals - these tell the engine how far it can look.
If you see a visportal, the engine checks whether this visportal can see another visportal. If so then the engine checks whether this visportal can see another one - if the first visportal can't see the third, the engine wont rrender the world benind it - that's called "reducing overdraw" to throw in a catch phrase.

if you lower the console and enter "r_showPortals 1" you can see your visportals ingame.

Red means it's closed, nothing behind it get's rendered, green means it's open and renders stuff to the next red visportal (highly simplified, but I hope you get the concept):

Image

A viportal insice a func_door automatically actvates itself when the door opens.

By typing "r_showtris 3" in the console you'll get a nice wireframe view which shows you which triangles get rendered and which don't.

See how the corridor doesn't get rendered when the door is closed:

Image
Image

As usual, it's late, I was in a hurry, needed the money and any possible excuse else for any potential errors, don't get me started on typos and exotic grammar...

Comments welcome below :)



Hunter@Posted: Fri Aug 06, 2004 10:16 pm :
The screenshots are a bit small, I can't tell what you are doing on some of them.



Acid303@Posted: Fri Aug 06, 2004 10:40 pm :
Hunter wrote:
The screenshots are a bit small, I can't tell what you are doing on some of them.

I have to agree on that :) BNA! is obviously an experienced mapper, well I'll try to get the best out of this tommorow :)

Thanx for the tutorial :)



BNA!@Posted: Fri Aug 06, 2004 11:06 pm :
Yes, sorry for the small screens, but the tutorial is fairly long, so I didn't want users to wait an eternity for the screens to load, 56k users might drop dead then.

Try to follow the text - i'm rather sure you'll get along, if not, catch back here.



Acid303@Posted: Fri Aug 06, 2004 11:13 pm :
BNA! wrote:
Yes, sorry for the small screens, but the tutorial is fairly long, so I didn't want users to wait an eternity for the screens to load, 56k users might drop dead then.

Try to follow the text - i'm rather sure you'll get along, if not, catch back here.

I'll try it out later today(first I need some sleep), thanx for your efforts :) Adding text seems like a good idea so this will probably be more helpfull now :)



BNA!@Posted: Fri Aug 06, 2004 11:14 pm :
Acid303 wrote:
Adding text seems like a good idea so this will probably be more helpfull now :)


I just hit submit instead of preview while typing it, that's why it was only small screens at first to the general public :)



Vash@Posted: Fri Aug 06, 2004 11:18 pm :
Skimmed through it; already know how to do it, but a great guide for people who dont :).



Hunter@Posted: Fri Aug 06, 2004 11:20 pm :
A quick question, what is the difference between nodraw and visportal? Also, it is getting really annoying having to click stuff to rotate it, is there a faster way to rotate?



BNA!@Posted: Fri Aug 06, 2004 11:22 pm :
Hunter wrote:
A quick question, what is the difference between nodraw and visportal? Also, it is getting really annoying having to click stuff to rotate it, is there a faster way to rotate?


Nodraw is just a texture which doesn't draw in the game and is non-solid - visportal tells the renderer to place a visportal there and treat it as described in the tut.

rotating: look through the DoomEdit command list, but I don't think there's a different way.



BNA!@Posted: Fri Aug 06, 2004 11:22 pm :
Vash wrote:
Skimmed through it; already know how to do it, but a great guide for people who dont :).


That's the target audience :)



Vash@Posted: Fri Aug 06, 2004 11:23 pm :
Nodraw = deletes the polygon face that it is textured with. Its deleted forever, so it wont be rendered.

Visportal: Hides polygons that're being rendered beyond the players view. Usually, polygons behind a door (like walls and such - which you cannot see) are rendered, therefore adding more to the map to render, and putting more strain on your system. With visportal, it tells the engine not to render when the player cannot see.

I know I got the nodraw description right; but not entirley sure with Visportal.

[edit]

Damn BNA, you beat me to it ;)



Hunter@Posted: Fri Aug 06, 2004 11:30 pm :
Hmmm, my visportals seem to be creating errors:

"WARNING: brush has multiple area portal sides at 488 696 100"

They work okay, but I would assume leaving these in there is bad mapping practice.



Vash@Posted: Fri Aug 06, 2004 11:36 pm :
Using them correctly will greatly increase the size of your map and decrease load times ;). (Most likley anyway)



Hunter@Posted: Fri Aug 06, 2004 11:43 pm :
Why would they increase the size of the map?



Vash@Posted: Fri Aug 06, 2004 11:50 pm :
I meant you can increase the size of your map if you use stuff like nodraw, visportals, and other items like that. It'll cut down on polyogns and allow you to add more and more.



Hunter@Posted: Fri Aug 06, 2004 11:52 pm :
Ah okay. I still don't understand why you would use nodraw :?



BNA!@Posted: Sat Aug 07, 2004 12:05 am :
Hunter wrote:
Ah okay. I still don't understand why you would use nodraw :?


Sometimes you only want to have one side of your brush textured - then you use nodraw. Or when you scrip something and need invisible brushes as targets.



Hunter@Posted: Sat Aug 07, 2004 12:09 am :
Ok.

What do you have to say about those errors I am getting (scroll up).



Vash@Posted: Sat Aug 07, 2004 12:19 am :
Maybe one brush has three area portals on it? (Thats what it looks like anyway...)



Coolbreeze78@Posted: Sat Aug 07, 2004 3:24 am :
Ok Im not sure what I am doing wrong here...

Making the door... I right click on the area I want the door -> choose Func -> Func_Door. I get a 4x4x2 block which I assume is ok. Next I right click on the brush and choose New Model...

I get a box that says "Failed to create entity." I push ok and the Model viewer loads up. Is this error normal or am I doing something wrong?