Source Mapping 101

[EYE] Valar

2008-04-02 00:35:30

Hi All,

Been around for quite a while i saw and still see a lot of mistakes done by uninformed mappers. i wanted to offer a bit of help for those who wish to learn ...

The 10 golden rules of (Source) mapping

1. Always work aligned to Grid – the Source engine doesn’t like out of grid brushwork. (see #6)
2. Never ‘Carve’ – the Carve tool was named wrong, it should have been named “Ruin Map”.
3. Never use the ‘Make Hollow’ - (see #2)
4. Sky brush should be covered with Sky texture on all faces – Skybox texture emits light. Learn about the Valve Material File [VMT] format. (*see below link).
5. Plan ahead – draw a sketch of your design before opening Hammer. Most mistakes will show themselves on paper. In fact…producing good sketches WILL indeed teach you a thing or two about level design.
6. World Geometry should never overlap – regardless of what you see in HL2 maps. You and VALVe are not using the same tool and yes…T3H c4k3 i5 a Li3.
7. Cubemaps don’t add lag – it’s a myth. Learn how to use them properly. (**see below link)
8. Learn vis-blocking and (at least) basic optimization – beauty is in the eye of the beholder. And so is FPS. (***see below link)
9. Mastering the Source I/O system is awesome but it doesn’t make you a good level designer.
10. Maps with 2,000,000 sections where no one is able to find no one, 10,000,000 props, 98% custom textures and a slew of spaceships flying overhead are not good maps. It’s a damn shame working 6 months on a level only to come out with an epic 11.8TB BSP no one will ever play. You should have made a Sci-Fi movie and not a DM map. (also,…see #8)

* http://developer.valvesoftware.com/wiki/Vmt
** http://www.interlopers.net/forum/viewtopic.php?t=2005
*** http://www.student.ru.nl/rvanhoorn/optimization.php


- - - To Be Continued - - -

[EYE] Valar

2008-04-02 00:45:26

We will want to start helping one another with ongoing projects... so please feel free posting your compile logs along with your questions in case of compile errors. share your qualms about stealing someone else's ideas (or complete brushwork OMG), seek advise for design issues you're being faced with, pimp your unfinished map or critique that of your peer.
We are all learning and you learn something new everyday and from the most unlikely people and situations...so "experienced mappers" feel free to sign in with an alias and ask your n00bish questions right here.

thatguy

2008-04-02 00:59:38

i would start mapping if i wasnt busy having fun with the game and not getting pissed at a map ;) but i might start get into mapping i have ideas but im not the best or even considred bad with hammer :)

MeekMeekle

2008-04-02 01:39:35

[EYE] Valar wrote: 4. Sky brush should be covered with Sky texture on all faces – Skybox texture emits light. Learn about the Valve Material File [VMT] format. (*see below link).
wow, I did not know this one! thanks Valar!

Walking Target

2008-04-02 01:40:02

Good thread Valar, we need more like this. I plan to get into mapping very soon, new frontiers all that.

Charles

2008-04-02 03:10:00

I'm close to being done with king_air's BASIC structure.
10. Maps with 2,000,000 sections where no one is able to find no one, 10,000,000 props, 98% custom textures and a slew of spaceships flying overhead are not good maps. It’s a damn shame working 6 months on a level only to come out with an epic 11.8TB BSP no one will ever play. You should have made a Sci-Fi movie and not a DM map. (also,…see #8)
Rofl. I would call this [GU]Tenshi-syndrome. :) *No offense Tenshi*

Paradox

2008-04-02 05:13:21

Most of this is greek to me but maybe someday I can crack open hammer and try something creative.

Cynips

2008-04-02 16:23:03

Yeah, I'd like to get into mapping too, though I hear it's easy to get addicted and I don't really have much time to spare.

Would be great with some even more basic starter tips. I once started Hammer and had a look but there were too many options for me to have any idea what to begin with. Is there some kind of basic tutorial around or would you be better off with someone showing you hands-on?

ninojman

2008-04-02 16:54:52

one time i tried to do a remake of this doom2 map i use to love...about 10 minutes after opening hammer i passed out and woke up 2 weeks later.

[EYE] Valar

2008-04-02 18:00:21

Cynips wrote:Would be great with some even more basic starter tips.
This will be my next step. Most ppl think Hammer is harder than what it really is. 8)

Cynips

2008-04-02 18:22:58

[EYE] Valar wrote:This will be my next step. Most ppl think Hammer is harder than what it really is. 8)
w00t! looking forward to that!

so far it's more like Source Mapping 102 :wink:

Walking Target

2008-04-02 20:12:07

Well I have a few things on my agenda, one is a mapping course to add to the curriculum. It would be like the ultimate beginners guide to getting started in hammer. Maybe we can all work on it together here on the forums?

PS: Cynips sorry I havent been in touch lately, too many things on my mind.

Cynips

2008-04-02 20:18:16

Walking Target wrote:PS: Cynips sorry I havent been in touch lately, too many things on my mind.
np, I've gotten some feedback from A Seagull and think I have substantially improved on the text now. Just pm me if you feel you have time and would like the latest version.

[EYE] Valar

2008-04-02 20:48:00

Cynips wrote:so far it's more like Source Mapping 102 :wink:
not quite. open hammer and start working on something...a 100 bucks says you'll come across at least 3 golden rules.

but anyway...as said earlier - a crash-foolproof-course is coming up very soon. i'm just trying to think of the best way to start...i think i'll go with a box. even though it may be arguable if a box is "even real dm" ;) i think getting started with it will cut it just fine.
Walking Target wrote:Maybe we can all work on it together here on the forums?
great idea. only thing i'll note is..if we don't want this mapping course to become a mappers' thread i think we should follow other mapping sites and simply submit tutorials to you and you read through and decide this is good / bad tut / remarks, bla bla. and in any case...a tut is actually a thread which ppl / other mappers can comment on. if that makes sense.

Walking Target

2008-04-02 20:57:24

[EYE] Valar wrote:only thing i'll note is..if we don't want this mapping course to become a mappers' thread i think we should follow other mapping sites and simply submit tutorials to you and you read through and decide this is good / bad tut / remarks, bla bla. and in any case...a tut is actually a thread which ppl / other mappers can comment on. if that makes sense.
You kinda lost me there. A mappers' thread? I am looking for a true 101 course, starting at the very beginning for someone who knows nothing about mapping, and I was thinking everyone could contribute to it in a thread, then I could write it up. I will use myself as the guinea pig for it because I know next to nothing about mapping and want to learn now.

[EYE] Valar

2008-04-02 21:11:42

yea...i may have failed to explain myself. no biggy. all good. ill PM what i meant.

[MB]Brunt

2008-04-06 06:32:39

much thanks for thos last 2 links. :D

Paradox

2008-04-06 09:27:46

reaper47

2008-04-06 20:28:49

6. World Geometry should never overlap – regardless of what you see in HL2 maps. You and VALVe are not using the same tool and yes…T3H c4k3 i5 a Li3.
Not true, an urban myth IMHO. It's bad to have 2 faces overlap, since they will flicker back and forth, with the engine unable to decide which face to draw. But overlapping brushwork is 100% harmless. vbsp.exe will cut out all unnecessary polygons that come from overlapping brushwork, doing so more efficiently than you could even hope to do manually. Even if you're using func_details the compiler is able to determine unnecessary polygons and cuts them off automatically.

It's a good idea to have clean (read: on-grid) brushwork, but as long as everything is on grid and aligned nicely, having intersecting brushes never hurts.

Also Valve is definitely using the same tools with the possible exception of engine updates and additional features (like they were already using the latest update of Hammer a year ago).

[EYE] Valar

2008-04-07 04:42:44

This wasn't meant as a "i know better" thread...:) and i don't claim to also. what i've posted here is from my own experience. no, not everytime you'll have them in your map will it result in errors but i have seen errors as a result of intersecting brushes. so...yeah, this what i know. and you're completely right that even for the sake of having a clean, tidy VMF this is best way to go..and this is what i do and how i work.
about VALVe using the same tool. sorry but IMO there is absolutely no way they are. simply put : why else would you get an update (completely bugged out mind you) of the OB only close to 6 months after official release? same goes for Lost Coast...EP1...even the first release of HL2 originally.
something just don't click right wouldn't you agree? :D
for all i know the Hammer we're working with is a scaled down version of whatever VAVLe is using. not that it really matters..i mean...we're all working with the same Source engine version. so...not complaining :wink:

[EYE] Valar

2008-04-07 04:45:38

staying more or less ontopic - can someone please advise me on a way to create video tutorials while in SDK hammer?

Fearsome*

2008-04-07 05:44:46

Anything you make up I think should be put in the wiki

[EYE] Valar

2008-09-25 01:13:21

I thought it would be nice to have all mapping tips and tutorials reside in one thread. For things to make sense in a larger perspective as well as be easier to find.

here goes...


Mapping Layout design - Optimization and Philosophy



Foreword

- This article deals with geometry, architecture and design. Not strategy planning or balancing the map’s choke points. Not weapon layout or any concepts in the gameplay sense. For this, read Cynips learned article here http://www.hl2dm-university.com/forum/p ... f=5&t=1397
In any instance a phrase like “successful map” appear herein – it refers to the geometry design and optimization aspects only and not the complete product.

- The use of the term “Choke” and “Choke point” does not refer to the net related Choke value showing in net_graph but to a busy spot or area in a map. In game.

- The views brought herein are personal. The facts brought herein are unquestionable. Make up your own philosophy as you will but learn the facts.




-- Architecture Philosophy --

I’m starting with that because I think philosophy, or the lack of, is the one thing that follows through every stage and is revealed in every aspect down to the finish map. Philosophy, in general, is the “Sweet spot” and the most powerful aspect in any art form or creative work.

Mapping is first and foremost architecture. Before adding any weapons, elevators, explosions you obviously start with at least some brushwork = Mapping is first and foremost architecture.
Successful architecture makes sense, is functional and makes you feel / sense something.
Some successful maps out there many find ugly or boring, however still you’ll find in those maps elements that meets these three points: they make sense, the design follows a function and they evoke feelings. And it’s irrelevant which feelings.

Looking at real life architecture (on the internet or in reality) helps a lot in understanding how architecture works. Looking at actual buildings, wrecked buildings or under construction …etc. it priceless. To name a few elements:
Floor thickness, wall thickness, the use of supporting pillars in buildings, architectural ornamentation, scale in general.
A misunderstood epigram says: “Even though something looks good on paper it doesn’t mean it will work in reality”. True! But anything that looks good in reality also looks good on paper. So it leaves us with the same equation –
It has to look good on paper! LOL. Paper in our case is Hammer.
Look at your work from a real life standing point and think – could this work in real life? Could this be a real building / corridor / hall / room / courtyard / basement / younameit…?

What is mapping?

Mapping is creating a virtual, 3D instrumentation of images and commands to attempt and represented “Real Life”. It is part of a “Universe” and this “Universe” has “Rules”.
Those “rules” range from Gravity to Friction to Magnetism and through lighting and numerous rules and properties from the computer graphics world. That is to mention the basics. One of those basic rules we will be talking about here is Mathematic based on the Power Of Two. Read about it here http://en.wikipedia.org/wiki/Power_of_two
Source is built, as are computers in general, on calculations of Power Of Two. This is if you would, how computers “Think”. And so…out the windows goes ..well basically…all True geometry. You will find that true geometrical shapes like Diamond, Pentangle, Octagon or Hexagram are impossible to produce in Hammer and can only be faked.

There are many aspects of these restrictions that you will come across and one of the concern of this article is how to marry the Power Of Two unavoidable restrictions with Real Life Architecture.


-- Hammer Applications --

Let’s learn a bit about the different programs used to build your map. While reading the following articles you may notice how level design and Optimization go hand in hand and cannot be separated.


VBSP (From: http://developer.valvesoftware.com/wiki/VBSP)
A compiling tool that creates the BSP (Binary Space Partition) file that will be your map. Can be run by itself to create a (test) map, but the additional use of the other two tools (vvis and vrad) is recommended for release maps.
Vbsp also places Detail Props on appropriate surfaces in a map.
There are various command-line options that can be used in combination with expert compile mode, a batch file, or directly at a Windows command prompt. For a complete list, envoke %sourcesdk%\bin\vbsp.exe at the command prompt, with no other parameters.


VVIS (From: http://developer.valvesoftware.com/wiki/Vvis)
A compiling tool that sets the portals on your map. It determines what must be rendered in a certain area (the PVS), allowing the game to ignore parts of the map, speeding up rendering.
Read: http://developer.valvesoftware.com/wiki/Visleafs
Even large maps can have Vis times reduced to a minute or two depending on your optimizations.

Read : http://developer.valvesoftware.com/wiki ... pile_Times


VRAD (From: http://developer.valvesoftware.com/wiki/VRAD)

VRAD is the compile tool that generates a map's lightmaps and per-leaf ambient lighting. It gives parts of the map, called patches, a certain amount of brightness depending on how much light it calculates it should receive.
VRAD is the generally the slowest of the three compilers due to the many, many calculations it must perform. Map optimization can reduce the speed of this tool somewhat; especially reducing the number of unique names given to lights (which reduces the number of dynamic light combinations for which radiosity must be calculated).
If you are watching the compile dialog and it looks like it has hung at 9... this is usually because Vrad takes longer with each light bounce calculation. Be patient.


-- Design and Optimization –


Design

There are arguably two types of mappers: The Visionary and the Blind Jazz man.
The Visionary gets a pen and paper and throws a few lines and gets a basic layout of his map. Or, simply has a strong mental picture of his map. The Blind Jazz man is free flying: playing with brushes. Moving, stretching, cutting, copy-pastin and basically “lets the pen go where it may”. Either method you map by you might want to keep a few philosophy driven notes in mind:

1) Most importantly - THINK ! THINK ! THINK ! Think BEFORE you start working. Think WHILE you're mapping and THINK HARD when you THINK you're done with the map: what is the gameplay like? What is the movement flow? DOES it have a gameplay? DOES it have flow of movement at all?

2) Realism - Even Killbox which are not "real" venues can and should LOOK realistic. this is very important as we may find that even if it has nothing to do with gameplay the LOOK of think makes one FEEL something. you either FEEL you're in a room, hall, corridor, hangar, warehouse that makes sense or you don't. The scales of things are a factor or RELATION. e.g. the relation of a catwalk to the walls and floor...the distance from them. a longer catwalk can be wider than a shorter one and so on...things can be made to make sense to one eyes. Many times the use of textures are a map's bane...or a map's highlight. Depends...how much THOUGHT went into the process.

3) Thinking - many times beginners and advanced mappers a like fall in the deep pit of their Thinking process. Many times one would be so involved into the process or in love with the design of him map that he may lose sight of the OVERALL point of view.
So - Thinking - means, looking at things in a broader sense. sometimes, looking too close at something makes you over focused on pettiness, or feel something is out of place when in the broader sense it isn't. so always see things of a broader / or higher standpoint.

4) Design should always follow a Function - what is this item doing here? Is it a design (detail) item? Is it a gameplay related item (weapon, ammo, catwalk, piece of floor, door, hole in a wall etc..) ? What does it do and how easy it is to use it? How fast can you take advantage of a lift if it's crammed behind two thousands props or walls...

5) All maps have choke points - better decide where YOU want your choke points and not let Chance call the shot. a Choke point can be a door connection to an important part of the map. a spot that holds a powerful weapon like a MAG or RPG, a combine ball spawner is a known choke point in killboxes for example. an RPG spot is usually a choke point in ALL maps. Think about the construction of those areas. How fast and how easy it is to get in and out of.

6) Lighting - Good lighting makes a map playable and easy on the eyes and it doesn't matter if the lighting scheme is rather dark, heavily lit or mildly lit.
Two most important things you need to keep in mind about lighting: A. Lighting exist to enable people to SEE. And B. Lighting makes people FEEL.
Lighting that is laid out too evenly throughout a map or a certain area might feel a bit pale and not interesting. On the other hand, patches of lighting many times feel and behave more realistic.

7) Spawn points - spawning a player in the middle of a heavily battled area is not too clever as ppl will die as soon as they spawn, making your map less cool for people to play. always better to find a shaded, protected or semi protected spot for a spawn point. Also mind where you player is facing. Don’t want to have them spawn facing a wall or window.

9) Cubemaps -learn about them and use this wisely. Cubemaps imitate real life in the sense of light transition and reflections to and on the player. a good placement of Cubemaps determines how realistic that aspect of your map is. Also, many textures have specular features and reflect light, many models do also...a map without Cubemaps will show all those as ugly silver-grey. Unattractive, boring, not professional. Use cubemaps.

10) Inspiration - if you run our of ideas: LEAVE. Don’t rape the map. Look for inspiration on the net, in other maps...in dreams and in movies...Creativity is an elusive power. Be nice to it and it will be nice to you. You cannot command it or foretell it. Doing so will only render self-beating and thoughts like: "ah crap, I’m no good at this. I better stop".


Optimization

By now we know, from reading the above linked articles that we must mind visleafs when mapping and preferably – even as early as in the planning stage.
It would be so cool to simply design the most amazing Tower planted in the center of a large yard and have players attacking it on all fronts. Cool? Yes. Is it a good idea for a map? No. it is the worse idea ever. From each corner of your map players will be able to see each and every area and every detail in those areas and your frames will feed the fish. What you want to do is to actually plan out your layout to be made out of a few main sections that have no view of eachother, connected by low in details, smaller sections. (e.g. two heavily detailed halls connected with a small / short corridor or small room. You will be able to draw out the room’s leaf from each of the big halls
But not eachother. The idea is the same as you expand more and more halls. We do keep in mind that a good layout would not include too much “main” areas but rather work on a fewer number of Main areas and simply work its way through them.
Example map - see dm_lockdown.
An example for a bad layout (FPS wise) is dm_powerhouse. The map is laggy at best. Yes, it was very successful back in the day but proving my point is Lockdown is still played and Powerhouse isn’t.
Another good example of a good layout is dm_lostvillage. The gameplay progresses through different areas limiting view of other areas of the map by the way it’s put together.


...To Be Continued....

Cynips

2008-09-25 01:44:44

Wow, really cool man! Looking forward to next part :D

And while I'm at it, this brings to mind thoughts about what can make a map successful for everything from 1on1 to 4on4 or maybe even 10 ppl free for all. There is seemingly a conflict between the map needing to be large enough to accommodate, say, 8 players while at the same time being small enough for players to find each other fast enough in a 1on1.

There are a few solutions to this, however, and even though you could simply make your map so that you have a good overview of it from pretty much anywhere this would obviously be bad from a technical point of view since frame rate would drop through the floor. Instead, you need to make your map very well connected. In some cases you might need to use jump pads or even teleports in order to maintain a good flow. Just keep in mind that bad teleport positioning can easily disrupt whatever gameplay structure you're trying to build into your map.

haymaker

2008-09-25 08:41:57

very nicely done Valar, should be pasted into a sticky imo

Also perhaps you could do a little section on player and prop clips, seeing as you started this idea :)

i have to point out that the original Lockdown is terribly optimised though, as far as what could have been done...running through the original with mat_wireframe on there's no evidence of hinting at all, no propfading, no portaling...it runs OK for the most part but if someone looks at the SDK version it's full of unnecessary crap. I would say Zeta has to be the most impressive piece of optimizing in a well-known map.

OD_Knuckles

2008-09-25 09:50:20

I place a huge brush around my map, then HOLLOW o_o; then I place the nodraw texture on it, and paint the visible faces with skybox, am I wrong? WHY? why does that affect gameplay?

[EYE] Valar

2008-09-25 15:52:56

haymaker wrote:i have to point out that the original Lockdown is terribly optimised though, as far as what could have been done...running through the original with mat_wireframe on there's no evidence of hinting at all, no propfading, no portaling...it runs OK for the most part but if someone looks at the SDK version it's full of unnecessary crap. I would say Zeta has to be the most impressive piece of optimizing in a well-known map.
that is true. however i do think that layout wise. built wide - LD is done pretty good and holds a decent game play although the laggy areas and all..so as an example to a clever brushwork - yes LD is good. could it be optimized? - yes of course. you're absolutely right.
OD_Knuckles wrote:I place a huge brush around my map, then HOLLOW o_o; then I place the nodraw texture on it, and paint the visible faces with skybox, am I wrong? WHY? why does that affect gameplay?
:twisted:

[MB]Brunt

2008-09-25 21:20:14

[EYE] Valar wrote:staying more or less ontopic - can someone please advise me on a way to create video tutorials while in SDK hammer?
i cant tell you how to do that,but wouls like to say i just got the noesis level desing dvd and watching some one on vido do things i have only read about befor realy helped me alot.i all so think from what ive seen of valars tuts valar could do a much better job.

[EYE] Valar

2008-09-25 23:40:41

Thanks m8.

...

-- More on Grid and Power of Two --

AS we can now see, everything in Hammer is calculated by Power of Two. Meaning: 2 units, 4 units, 8 units, 16, 32, 64, 128, 256, 512, 1024 and so on…
VVIS also creates a cut in every 1024 mark so if forces us to work by grid. And not only that, it forces us to work by measures of Power of Two. Always.

When you create a floor brush – try 16 units to 32 units thick. When creating a wall, try 16 units to 32 units thick. Wall heights, preferably: 96, 128, 144 or 192.
When you’re creating a short buffer room connecting two rooms / areas, try working the same way when creating its walls, floor and ceiling brushes.
Room size – try making your room’s walls outer faces make up the volume of your room. Be that volume any combination of figures that are Power of Two. Reducing visleafs.

Working by the grid and with Power of Two makes more sense to hammer and will always work in your benefit as you’re working WITH VVIS and not AGAINST it, reducing compile times, reducing probability of errors, less options for leaks, textures were also created in scales of Power of Two...
Out-of-grid World brushes are most likely to cause issue or errors. Avoid it and always work with Snap To Grid is checked. Brush based entities (func_door, f_detail, triggers etc…) can be out of grid as they have no relation to it. Entities don’t cut vis.

Get acquainted with the Map menu in Hammer. A lot of goodies!!
http://developer.valvesoftware.com/wiki/Hammer_Map_Menu

. . .
val

Sacrifist

2008-09-30 03:11:56

haymaker wrote:very nicely done Valar, should be pasted into a sticky imo

Also perhaps you could do a little section on player and prop clips, seeing as you started this idea :)

i have to point out that the original Lockdown is terribly optimised though, as far as what could have been done...running through the original with mat_wireframe on there's no evidence of hinting at all, no propfading, no portaling...it runs OK for the most part but if someone looks at the SDK version it's full of unnecessary crap. I would say Zeta has to be the most impressive piece of optimizing in a well-known map.
Have you decompiled overwatch and looked at it? Its by far worse off then LD is. As an example, I ported Overwatch to TF2. In TF2, fps is by far worse then in HL2dm on an identical map. For example, say you get 100 fps in LD, in TF2 you would get 30 fps lol.

Back to my point. I ported Overwatch to TF2 and was able to raise fps by about 100 frames just by making a few simple adjustments and adding some hints. From what Ive seen with all of Valve's maps, they are pretty and have nice layouts, but they are very lazy with optimization. I would even go as far as saying that they are flat out sloppy.