Mapping for Synergy

From SynMod

Jump to: navigation, search

Mapping for Synergy is like mapping for Half Life 2, or any other Source based games or mods. However, there are a few steps to setup Source SDK (the program that allows you to build maps for Synergy) for use with Synergy. In addition, Synergy introduces some new entities, useful for those who are planning on making maps.

Contents

Setup

This is a one time only operation, once it is complete, Source SDK will be set up for your steam user on your computer (but you may set Synergy up for Source SDK on multiple computers and steam users!). First of all find the GameConfig.txt file. You will find it in \Steam\Steamapps\<your steam username>\sourcesdk\bin\ep1\bin folder. If there is no SourceSDK folder, you will need to run Source SDK first, from the Tools section of Steam.

In GameConfig.txt, before add

	}
	"SDKVersion"		"2"
}

(hint: it's near the bottom!) add

	"Synergy"
		{
			"GameDir"				"<STEAM_DIRECTORY>\SteamApps\SourceMods\synergy"
			"hammer"
			{
				"MaterialExcludeCount"	"0"
				"TextureFormat"		"5"
				"MapFormat"		"4"
				"CordonTexture"		"tools\toolsskybox"
				"DefaultTextureScale"	"0.25"
				"DefaultLightmapScale"	"16"
				"DefaultSolidEntity"	"func_detail"
				"DefaultPointEntity"	"info_player_deathmatch"
				"GameExeDir"		"<STEAM_DIRECTORY>\steamapps\<ACCOUNT_NAME>\source sdk base"
				"GameExe"			"<STEAM_DIRECTORY>\steamapps\<ACCOUNT_NAME>\source sdk base\hl2.exe"
				"MapDir"			"<STEAM_DIRECTORY>\steamapps\<ACCOUNT_NAME>\sourcesdk_content\synergy\mapsrc"
				"BSPDir"			"<STEAM_DIRECTORY>\steamapps\SourceMods\synergy\maps"
				"BSP"			"<STEAM_DIRECTORY>\steamapps\<ACCOUNT_NAME>\sourcesdk\bin\ep1\bin\vbsp.exe"
				"Vis"			"<STEAM_DIRECTORY>\steamapps\<ACCOUNT_NAME>\sourcesdk\bin\ep1\bin\vvis.exe"
				"Light"			"<STEAM_DIRECTORY>\steamapps\<ACCOUNT_NAME>\sourcesdk\bin\ep1\bin\vrad.exe"
				"GameData0"		"<STEAM_DIRECTORY>\steamapps\<ACCOUNT_NAME>\sourcesdk\bin\synergy.fgd"
			}
		}

If you are using notepad or wordpad to edit this, press Control + H to bring up the replace dialog. In "Find What" put <STEAM_DIRECTORY>, and in "Replace With" put the location of your Steam directory (e.g. C:\Program Files\Steam). The trailing slash is not required. Find and replace again, but this time in "Find What" put <ACCOUNT_NAME> and in "Replace With" put your Steam Username (e.g. JoeBloggs56). Save and close the file. If you are still confused and need to see an example, have a look at this sample GameConfig.txt file. If the GameConfig.txt files does not exist, ensure you have run Source SDK at least once and with the -engine ep1 switch (see below).

Finally, in Synergy's install directory (Defaults to \sourcemods\Synergy\) copy the Synergy.fgd file into \SourceSDK\bin\ folder.

Synergy should now appear in Source SDK's list of mods. If you only have "Half Life 2: Episode 2", "Portal" and "Team Fortress 2" in your list, you need to force Source SDK to use the ep1 (Episode 1) engine, as opposed to the orangebox engine. To do this, right click on Source SDK in steam, select properties and in "Select Launch Options" add -engine ep1. Click ok, close the properties and relaunch Source SDK. Synergy should now appear in the list. Select it, and double click on "Hammer". Hammer is the program that is used to create maps for the Source Engine.

Introduction to Hammer

Hammer's starting window
Hammer with a new map

Now that you've setup Source SDK and launched Hammer, you should be presented with a screen similar to that seen on the right. All of the options are disabled as no map has been loaded. To start a new map, go to File > New. After doing this, you should be presented with four screens and a toolbar, also seen on the right again. Notice that the screen has been divided up into 4 quadrants, these can be adjusted for size as needed by dragging them at the edges. Going from left to right, top to bottom, these 4 quadrants default to these views.

  • 3D View - This shows the 3D view similar to how it will look in game. It is not as detailed as actual in game view to help preserve system resources
  • Top View - This shows how your map looks as if you are above it and looking down in 2D wireframe view, basically showing you the X and Y axes.
  • Front View - This shows how your map looks from what Hammer calls the front (A 2D wireframe view of the Y and Z axes)
  • Side View - This shows how your map looks form what Hammer calls the size (A 2D wireframe view of the X and Z axes).

In Hammer, the Top, Front and Size views are all similar, except they are views of various parts of the map with a certain part of rotation. Hammer's default view setup is perfect, but the views can be changed by right clicking in the top left of the view windows.

Essential to Hammer, is it's toolbar on the left. This is where you can select Hammer tools such as Geometry Creation, Selection and Entity Creation among others. An explanation of the items on the toolbar is best explained here. Note that in the example, the toolbar has been pulled from the left and is floating. All of Hammer's toolbars and status boxes may be freely docked or moved around the interface to suit you best.

Basic Map Creation

Now that you know your way around Hammer, its time to start making your map. Before starting your map, its highly recommended you have a drawn out plan of what the map is going to be about, how many players it is intended for, the setting, theme and some basic geometry of at least some of the areas - a pencil and paper is sufficient for this purpose. Having a plan is a great help when mapping - otherwise your map will more than likely turn into a mess of different rooms with huge variations between them with little continuity (Similar to some of Synergy's first maps - lvl1 and lvl3).

Geometry

Before you can start placing anything into your map you need Geometry. Think of it as the earth you are going to put your buildings, people and objects on. Geometry is simple to create and the crucial first part of a map. While creating Geometry, it is best to use the 'Orange Map' textures (also known as Dev textures). You should use these because it helps to get the dimensions of the geometry correct in an easy to see way. There are all sorts of dev textures, however the one I recommend you use is dev/dev_measurewall01a. To select this texture, click Browse on the texture box on the right of Hammer and type dev/dev_measurewall01a into the filter and double click on the texture. dev/dev_measurewall01a is particually suitable as it is 128 by 128 hammer units wide and tall - just slightly higher than the player and hence suitable for creating walls or rooms that players will fit into without feeling that the room is disproportionally huge or cramped. You should always use dev textures when first developing the map geometry in order to help get the dimensions correct and allow you to quickly build the map. There are quite a few dev textures, including ones for door dimensions, railings and ladders.

A basic floor with a dev texture on it

After selecting the dev texture, you can start creating your Geometry. To create geometry, click the box icon on the Hammer toolbar and then click and drag in one of Hammer's 2D views. You will see your box created. Use the handles on the box in the 2D views to create the box as needed then press the Enter key to put it in the world. If you move the 3D view around, you should now see your box, complete with the Orange Map texture, as seen on the right. Geometry created with the box tool is automatically solid (unless you selected a water texture, but don't do that yet!) and fixed in space - physics won't alter it (you can't gravity gun it or pick it up) and it is solid to other objects. The texture used will automatically determine the sounds and gibs that the geometry makes when a player walks on it, shoots it or an object has a collision with it - resist the temptation to go and texture everything at this minute - continue using the dev textures, full texturing comes later. An example of a basic floor 1024 x 1024 x 64 Hammer units can be seen on the right. After creating Geometry you can use the Selection Tool to adjust it or delete it. After you have finished building the Geometry of the map, move on to the next section.

Spawn Point

A basic spawn point in Hammer

After Geometry has been created for the entire map, you can start gradually adding Entities in. The most important of these is the info_player_deathmatch, this entity is a spawn point for players, without it they can't join the game. Before you place them, make sure that you have a spawn room that meets these criteria:

  • Is big enough for the number of max players for your map to move around comfortably
  • Is protected from hostile forces, so players don't get spawn killed. The eaisiest way to do this is through a portal (don't have to construct this now, just have the concept of it there) or a ramp that players run up and drop down into the main part of your map
  • Has places for charging the HEV suit, weapon pickups and ammo (These don't have to be there now, just a place for them to be)

Once your map meets these criteria, click on the Entity Tool on the Hammer toolbar. On the Entities box on the right of Hammer, make sure the object is set it info_player_deathmatch. Then simply click in the 3d view or in the 2D views to position the entity. Like Geometry, press Enter to put the entity into the world (Clicking in the 3D view creates the Entity immediately). Here is where the dev textures you've been using in the Geometry section come in useful, if you click where the two white lines intersect, you can position the entities exactly how you want them, the grid snap feature of Hammer will automatically position them exactly where they meet, so don't worry about clicking on the exact place, just close to it. Ensure there are enough spawn point available for the maximum number of players (plus a few extra, server operators may want to overload the map) so that upon spawning players do not get Telefraged.

Now that players have a place to spawn, you need to give them weapons, ammo and amour. There are two ways to do this, either create a new entity, game_player_equip or place weapons, ammo and amour in the spawn point. The second way is the easiest way to do it, but the least elegant and means players have to spend extra time getting their items before they can have fun. If you wish to do it this way, add the relavant weapons, ammo and armor in the spawn point, ensuring there are enough for everyone. To place, for example, a combine assault rifle, click the entity tool and select the entity as the weapon_ar2, then place it in your map the same way you placed the info player deathmathch.

The items that the player will spawn with
Adding a new Key Value

If you choose to use the game_player_equip entity, you've made a good choice! Place it anywhere in your map and then go into it's properties. Click the button that says 'Smart Edit' in order to turn it off, we need to add our own values to the entity. To make the player spawn with an item, click the Add button and in key type the name of the item and in value type the number of that item you want a player to spawn with. For weapons, enter the weapon name and set the value to 1 (only need one weapon - two combine pulse rifles won't do your much good!. For ammo, enter the ammo name and the number of boxes of ammo you want the player to spawn with. For armor, enter item_battery and the number of HEV suit batteries you want the player to spawn with (they will automatically be used). Each battery adds 15 armor, and be default you cannot go over 100 armor. Examples of a filled out game_player_equip can be seen on the right. In the example, our lucky player will spawn with a combine pulse rifle (AR2), 2 lots of 30 extra ammo (60 extra ammo in total!) and 60 Armor. It's a much better choice to use this as players will start and be able to begin the fight straight away, no looking around for weapons or waiting for HEV suits to charge - spawn and go!


MCFs

Taken from the Synergy Docs

Map Config Files have many different uses now: console settings, entity modification and defining the class data (overriding default behavior).

These Map Config Files (MCFs) can be found within the "maps/mcf/" directory. These files must be named the same as your level; that is, if your map is named "myTestMap" you will need to name your MCF "myTestMap.mcf".

Here is a sample MCF file:

"myTestMap"
{
    "classdata"    "myClassDataFileName"

    "console"
    {
        // sample:
        // "variableName"    "variableValue"
    }

    "entities"
    {
        // sample:
        // "create"
        //{
        //    "classname" "entityClassname"
        //    "origin" "0.0 0.0 0.0"
        //} */
    }
} 

Typically, you can simply name your class data file the same as your level (for example, naming your class data file as "myTestMap.mcd"). Otherwise if you wish to use a shared class data file, use the "classdata" key, which will be used to reference the name of a class data file (without file extension).

The "console" key group can contain any specific variable settings your level may require, like maximum lives or timelimit, etc.

With the "entities" key group, you can create and delete entities:

    "entities"
    {
        "create"
        {
            "targetname" "entityTargetname"
            "classname" "entityClassname"
            "origin" "0 0 0"

            "values"
            {
                // any keys needed here (max of 32), example:
                // "angles" "0 0 0"
            }
        }

        "edit"
        {
            "targetname" "entityTargetname"
            "classname" "entityClassname"
            "origin" "0 0 0"

            "values"
            {
                // any keys needed here (max of 32), example:
                // "angles" "0 0 0"
            }
        }

        "delete"
        {
            "targetname" "entityTargetname"
            "classname" "entityClassname"
            "origin" "0 0 0"
        }
    }

You may select an entity by either using it's classname or targetname, with or without specifying an origin key. It would be wise to only use just the classname or just the targetname to select an entity. Use the origin key to select a specific entity; without the origin key, all entities with the specified classname or targetname will be used the modification.

It is possible to duplicate and remove brush model entities, such as trigger_multiple, trigger_push, trigger_once and so on. To duplicate a brush model, you simply need to give an entity the "model" key with a value that of an existing brush model index (like this: "*1"). Removing a brush model works the same way as removing a standard point entity, however there is an issue with the origin key and brush models (read on for more information).

Brush model entities have an origin of "0 0 0" because they are part of the world. Therefore the origin key acts as an offset from it's initial position in space. Example: Giving a brush model entity an origin of "0 128 0" will offset the brush model entity in question 128 units on the Y-axis.

Below is a list of console commands and variables that can help you determine entity properties, origins and other useful information for manipulating entity data:


Variable Name           Default Value           Description

sv_cheats               0                       This variable enables cheats so some of the developer commands can work properly
developer               0                       Set this to 1 for viewing some important information, set to 2 to include AI and entity IO messages
picker                                          This command helps you pick entities in the game while looking directly at them
find_ent                                        Find an entity by finding a matching string in an entity
getpos                                          Outputs current player origin (and adds 64 units to the Z-axis) and player angles to console
setpos                                          Set player origin to origin specified (setpos X Y Z)
mcf_dumpentinfo         0                       Dump entity data for the loading levels (creates text files in 'maps/mcf/') 
mcf_entinfo                                     Display important information about the current entity we face 
mcf_crosshairtarget                             Show information about the current space we are looking at 
mcf_debug               0                       More of a developer debugging command that will output MCF debug messages to console

See Also