Archive for December, 2013

In this post I will show you how to create spawn points for Counter Terrorist and Terrorist units. I’ll also include creating weapon buy zones for each side. I’ll also show you the best way to run the map.

Spawn Players

There are two ways of adding spawn points into map; either individually or as a bulk (5 players) by using func_instance.

We will start by adding them individually. To do this you will need to select the entity tool or [Shift+E], then filter for either;

  • ‘info_player_terrorist’ for Terrorists (This is set as a default for the entity tool)
  • ‘info_player_counterterrorist’ for Counter Terrorists

In the right bottom side of hammer editor, in the Objects drop down list.

Once you have picked on, then you will need left-click in the textured view somewhere in the word to add the entity. You may need to rotate the player start to make sure that when the player spawns, they will face the direction you want them to. Most maps and modes allow up to five player entities per side/team. You could add more that five but only five will show in-game.

spawn1

Now we go on to adding players in a bulk. Select the entity tool and filter for func_instance’. Once you have added the entity to where you want players to spawn, enter the func_instance entity properties. In VMF Filename field select the Browse button.

spawn2

A dialogue window will pop up and will displaying the contents of the maps folder. There will be folder by name ‘instances’, double click the folder. Within the instances folder there should be two vmf files; spawn_t.vmf and spawn_ct.vmf. Selecting spawn_t will give you five terrorists player entities, while spawn_ct will give give counter terrorists player entities. Select spawn_t.vmf as we already added five CT players. Then click apply.

You will notice that five T players show hovering over func_instance entity. Last things left to do is to rotate the entity to allow the players to face the right direction and make sure that entity is touching the floor of the world.

spawn3

Player Buy Zones

Now we move on to Buy Zones. You will need buy zones for each team to allow players purchase weapons and gear. Buy zones are very simple to set up.

To create a Buy zone you will need to create a brush/block with the ‘trigger’ texture. Select the Block Tools or [Shift+B]. Then select browse from the right side of the editor to open the Textures window. Filter for ‘Trigger’ and select it. Texture should look like this;

buy1

Create block that holds the entity players within the block/brush

buy2

To turn the brushes to buy zones, you need to select one of the brushes and then hit [Ctrl+T] (or right click the brush on side,front or top view and select Tie to entity). A properties window will show;

buy3

Then you need to turn Class to ‘func_buyzone’ and then hit apply.

buy4

Now depending on the brush covering which team, change the field value for Team Number (int) to the team the brush covers. In this case I have selected the brush covering the terrorist team, so I set Team Number (int) to Terrorist.

buy5

Do the same for the other team but have field value to Counter-Terrorist and hit apply.

Running the Map

To start running map, select Run Map counter strike 1.42  located at the top of the hammer editor or hit F9 on your keyboard. A window will open looking like this;

runmap

  • BSP –  BSP tool is the one that actually converts the .vmf file data into a usable .bsp file that the game engine can load.
  • VIS – This tool creates the visibility matrix for the map based on the level’s geometry. This matrix is what determines which polygons the player can see, might see, and can’t see from any given point within the level in game.
  • RAD – The RAD tool, or Radiosity tool, is responsible for generating and applying all lighting effects in a level.

I wont go into different options, just set the setting on Run Map window to be same as shown on the image above. If you run map on these setting, you will need to make sure to add skybox and light_environment before running map.

 

In-game Images

2013-12-26_00001 

2013-12-26_00002

During the lighting post I did not give tutorial light_dynamic, and did not give tutorial for prop_physics during the prop post. The reason for this is require explaining props and lighting before giving tutorial as require abit of each when it comes to use them in CS:GO SDK. So I’ll give a tutorial on how to add physical ceiling light.

Previous Posts:

Physical Ceiling Light

Entities required are:

  • light_dynamic.
  • prop_physics.
  • phys_ballsocket – It simulates a rigid connection between the centre of its constrained entities and its own location that prevents them from changing relative distance and makes their rotation point its own location.
  • Building (Made up from brushes/walls).
  • (optional) point_spotlight (for effect).

Step 1 – Building a Dark Room

We start by creating a dark room to add our light into to see the effect more clearly. Start by select a texture by selecting browse from the right side of the hammer editor to call the Textures window. Preferred a dark or a grey texture, up to you (I’ll be going with ‘metal/citadel_tilefloor016a’)

darktext

Now move on to the building. Select the Block Tool or [Shift + B] blocktool. Then make sure that Objects drop down list on the bottom right side of hammer editor is set to ‘Block’. Then create four big walls and a roof.

A fast way of making four walls is by duplicate a single wall into four, and turn two of the walls 90 degrees. To duplicate select the object/brush, drag the brush somewhere on the map and while hold shift, release the left mouse button.
duplicate

To turn/rotate the object, right click the object/brush and select Transform and a small window will pop up. Make sure to Mode is set to Rotate and set the Z value to 90 then click OK.

rotate

Then all you have to do is connect together with no gaps and add a roof block. Should look like this from the inside;

building

Step 2 – Adding Physics light model

Select the entity tool, and filter for prop_physics and then left click on the roof block. In the prop entity properties under World Model select Browse button. Filter for ‘light’. While you have the info tab selected look for light model that is compatable with physics.

physics

Once you have found one click OK on the Model Browser. Give the prop entity a name (e.g. light1) and then select apply in the properties. You may need to rearrange the position of the entity to fit the world.

light

Step 3 – Adding a phys_ballsocket 

This is basically a connector, which is connecting physics object to the wall. Select the entity tools and filter in the bottom right side of hammer editor, in the objects drop down list for ‘phys_ballsocket’. Left click on the roof block to add the entity. Then rearrange position to be directly above the physics prop entity. like so;

socket

Then enter phys_ballsocket properties. Then set the Entity 1 field value to equal the physics prop entity name, which you gave (e.g. light1)

ballsocket

Then select Apply.

Step 4 – Adding light_dynamic

Select the entity tool and filter for ‘light_dynamic’, then left click in the world to add the entity. Position it to be set under the light model entity and make sure that centre x marker of light_dynamic entity is not within parameters of the light model entity. Like so:

lightdyn

Once that is done we move on to setting the light_dynamic entity values. Go into its properties by double clicking the entity.

properties

You will need to set the values of:

  • Parent to equal the light model entity (in my example is light1).
  • The inner and outer values to cover more surface area (60 for inner and 75 for outer is good)
  • Brightness (requires some in-game testing to get the best value)
  • Pitch Yawn Roll – 90 0 0 (Facing down)

properties2

Finally you need to set the Maximum Distance to view the affect light. To do this once you have selected the light_dynamic entity, you will notice a yellow circle in the side,front and top views or yellow sphere in the texture view. Select a white square from either the side or front view and stretch it until it inner and outer  emission lights are within the sphere.

maximum distance

Now test it by running the map.

(Optional) Step 5 – Adding point_spotlight

Select the entity tool and filter for point_spotlight. Add it to the world by left clicking and position it in the same position as the light_dynamic entity. Within its properties set these values:

  • Parent – light1.
  • Spotlight length 100, keep the Spotlight With on 50.
  • Pitch Yawn Roll – 90 0 0 (Make sure the spotlight is facing down)

In-game shots

2013-12-19_00001(Light emitting at me after being shot)

2013-12-19_00002(Light going in the other direction)

In this post I will cover props. Props are model entities. I will go though the types of props available in Counter-Strike: Global Offensive-SDK. I will go though how to use them properly within the editor.

There many different types of props available in SDK, these are the types:

  • prop_detailed – Detail geometry – static models that do not move. Do not contain any physics properties or collision data. Cannot break. Do not cast shadows. Can be automatically placed by assigning a detail type to a material. Generally not placed individually by level designers. The least expensive geometry to render. These may not even be rendered on low-end machines. (e.g. grass, rocks and plants)
  • prop_static – Static geometry – models that do not move. Does not contain physics properties other than collision, and cannot break. Cannot have any joints or animation. Casts lightmap shadows. Inexpensive geometry to render. (e.g. pipes, light fixtures, rocks and telephone poles)
  • prop_dynamic – Models that can be placed in hierarchy and can have joints and play animations. Can also be configured to break when taking enough damage. Can be hierarchically attached to other objects. Can cast dynamic shadows. More expensive than static geometry, less expensive than physics geometry. (Used for models that have animation such as Robotic arms etc…)
  • prop_physics – Models with built-in physical properties. Moves and collides using the rigid-body physics system. Can be constrained to other physics objects using hinges or other constraints. It can also be configured to break when it takes enough damage. Casts dynamics shadows. Expensive to move and render. (e.g. barrels, small debris and furniture)
  • prop_ragdoll – Physics props with ragdoll physics skeletons. Have all the properties of physics props and can also use the rigid body ragdoll physics system to have multiple colliding or bending parts. Very expensive to move and render. (e.g. Corpses, multi-piece cardboard boxes and mattresses)
  • prop_physics_multiplayer – Physics props using a simplified physics collision system designed for multiplayer games. Have less networking overhead than standard physics props, necessary for the bandwidth-limited environment of multiplayer games.
  • prop_dynamic_override – Special prop type used to convert a model that is designed to be used as a prop_static, and giving it the properties of a prop_dynamic. Has identical cost of a prop_dynamic.

Inserting Prop Models

To add a prop model, first select the entity tool

Then on the right hand side of the hammer editor, use the objects drop down menu filter for the entity you want to place. Choose either prop_static, prop_physics, prop_physics_multiplayer, prop_dynamic_override, prop_ragdoll or prop_dynamic.

In perspective/Texture viewport, left click to place the entity.Now we will have a place holder for a prop model. Double click on the red entity place holder. In object properties for the model prop, select World Model and click on Browse.

prop

Model Browser will open up, and then you are able to choose a model from the hundreds of models available. Use the filter option to type in a search for specific models you are looking for.prop2

Depending on which prop entity you chose (static, dynamic or physics) click over to Info tab to see if that prop model supports your prop type. (If dynamic it will also support prop_ragdoll, prop_dynamic_override. Else if physics then it will support prop_physics_multiplayer)

prop3

Once you have the model you want, select OK on Model Browser, then Apply on the entity properties.

Hints:

  • If adding physics models, use prop_physics_multiplayer instead of prop_physics.
  • On certain light models its best to use them as prop_dynamic_override instead of prop_static.

Inserting Prop_Dynamic (Animation)

To add animated object first need to search for object that has animation to it. Add an prop_dynamic entity.

In object properties for the model prop, select World Model and click on Browse. In purpose of this tutorial filer for ‘helicopter’. You will notice that under the sequences tab there are few different sequential events.

animationThese events are the animation that mode can perform. So to allow animation on the model need to first select this model then click OK in the Model Browser. As you return to the the models’ properties window search for field Default Animation and set the parameter to equal one of the sequences, like so (I have set it to 3ready):

animation2

Once you have set the Default Animation, then it’s done. Select Apply to finish.

Hint: If a model does have an animation, but the only sequence is idle then set the default animation of the entity to idle.

In this post will go through different types of lights available in the Counter-Strike:Global Offensive-SDK. I’ll also give tutorials on how add some of these lights, show how they work and show how they would look like in-game.

The types of lighting in source sdk can be split up into two:

Static Sources, static lighting is compiled into Lightmaps, which illuminate brushes and models, and Cubemaps, which provide static reflection. Dynamic Sources, dynamic lighting is calculated at runtime, which makes it expensive to render. This includes entity lights:

  • light – A static, omni-directional point light source (e.g. naked light bulb)
  • light_spot – A static, uni-directional point light source (e.g. torch or flashlight).
  • light_environment (Covered this in the last post here: http://goo.gl/VxnKGw )
  • light_directional –  It is a directional light with no falloff.
  • light_dynamic -A simple, uni-directional dynamic light that can be moved, turned, and adjusted.
  • point_spotlight – A dynamic spotlight beam effect, with an optional dynamic light source where it hits a surface.
  • beam_spotlight – Will draw a beam when the player views it side on, and a halo when it’s facing towards the player.

MAT_FULLBRIGHT

If you compile your map and run it in-game, Source will default your lighting to full bright. Once you insert a light into your map, the engine will switch full bright off and begin calculating your lighting. The console command for full bright are:

  • mat_fullbright 0
  • mat_fullbright 1

Mat_Fullbright is a useful command in Source. You can use it to gameplay test your map without worrying about setting up lights. Unfortunately right now, mat_fullbright is buggy and does not produce full bright map.

Adding Light to Map

Enough with the back ground lecture, now I’ll show you how to add certain light entities into your map. I’ll go through these light entities; light, light_spot, point_spotlight and beam_spotlight.

To add light entity first select the entity tool entity tool

Then type in the bottom right hand side of the hammer editor, under object ‘light’

Then to add the light entity just left click somewhere in the world (Where you would like to place it, just make sure not add it within an existing brush/object)

Hint – The x simple on the entity represents the centre, but can also represent the point of where the light starts emitting. So make sure if you want to light the objects/brushes around do not have x within an object/brush or prop.

light

Double click the entity to display the properties to alter any necessary settings.

lightprop

Useful fields that you need to take into consideration when using light entity:

  • Name – Could give name to the light entity for reference or parenting.
  • Brightness – takes four values, first three (255 255 255) is the colour of the light. The fourth (200) is the brightness of the light.
  •  Appearance –  Is how the light could appear in-game. Normal is constant light emission, Fluorescent flicker is that light will flicker and you will get the rest.

Here is in-game view of light at with different values for fields. (R-L) Standard light, Brightness set at 750, Colour change to blue and final appearance set to flicker (unfortunately unable to view the flicker in action with a screenshot).

2013-12-04_00001

Now we move on to light_spot. This entity only works by emitting light in one direction and it is not as bright as light entity. To add the entity select the entity tools and filter for ‘light_spot’ under objects in the right hand side of the hammer editor.Left-click where you would like to place the entity in the world.

light_spotprop

Useful fields that you need to take into consideration when using light_spot entity:

  • The ones that were included in the light entity properties (Name, brightness and appearance).
  • Pitch Yaw Roll (X Y Z) – The direction of where the light is emitting.
  • Inner (Bright) angle – Focus light.
  • Outer (Fade) angle – Outer fade light.

Here is in-game view of light_spot at with different values for fields. (R-L) Standard light_spot, Brightness set at 750, Colour change to blue and last has its Inner and outer set to 60 and 75 (Notice the light cover more surface area and first one)

2013-12-04_00002

beam_spotlight and point_spotlight are similar so I’ll cover them together (I sometimes forger which does what). Again after selecting the entity tool, filter the object for either ‘beam_spotlight’ or ‘point_spotlight’ (depending on what you need). Left-click on the in the world to add the entity. The arrow should indicate the direction of where the entity will emit.

beam&point

The additional field provided in their properties that will interest you are:

  • Spotlight Length
  • Spotlight Width

I do not need to need explain these, I’m sure you already understand what they point to.

Here is in-game view of beam_spotlight(top) and point_spotlight(bottom). Main and most notisable difference is that point_spotlight is stronger and brighter than beam_spotlight.  (R-L) Standard values, Colour change to red, then I halved the spotlight length and width. The last one is mistake, its the same as standard values.

2013-12-04_00003

I think you have noticed that beam_spotlight and point_spotlight do not provide any light to the environment. They are more than an effect that helps make the map or objects more interesting.

I’ll not show light_directional because there isn’t much use for it, as well as I’m not sure how to set it up, as I never was required to use it. light_dynamic cannot be used alone, and as I haven’t introduced props yet I have decided to save this for a future post.