3 Jul 2010

NPC Door Navigation

Author: LevelDesigner.eu | Filed under: Half-Life 2

NPC Door Navigation


Hello, in this tutorial you will learn how to create NPC’s that can open and travel freely through doors.
This tutorial requires basic knowledge of Hammer. You must know about basic entity creation.

Creation Of The Environment
Firstly open up a map or create a new one, then find or create the doorway you want NPC’s to be able to open/ move through. The door must be made from a prop_door_rotating entity. Simply create this entity, browse for the world model you want (just search for door, it has to be a door model!). Also the door must start unlocked to allow the combine to open it. I have create a reference map with two rooms. One for the Combine and one for the player as shown below:

Creation of the Node Graph
For the Combine to open and move through the door, requires a valid nodegraph link travel through the door. To do this create an entity and make it a info_node_hint; Go to its properties, down to type and select Entrance / Exit Pinch. Place this entity directly in the middle of the door like so:

This ensures that NPCs traveling through the doorway do so one at a time. Now all that’s left is to create the link through the doorway and alternate exit/cover points or Flank Nodes. To create these create and entity and make it an info_node. Place one out side of the door way but in line with the info_node_hint] we made earlier. Place another info_node on the opposite side like so:

Make sure to place the info_nodes slightly ahead to decrease the likelihood of NPCs stopping too close to the door and causing congestion

Now theres a straight line to tell the AI that the door can be open and walked through and there needs to be four Flank Nodes created to allow cover during combat. This is made by simply placing four info_nodes on either side of the wall where the doorway is located. It should now look something like this:

Add some more info_node’s to further guide the AI around your level, compile your map and you now have NPC’s that can open and move through the door.

Combat
Valve’s AI does not yet contain any door-specific combat code. NPCs will stand in doorways when others from their squad attempt to pass through, and do not understand the principle of clearing a room from a door entry. For these reasons, combat in or around doorways should be either avoided, or semi-scripted with assaults. It is quite possible to have NPCs enter a combat area through a door, but without custom AI code the door itself should not be a point of interaction.
I hope this tutorial helped and you were able to create NPC’s that can open and move freely through doors. Just remember Zombies and Striders cannot open doors!

Source: http://www.fpsbanana.com/tuts/8805

3 Jul 2010

Laser + Multi Manager + Button

Author: LevelDesigner.eu | Filed under: Counter-Strike, Half-Life

In this tutorial i will show you how make a laser activated for 10 seconds, or 11, or 12, etc.

1. In your map, put a env_laser and a info_target

2. Right click on the env_laser and go to properties, and follow this settings:

- Name: laser
- Target of Laser: target
- Brightness: 100 (Default, change if you want)
- Beam Color: (Click on the “Pick Color” and choose one, in my case red)
- Width of beam: 20 (Default, change if you want)
- Amount of noise: 20 (0 Default, change if you want)
- Damage / second: 100 (Default, change if you want)

Go to FLAGS and follow this settings:

- StartSparks: YES
- EndSparks: YES
- Decal End: YES

3. Right click on the info_target and follow this settings:

- Name: target

4. Go to Entity Tool, Choose multi_manager and put somewhere on map. Right click on the multi_manager and follow this settings:

- Name: trap

Click on SmartEdit and after click on add and put this:

- Key: laser
- Value: 0.1

Again click on add and put this:

- Key: laser#1
- Value: 9.9

5. Make a form of button, apply a texture with name: +0~METALSTCH2 (texture of halflife.wad of cs/valve)

6. Select button form with Selection Tool, and press CTRL+T ; And from list select func_button and follow this settings:

- Targetted object: trap
* If you don’t have “Targetted object” ; search and use “Target”
- delay before reset: 3 (Default, change if you want)

Go to FLAGS and follow this settings:

- Don’t move: YES

And this is it:

8 Jun 2010

env_global

Author: LevelDesigner.eu | Filed under: Entity List

description

The env_global entity is used to remember information across level transitions.

usage

The env_global seems a bit complicated to use, but it really is quite easy. Here’s a brief list of the steps I took in the example map.

  1. In global1.bsp, i’ve got a button that activates some things. This button has a multisource master specified (button_master).
  2. The button_master multisource has a Global State Master of levelpower. This means that the multisource will not be “on” until the levelpower global variable has a state of “on”. You must now walk through a hallway, through a level transition, into the global2.bsp map.
  3. In global2.bsp, i’ve got a button which targets an env_global.
  4. The env_global has the following properties:
      Name - level_power
      Global State to Set - levelpower
      Trigger Mode - Toggle
      Initial State - On
  5. When the button triggers the env_global, the levelpower global variable is created with its state set to On. Each time the button here is pressed, the state of the levelpower global variable will toggle between On and Off. Make sure the power button is on (you’ll be able to tell from the texture of the button whether it is on or off), then walk back down the hallway through the level transition into the room you initially started in.
  6. The button will now be usable, allowing you to turn some things on and off.
  7. You can go back to the other room and turn the power off, or on, as many times as you like.

Notes
When setting up and testing the env_global entity, it is very useful to know which global variables are active and what their current states are. You can check on this information by using the impulse 104 cheat. Either type this at the console or bind a key to it. It will display the following information:

    – Globals –
    global_variable_name: level_last_modified (state)

In the example maps provided, after you press the main power button, issue the impulse 104 command and you will see: levelpower: global2 (On), meaning the levelpower global variable, which was last set in the global2 level, is currently On.

properties

  • targetname (target_source) Name – Normally, the env_global must be activated to set the initial global state. (You can use the Set Initial State flag to avoid this, see below). Give it a name here, and activate it with a button or some other trigger.
  • globalstate (string) Global State to Set – This is the global state you want to modify. This is also the value to use in other entities (ie: the multisource) when it asks for a Global State to Read.
  • initialstate (integer) Initial State – This will be the state the global variable starts in. Values range from 0 to 2, with the values corresponding to off, on, and dead. If you want the global variable to have this state immediately without having to activate the env_global, set its Set Initial State spawnflag.0 – Off (default)
    1 – On
    2 – Dead
  • triggermode (integer) Trigger Mode – This will be the state the global variable is given when the env_global is triggered. Values range from 0 to 3, with the values corresponding to off, on, dead, and toggle. If you set the Trigger Mode to toggle, each time the env_global is activated, it will toggle between on and off, starting on whatever is set as the initial state (below). The dead state is for use with monsters.0 – Off (default)
    1 – On
    2 – Dead
    3 – Toggle

    flags

    This entity has the following flags. Flags can be either on or off. In the editor, these flags can be accessed in the Flags section of the entity properties.

  • 1 - Set Initial State
  • The env_global entity is used to remember information across level transitions.The env_global seems a bit complicated to use, but it really is quite easy. Here’s a brief list of the steps I took in the example map.

    1. In global1.bsp, i’ve got a button that activates some things. This button has a multisource master specified (button_master).
    2. The button_master multisource has a Global State Master of levelpower. This means that the multisource will not be “on” until the levelpower global variable has a state of “on”. You must now walk through a hallway, through a level transition, into the global2.bsp map.
    3. In global2.bsp, i’ve got a button which targets an env_global.
    4. The env_global has the following properties:
        Name - level_power
        Global State to Set - levelpower
        Trigger Mode - Toggle
        Initial State - On
    5. When the button triggers the env_global, the levelpower global variable is created with its state set to On. Each time the button here is pressed, the state of the levelpower global variable will toggle between On and Off. Make sure the power button is on (you’ll be able to tell from the texture of the button whether it is on or off), then walk back down the hallway through the level transition into the room you initially started in.
    6. The button will now be usable, allowing you to turn some things on and off.
    7. You can go back to the other room and turn the power off, or on, as many times as you like.

    Tags: , , ,

    8 Jun 2010

    Nav Generate

    Author: LevelDesigner.eu | Filed under: Left 4 Dead, Left 4 Dead 2

    1. Go in-game,start your map.
    Type in console: sv_cheats 1;nav_edit 1;z_debug 1;nav_mark_walkable;nav_generate
    NAV is now generating but your map still not finished.
    2. Search for a place then aim at the NAV.
    Type in console: mark PLAYER_START
    3. Now aim at a new NAV and type in console: nav_flood_select
    Unmark the PLAYER_START with nav_mark(first aim at that nav)
    4. And now type in console: mark FINALE
    5. Now do the same at 3. but now not mark with FINALE,now mark it with BATTLEFIELD(mark BATTLEFIELD)
    6. Type in console: nav_save;nav_analyze;sv_cheats 0 .
    Now your map is finished and ready-to-play.
    Enjoy!

    Source: http://www.fpsbanana.com/tuts/8533

    Tags: , , , , , , , ,

    8 Jun 2010

    Half-Life 2 Mapping

    Author: LevelDesigner.eu | Filed under: Half-Life 2

    Ok half life 2 mapping, here we go.

    SECTION 1: Deadlines & Publishing

    first off all mapping is a HUGE subject and i am only going to tell you how to improve the quality of maps. i used to think, halfway through a map, right. this needs to be published soon… WTF!! NO IT DOSENT. just remember, you have nobody poking you with a stick forcing you to complete this map by a certain time.. just take your time.

    SECTION 2: Quality improving tecniques

    ok here we go. improving the quality of existing maps. so you have a map that has potential??? right.
    the main thing is… CORNERS and EDGES. most of the time they dont level up and arent square or just dont look good there. In hammer you can just zoom right in and carfully line the edges up and as for them not quite looking right, use your initiative, put a light on the corner or even round the corner off… also just remember that this is “HALF-LIFE” not “REAL-LIFE” so add something futureistic just to make the building look better.

    SECTION 3: Ideas for accesories or improvements

    there is a game out there called “half-life2″ which might i say has exellent mapping, so if your stuck just take a look at the first levels in the city and take some ideas from that to accesorise your map and just take time to wander around and marvel at the beauty!

    SECTION 4: finishing up

    right youve got your HUGE and AMAZING map to show the world all finished and brushed up. Before you publish. just take the tim to look for bits that players dont see and texture it with “tools/tools_nodraw” for example the outside of a skybox and underneath the map… this will reduce the size of your map and compiling time and also rid of lag :)

    HTML will be coming soon to this and i will be adding MORE info. just bare with me :) thanks for reading. all feedback appretiated.

    Source: http://www.fpsbanana.com/tuts/6864

    Tags: , , , , , ,

    6 Jun 2010

    Round Time

    Author: LevelDesigner.eu | Filed under: Team Fortress 2

    TF2/Round time

    Time is a precious thing, without it, a map could never end, but with it, you can do amazing things.

    Why time is important

    Time can change the outcome of a match, and it can make it completely unbalanced.

    Too little time will make the defensive side of a map easier to win with, while too much time will give the offensive side too much time to complete the objective, making constant defense hard. For example, imagine Dustbowl with 30 minute round times…

    With that in mind, be sure to make the time on a round enough to not be too challenging for either team.

    Before you start

    1. Place the team_round_timer anywhere on the map. This entity controls the round time, so it’s very important!
    2. Name the entity something, a suggestion would be roundtimer.

    Setting up time

    Setup Timer

    To create setup time (the time before the round starts), all you need is a team_round_timer entity.

    1. Open up the Properties of team_round_timer.
    2. Change setup_length (Setup time length) to the time of the setup period (in seconds).
    3. Remember to change Start Paused to No.

    ADVICE: Do not make the setup time extremely long, anything above 2 minutes is too long!

    Adding (or Subtracting) time

    This simply involves using the AddTime input into the team_round_timer entity (that I assume you have placed somewhere).

    1. On the entity you want the output to come from, type in the name of the team_round_timer entity (which you should of named).
    2. On the “Via this input” section, enter AddTime.
    3. Enter the amount of seconds you want to add/subtract in the “With a parameter override of” section (I assume entering negative numbers will subtract time).
    4. (Optional) Place the delay between the time the input starts and when it is activated in the “After a delay in seconds of” section.

    Adding (or Subtracting) time for a team

    This is the same as the previous one, except that instead of a generic “Time has been added message”, there will be something along the lines of “Congratulations. We have been awarded additional time” for the team receiving time, and “The enemy has received addition time!” for the other team. Use the input AddTeamTime. For the parameter override, type 2 for red or 3 for blue along with a space before the time to add, e.g. 3 300

    Setting time specifically

    Using the SetTime input, you can set the time to any specific time you want.

    1. On the entity you want the output to come from, type in the name of the team_round_timer entity (which you should of named).
    2. On the “Via this input” section, enter SetTime.
    3. Enter in the time you want to set it to in seconds.
    4. (Optional) Place the delay between the time the input starts and when it is activated in the “After a delay in seconds of” section.

    Source:  http://developer.valvesoftware.com/wiki/TF2/Round_time

    Tags: , , , , ,

    Grouping and VisGrouping

    Even relatively modest Hammer levels can contain hundreds—even thousands—of objects. Hammer offers two ways of keeping track of items in your level: normal grouping and visibility grouping (VisGroups).

    Note:VisGroup refers to “visibility group” and has nothing at all to do with the Vvis compile tool. Both groups and VisGroups only affect what you see in Hammer and have no in-game effect.

    Groups

    Normal grouping is used to “glue” object selections together.

    The object shown above is made of eight brushes. If you were to click on a single brush when the object is ungrouped, only that brush would be selected; you’d have to CTRL-click each piece to select the whole thing (or drag a selection box over the whole thing). When the object is grouped, however, you can click on any individual brush to select everything in entire group.

    • Brushes do not need to touch in order to be grouped together.
    • Groups may contain any combination of brushes and entities.
    • You can work on an individual piece of a group of objects by enabling the Ignore Groups option.
    • Grouped objects can be combined with VisGroups (see below).
    • Grouped objects have no relation in the Source Engine, grouping is purely for selection purposes in Hammer.

    To group a set of objects:

    1. Select the objects you wish to group together.
    2. Select Group from the Tools Menu, or press CTRL+G.
    3. The objects are grouped together and can be selected, moved and edited as one.

    VisGroups

    VisGroups stands for visibility groups. VisGroups make managing objects easy by letting you control what you see on your screen. With VisGroups, you can arbitrarily assign objects to a specific group; you can then turn the visibility of that group on and off.

    Hiding eight objects:

    1. Select the eight objects you wish to hide.
    2. Choose Hide selected objects from the View Menu.
    3. The New VisGroup dialog will appear. Make sure Create a New VisGroup is selected, and click OK.
    4. A VisGroup is created named “8 objects” and is marked as not visible in the Filter Control Bar.

    Let’s say you have the following section in your map:

    Now, you’d like to be able to make the furniture a group, but you still want to move each piece around independently from the others. This is precisely what VisGroups are good for.

    First, select the furniture pieces, then choose Hide selected objects from the View Menu. The New VisGroup dialog will appear:

    Click OK to make a new VisGroup. This will do two things: hide the objects in the 2D and 3D views, and create a new VisGroup with the selected objects.

    The new VisGroup will appear in the Filter Control toolbar named after the number of objects it contains. To change the name of the VisGroup to something more suitable, select the VisGroup, then click on it again. You will be able to change the name to whatever you like. You can also click to the left of the name and the VisGroup’s visibility will be toggled. You must press the Apply button for the changes to take effect.

    Warning: A vis group with no objects tied to it will get removed from the list.
    Warning: More than 128 visgroups will begin to function improperly.

    Some things you can do with the mouse in the Filter Control toolbar:

    • Drag one VisGroup onto another VisGroup. The first VisGroup will be merged with the second VisGroup, and the resulting VisGroup will keep the name of the second.
    • Drag a VisGroup out of the Filter Control dialog. A dialog box will open asking if you wish the the VisGroup to be deleted.
    • Drag a VisGroup with the Right mouse button on another VisGroup. The first VisGroup will become a parent of the second.
    • Drag a child VisGroup onto the white space at the bottom of the VisGroup list. The parent-child relationship will be removed and the VisGroup will appear back in the top level of the list.

    If you make the furniture group visible, then select it and press the Mark button, the group will be highlighted in the 2D and 3D views.

    The Edit button brings up the Object Groups dialog.

    This dialog allows you to change the name and color of existing VisGroups, or delete them. Deleting the VisGroup does not actually delete the group’s objects, it just eliminates the VisGroup, making them individual unlinked objects. You also have the option of creating new (empty) VisGroups with the New Group button.

    The last way you can use VisGroups is through an Object Properties, in the VisGroup tab. To assign the object to a VisGroup, just select the appropriate group. To remove the VisGrouping from this object, simply uncheck all of the boxes.

    Source: http://developer.valvesoftware.com/wiki/Grouping_and_VisGrouping

    Tags: , , , , , ,

    Construction

    To add a water volume to your level, follow these steps:

    1. Create a brush the size of the water volume using the Block Tool.
    2. Open the Texture Browser by clicking the Browse button on the Texture Bar.
    3. Double-click the tools\toolsnodraw material in the Texture Browser.
    4. With your water brush selected, click the Apply Current Texture button to assign the tool textures|tools\toolsnodraw material to the whole brush.
    5. Select the Texture Application tool, which opens the Face Edit mode.
    6. Left-Click the top face of the water brush in the 3D view to select it.
    7. Click Browse to bring up the Texture Browser again.
    8. Type water into the filter field. This will show you all materials with the keyword water in their name.
    9. Select a water material to apply by double-clicking it. One water material to try is nature/water_canals_water2.
    10. Click the Apply button on the Face Edit panel.
    11. The brush should have water correctly applied. Compile and run your map (with VVis and VRad enabled) to test it.
    Note:In order for water surfaces to render correctly, it is necessary for your map to have a skybox.
    Note:L4D2 maps also require an env fog controller

    Cubemaps and water

    Cubemaps are important to use with water surfaces. On lower than DX9 level video cards, it is not possible to render the real-time reflective water shader. For these cards, an env_cubemap entity provides the pre-calculated environment map use to render water on sub-DX9 cards.

    Adding a env_cubemap to water surfaces:

    1. Add an env_cubemap entity using the Entity Tool.
    2. Place the env_cubemap above the top surface of the water, near the center.
    3. Double-click the env_cubemap in the 3D view to bring up the Object Properties dialog.
    4. Click on the Brush faces key in the Object Properties.
    5. Click the Pick… button. The mouse cursor will change to the eye dropper icon.
    6. Click the top water face to select it with the eyedropper. The face will highlight in red, to show it has been associated with the env_cubemap entity.
    7. Close the Object properties dialog.
    8. Compile and run your map. After the map is loaded, open the developers console and type buildcubemaps. The engine will calculate an environment map for each env_cubemap entity, and save the data into the BSP file.

    Source: http://developer.valvesoftware.com/wiki/Adding_Water

    Tags: , , ,

    6 Jun 2010

    env_funnel

    Author: LevelDesigner.eu | Filed under: Entity List

    description

    The env_funnel entity creates a large number of sprites and particles that start dispersed and all funnel into one point (the point at which the entity is placed).

    usage

    This is the same effect that is seen in the Half-Life disaster sequence. It’s only property is a Name (targetname), as the entity must be triggered to work. It can only be activated once.

    Its one available flag, Reverse (1) creates a rather interesting effect. The funneling action happens in reverse, and the sprites and particles burst forth from the single point, creating a kind of fireworks explosion effect. Too bad you can’t change the color of the particles!

    properties

    ration (string) Duration (seconds) (default: 2)

  • targetname (target_source) Name
  • flags

    This entity has the following flags. Flags can be either on or off. In the editor, these flags can be accessed in the Flags section of the entity properties.

  • 1 - Reverse
  • description

    The env_funnel entity creates a large number of sprites and particles that start dispersed and all funnel into one point (the point at which the entity is placed).

    Tags: , , , ,