Insurgency

Insurgency

29 ratings
Map Contest Week 5: Multiplayer Entity Setup
By Spearin and 1 collaborators
This guide will explain in technical detail how to create a multiplayer level for Insurgency. We will also release a Coop technical guide once we reach that step with our example level.
   
Award
Favorite
Favorited
Unfavorite
Block out
Also known as white-box, this is the fundamental first step of creating a level. In this phase we’re taking our sketch and create a rough version of our layout in Hammer. The most important thing is to not focus on the smaller details of the level, but only on the parts that matter for the gameplay. So when necessary we can easily adjust the geometry in our level.
Spawn areas
Now with the block-out in place, it’s time to add spawns for both teams.
We start by creating an entity called ins_spawnpoint and place it in the location where we want the Security to start. Now open its properties and set Team Number (int) to “Security” also check if the World Model is set to “models/characters/security_standard.mdl” This setting won’t apply to the game but is important in hammer, to see for which team these spawn points are set.
Next we go to the tab: Flags and set “Controlled by Spawnzone”.

At this point we have one working spawn point, but we need at least 16 for each team. So now we’re going to duplicate this spawn point 15 times and place them close to each other. Make sure that there is enough space between each spawn and that they’re not overlapping with geometry or props.


Next we create a brush around our spawn points. Select this brush and tie to entity: ins_spawnzone and set the following properties:

Start Disabled: Yes
Team Number (int) : Security
Name: spawnzone_neutral
Block Zone: blockzone_sec

Now with this in place we can already spawn at the security team, to quickly test our map. But as soon we try to spawn on the Insurgent side, the game will crash.

The next step to avoid this from happening is creating a spawn for the Insurgents, which can be accomplished in several ways. We could choose to add the entities from scratch, but instead we’re going to copy the existing ins_spawnpoints and ins_spawnzone and paste them at the destination where we want to spawn the Insurgents team. Now that’s done, we have to change a few important settings. First thing we do is open the properties of the ins_spawnzone and set the following:

Team Number (int): Insurgents
Block Zone: blockzone_ins


The name of the entity will stay the same, because we want to enable both spawn points at the start of the round. Next we open the properties of the ins_spawnpoints and set team number (int) to “Insurgents” and we also change the World Model to “models/characters/insurgent_light.mdl”. Now we have correctly setup the spawns on both sides. However the spawn zones itself will be disabled, which means the player won’t be able to re-supply and they don’t move in Push. For that we have to create the script, which will be explained later in this tutorial.
Objectives: Firefight

We start by creating a new brush at the location where we want our first objective and tie to entity: trigger_capture_zone. We also create a point entity called point_controlpoint in the center of the brush and set the following properties:

Capture zone A:

Point_controlpoint
Name: Firefight_cap_a

Trigger_capture_zone
Name: firefight_cap_a_t
associated control point: firefight_cap_a

Now we have a single objective for Firefight but we need at least three: A, B and C. So next we duplicate our first capture zone and associated control point and place them in the correct locations. B is located in the center of our map and C at the opposite side of A.


Now we set the following properties:

Capture zone B:

Point_controlpoint
Name: occupy_cap

Trigger_capture_zone
Name: occupy_cap_t
associated control point: occupy_cap

As you can see we named this entity as “occupy_cap" because we will also use this capture zone for the Occupy game mode, it’s perfectly fine to share objectives with different game modes, because only one mode will be active at a time.

Now for our final objective we set the following properties:

Capture zone C:

Point_controlpoint
Name: firefight_cap_c

Trigger_capture_zone
Name: firefight_cap_c_t
Associated control point: firefight_cap_c

At this point we got all the entities we need for the Firefight game mode, so our next step is to create the following script:
"cpsetup.txt" { // Supported modes: // - Firefight // - Skirmish // - Occupy // - Push "firefight" { "controlpoint" "firefight_cap_a" "controlpoint" "occupy_cap" "controlpoint" "firefight_cap_c" "spawnzones" { "disablespawns" "1" "0" "spawnzone_neutral" } }
Objectives: Skirmish

Adding the skirmish objectives isn’t much different from Firefight, because the weapon caches will be generated by the script, which means we don’t have to worry about adding any extra entities for those. So let’s start by adding the entities in Hammer for the capture zones and this time we only need two sets of them, because the middle objective (B) will stay in the same location. So we will have the following setup:


Next we set the properties of the following entities:

Capture zone A:

Point_controlpoint
Name: skirmish_cap_a

Trigger_capture_zone
Name: skirmish_cap_a_t
associated control point: skirmish_cap_a


Capture zone B:

Point_controlpoint
Name: occupy_cap

Trigger_capture_zone
Name: occupy_cap_t
associated control point: occupy_cap


Capture zone C:

Point_controlpoint
Name: skirmish_cap_c

Trigger_capture_zone
Name: skirmish_cap_c_t
Associated control point: skirmish_cap_c

Now with these entities in place we can extend our script with the following entries::

"skirmish" { "controlpoint" "cachepoint_a" "controlpoint" "skirmish_cap_b" "controlpoint" "occupy_cap" "controlpoint" "skirmish_cap_d" "controlpoint" "cachepoint_e" "spawnzones" { "disablespawns" "1" "0" "spawnzone_neutral" } "entities" { // Cache A "obj_weapon_cache" { "origin" "1602 -1358 16" "angles" "0.000000 90 0.000000" "targetname" "cache_a" "teamnumber" "2" // Security "ControlPoint" "cachepoint_a" "TakeDamageBullets" "0" } "point_controlpoint" { "origin" "1602 -1358 70" "angles" "0.000000 90 0.000000" "targetname" "cachepoint_a" } // Cache E "obj_weapon_cache" { "origin" "-1498 1466 -32" "angles" "0.000000 90 0.000000" "targetname" "cache_e" "teamnumber" "3" // Insurgents "ControlPoint" "cachepoint_e" "TakeDamageBullets" "0" } "point_controlpoint" { "origin" "-1498 1466 50" "angles" "0.000000 90 0.000000" "targetname" "cachepoint_e" } } }

There are a few things important here when adding the caches in the script. First you need to set the origin (spawn location) of the weapon caches. These coordinates can be acquired through hammer by creating a point entity called, obj_weapon_cache. Now we select this entity and at the bottom of our screen we see the following coordinates


And as you can see we use these coordinates for the origin of our first weapons cache. However we set the Z value to 16, because the origin of the cache itself is located at the bottom of the model.

Second, the point_controlpoint associated with the weapons cache is also generated through the script. So make sure you set the same origin as the obj_weapon_cache with one minor difference the Z should be a bit higher, so that the icon is floating above the weapons cache. The last thing we notice is the targetname of our weapons_cache. We make sure it’s targeting the point_controlpoint and same counts for the point_controlpoint which is targeting the weapon_cache.
Objectives: Occupy
We already added an Occupy objective in the centre of our map, which means we only need to add the following entries in the script:

"occupy" { “controlpoint” “occupy_cap” “spawnzones” ( “disabledspawns” “1” “0” “spawnzone_neutral” } }
Objectives: Push

The first important thing to know is that Push requires a lot more entities. Each objective has its own set of spawns which are controlled by the script. So for three objectives we need at least six spawn zones including spawn points and block zones . You can create a five objective push map, but the entity count will be fairly high and can cause issues when reaching the engine limit. So let’s move on with three objectives for now. We start by adding the entities for the objectives we need. Which are A and C. Bravo will be exactly in the middle of the map, so we will re-use our the occupy capture for that. Next is the spawn zones, these need a bit of planning to make sure we won’t restrict the player to much from moving through map, due the required block zones.

The first thing we notice about the layout is the static spawn points for A and B for Sec and B and C for INS, which means these spawns won’t move when the objective is captured. It’s important though when you create something similar to this setup to make sure that the attacking team is progressing through the map. So once a spawn starts moving forward, it shouldn’t move back for the next captured point. Same counts for the defending team, but in the opposite direction.
Now let’s look at our script:

"push" { "AttackingTeam" "security" "controlpoint" "push_cap_a" "controlpoint" "occupy_cap" "controlpoint" "push_cap_c" "spawnzones" { "disablespawns" "1" "0" "spawnzone_1" "1" "spawnzone_2" "2" "spawnzone_3" } } }

As you can see, we define an attacking team. Which is in our case Security.. Once again we connect our control points with the entities in hammer and instead of a single spawn zone we added now three of them. Which means when push_cap_a is captured the next ins_spawnzone, occupy_cap will be activated, including the associated block zone.

At this point we have added four game modes in our script. The only thing left is to save the file in the insurgency/maps folder with the same name as our map and we’re good to go.
Objectives: Infiltrate
The majority of this game mode is controlled by the script, so let’s look at that first:
"cpsetup.txt" { "infiltrate" { "controlpoint" "terminalpoint_a" "controlpoint" "terminalpoint_b" "spawnzones" { "disablespawns" "1" "0" "spawnzone_neutral" } "entities" { // Terminal A "obj_terminal" { "origin" "-1658.036743 1587.327881 39.574684" "angles" "0.000000 -41.945896 0.000000" "targetname" "terminal_a" "teamnumber" "2" "ControlPoint" "terminalpoint_a" "TakeDamageBullets" "0" } "point_controlpoint" { "origin" "-1658.036743 1587.327881 111.574684" "angles" "0.000000 -41.945896 0.000000" "targetname" "terminalpoint_a" } // Terminal B "obj_terminal" { "origin" "2193.197998 -1142.672729 103.533928" "angles" "0.000000 -3.005545 0.000000" "targetname" "terminal_b" "teamnumber" "3" "ControlPoint" "terminalpoint_b" "TakeDamageBullets" "0" } "point_controlpoint" { "origin" "2193.197998 -1142.672729 175.533928" "angles" "0.000000 -3.005545 0.000000" "targetname" "terminalpoint_b" } } } }

As you can see the terminals are defined in the script and can be added in the same way as the weapon caches in Skirmish. So the only entities we have to create in Hammer are the spawn points, but that’s only necessary if they don’t exist yet or if you want them in a different spot.
Objectives: Flashpoint
Consists of only a single capture point and the rest are weapons caches. Which means we only have to create one capture zone with an associated control point in Hammer. As soon that’s done we can create the following script:
"cpsetup.txt" { "flashpoint" { "controlpoint" "cachepoint_a" "controlpoint" "cachepoint_b" "controlpoint" "occupy_cap" "controlpoint" "cachepoint_d" "controlpoint" "cachepoint_e" "entities" { // Cache A "obj_weapon_cache" { "origin" "3380.867920 2920.383789 775.941895" "angles" "0.000000 -48.812649 0.000000" "targetname" "cache_a" "teamnumber" "2" "ControlPoint" "cachepoint_a" "TakeDamageBullets" "0" } "point_controlpoint" { "origin" "3380.867920 2920.383789 847.941895" "angles" "0.000000 -48.812649 0.000000" "targetname" "cachepoint_a" } // Cache B "obj_weapon_cache" { "origin" "1279.500854 -3180.787354 832.315491" "angles" "0.000000 -71.893448 0.000000" "targetname" "cache_b" "teamnumber" "2" "ControlPoint" "cachepoint_b" "TakeDamageBullets" "0" } "point_controlpoint" { "origin" "1279.500854 -3180.787354 904.315491" "angles" "0.000000 -71.893448 0.000000" "targetname" "cachepoint_b" } // Cache D "obj_weapon_cache" { "origin" "-345.325104 2906.037842 863.624390" "angles" "0.000000 87.444565 0.000000" "targetname" "cache_d" "teamnumber" "3" "ControlPoint" "cachepoint_d" "TakeDamageBullets" "0" } "point_controlpoint" { "origin" "-345.325104 2906.037842 935.624390" "angles" "0.000000 87.444565 0.000000" "targetname" "cachepoint_d" } // Cache E "obj_weapon_cache" { "origin" "-3076.870605 -2611.940918 453.414154" "angles" "0.000000 119.169243 0.000000" "targetname" "cache_e" "teamnumber" "3" "ControlPoint" "cachepoint_e" "TakeDamageBullets" "0" } "point_controlpoint" { "origin" "-3076.870605 -2611.940918 525.414154" "angles" "0.000000 119.169243 0.000000" "targetname" "cachepoint_e" } } "spawnzones" { "disablespawns" "1" "0" "spawnzone_neutral" } } }
Compiling

The most easy way to compile a map is through hammer. We press F9 and the compile window will pop-up. In there we can change several settings before starting the compile. So for example if we want to do a quick compile to test our entities, we use the following settings:

When our map is completely finished, we can start a final compile, which can be done through the expert mode of Hammer’s compile tool. So we press again F9 and click on the Expert.. button. Now we select from Configurations dropdown menu: Full compile - HDR ONLY. Next we select in Compile/run commands: $light_exe and in there we add -final in the Parameters box and we hit Go!

There are a dozen more parameters that can be used to compile a map, those can be found on Valve’s WIKI page: https://developer.valvesoftware.com/wiki/Vrad
4 Comments
MAKE IT FROM 廣西 28 Jul, 2017 @ 2:34am 
6
Max Gunther 18 Sep, 2016 @ 3:33am 
I can create map, objects., spawn points and points to captur/defend, but in game i cant spawn on my map (i can if i load another map before). What is the point of script txt? Do i need to put it in some game folder?
..oxy.. 21 Jan, 2015 @ 1:21pm 
I'm having trouble building cubemaps, the game keeps crashing. Suggestions?
Aurora73 1 Aug, 2014 @ 5:46pm 
This map is beautiful, Doesnt look like your forced down hallways like other maps. Is this afghanistan?
This will go perfect with the Marine skins.