If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Creating a Sven Co-op map

Creating a Sven Co-op map
This guide will prepare you for making custom maps for Sven Co-op. It has been written for the current version, 5.0, which is available from Steam.

Configuring HammerNote: The hammer configuration described in this subsection has not yet been tested by me. It should work, but the game will likely not start automatically when using the 'Run Map!' button. Just load the game normally and start the map from there.

To map for Sven Co-op it is recommended that you use the SDK included with the game, but it is not a requirement. You can use whatever mapping editor and compile tools you prefer. However, if you want to make use of the increased engine limits, you will likely need to use our compile tools.

First step is to install the Sven Co-op SDK. In your Steam Library, you can switch from 'Games' to 'Tools'. There you will find it.

Inside Valve Hammer Editor, you will have to enter Options and configure some things.

- In the Textures tab, add whichever .wads you wish to use.

- In Game Configurations:
1. Click the Edit button next to the configuration field and add a configuration called whatever you like.
2. Add the SC .fgd. A common path name looks like this: C:\Steam\steamapps\common\Sven Co-op\svencoop\sven-coop.fgd
2b. You'll probably want to add zhlt.fgd (C:\Steam\steamapps\common\Sven Co-op SDK\mapping\compilers)
3. Select default point entities and solid entities. info_player_deathmatch and func_wall are good recommendations.
4. Set up Game Executable Directory. Should look like C:\Steam\steamapps\common\Sven Co-op
5. Set up Mod Directory. Should look like C:\Steam\steamapps\common\Sven Co-op\svencoop
6. Set up Game Directory. Should look like C:\Steam\steamapps\common\Sven Co-op\svencoop
7. Set up RMF directory. Should look like C:\Steam\steamapps\common\Sven Co-op SDK\mapping\hammer\maps

- In Build Programs:
1. Set game executable: C:\Steam\steamapps\common\Sven Co-op\svencoop.exe
2. Set up CSG, BSP, VIS and RAD executables. The 64bit versions have names like "SC-RAD_x64.exe", the 32bit versions "SC-RAD.exe". They can be found in Sven Co-op SDK\mapping\compilers
3. Choose a directory to place compiled maps in. The directory should look like C:\Steam\steamapps\common\Sven Co-op\svencoop_addon\maps

Introduction to the basics of mapping
If you have never created a map for a game based on the HL1 engine, such as Sven Co-op, it is recommended that you read some tutorials that introduce you to the basics. The website The Whole Half-Life has one such tutorial available: http://twhl.info/tutorial.php?id=23

Keep in mind that the TWHL tutorial above is an introduction to Half-Life 1 mapping and is not Sven Co-op specific. However, the lessons learned in the tutorial and its 6 parts are also useable for Sven Co-op mapping. There are also many other tutorials on TWHL that are useful, since Sven Co-op is in essence just an expansion of Half-Life 1.

Sven Co-op mapping
Let’s assume that you are now somewhat familiar with the process of creating a map for a HL1 engine game. Let us then focus on the things that are important to know when creating a map for Sven Co-op.

Creating a Sven Co-op map is very similar to creating a map for Half-Life 1 Singleplayer. As a Sven Co-op player you will know that Sven Co-op maps can be very different and sometimes have very unusual premises, but in general most maps follow a structure that is commonly called “Walkthrough”. In a walkthrough map, players start at one end of the map, proceed through a variety of environments while killing enemies and completing puzzles, until they reach their final objective and the map ends. It is easy to see the similarity between this kind of map and a Half-life singleplayer map. One major difference is that in the typical walkthrough map, players can respawn whenever they die. The Sven Co-op team is aiming to move the mod in a direction with more “losable” maps, for example by use of the Survival mode, but creating a walkthrough map is generally a good way for a new mapper to begin practicing.

Sven Co-op requirements
First off, you should know that SC uses info_player_deathmatch entities as spawn points instead of Half-Life singleplayer’s info_player_start. You should always have a decent amount of spawn points in your map to ensure players don’t spawn inside each other. On a 16 player server, it is not impossible that all players will spawn at the same time on map start. For this reason, consider having about 8-16 spawn points at least.

Second, ensure that your map ends at some point. The common way of doing this is to trigger a game_end when players reach or complete an objective. For example, the game_end can be triggered when a player enters an area with a trigger_once. An alternative to game_end is used in map series: If you want players to progress to the next map in a series, use the trigger_changelevel brush entity to change to the map you specify. Keep in mind that backtracking to a previous map does not work like it does in Half-Life singleplayer - The map players backtrack to will simply be reset, unless some extra entity trickery is used.

Sven Co-op entities
Sven Co-op includes all the standard Half-Life 1 entities (with a few exceptions) but also includes a large number of new entities that allow mappers to create more varied and customized maps.

CFG files
You can set up various options in map CFG files, such as changing the player starting weapons/ammo/items, turning realistic falling damage on/off, forcing a certain map to be run after the current map ends, etc. This is a powerful system and allows the mappers to set the rules of the game without a lot of entity usage.

When a map is loaded in Sven Co-op, the game automatically tries to execute a CFG file with the same filename as the map (but ending in .cfg instead of .bsp). For example, if you ran a map called svencoop1.bsp, the game would try to execute a file called svencoop1.cfg. If no file of that name exists, default settings will be used (Players start with a crowbar, a pistol and other default settings). All CFG files must be in the same directory as the .bsp for them to be recognized.

The Manual provides an overview of the settings that can be put in the .cfg, as well as a few other map-specific files. You can also look at the .cfg files of other maps to compare.

In almost all maps you will want to make use of a map CFG. It is much better to give players their weapons and ammo via a CFG than by placing the equipment as entities in the map, because an excess amount of ammo_ and weapon_ entities can reduce the framerate in a room and players will be fighting over who gets to pick up the items.

.Res Files
When distributing a map with custom content such as models or wads, you will need a .res file if you want players to be able to download the content from game servers. A .res file lists all the files associated with your map that are required to play it.

Angelscript
Sven Co-op 5.0 includes a scripting language to allow for advanced map scripting. As a beginning mapper you are recommended to simply rely on the available entities, but at some point in your mapping career you will want to look into Angelscript, either to discover new ways of manipulating the game or to simplify the creation of advanced map scripts. Some programming experience is recommended before trying to use Angelscript. An introduction to Angelscript can be found here: http://forums.svencoop.com/showthrea...t-Introduction

Mapping tips
- Even though computers of today are quite powerful, be careful not to push the limits of the game too hard. Areas with high polycounts can cause slowdowns on modern computers if their graphics card is not optimized for use in OpenGL games, and an excess amount of active NPCs can easily cause network lag. A w_poly max of 1200 is recommended and you can look at other maps to see how many active monsters the game can handle.

- As mentioned earlier, the Sven Co-op team is highly interested in maps with losable gameplay, so you should seriously consider making maps of that type. By losable, we mean a map where every action of a player either contributes to or reduces the players’ chance of success, because the map can potentially end with a ‘negative’ ending if the players do not perform well enough. An example is a survival-type map, where players who die become spectators, and the players will lose once everyone is dead. Another kind of losable map is Fortified, where players are threatened with failure if they run out of resources or time. A losable map often requires more forethought and testing, but the end result is seriously worth it, as players will feel a stronger sensation that their actions matter.

- A good map is always tested with a group of people before being released. Consider asking on the Sven Co-op forums if you need testers.

- Try to include cooperative puzzles or gameplay mechanisms in your map, where players must work together to proceed. A classic example is the two player button sequence, but this can often be seen as a filler sequence or a cliché. However, there are plenty of opportunities for coming up with new and original cooperative gameplay sequences.

- You can find useful utilities for map creation here. Other useful tools include Wally for .wad creation and Sprite Explorer for sprite creation.

- Mapping can sometimes be a challenge without assistance from others. The people in the Sven Co-op Mapping Forum are always ready to lend a helping hand, and you can also find plenty of mapping resources and tutorials there. If you need immediate mapping help, you can also visit the Sven Co-op IRC channel (just be aware that you cannot expect an instant answer on the IRC channel either.)

Re: Creating a Sven Co-op map

When I switched to the Hammer version included in the SDK and its compilers, absolutely every entity appears to be a leak on an old map of mine. It compiles and runs perfectly fine on a modded 3.5.3 version without any leaks and with working lights.

I removed all the entities and tried to insert one using the Hammer provided in the SDK thinking that it may have something to do with changes in the fgd but I'm still getting compile errors.

Warning: === LEAK in hull 0 ===
Entity info_player_deathmatch @ ( 191,-3809,-126)
Error:
A LEAK is a hole in the map, where the inside of it is exposed to the
(unwanted) outside region. The entity listed in the error is just a helpful
indication of where the beginning of the leak pointfile starts, so the
beginning of the line can be quickly found and traced to until reaching the
outside. Unless this entity is accidentally on the outside of the map, it
probably should not be deleted. Some complex rotating objects entities need
their origins outside the map. To deal with these, just enclose the origin
brush with a solid world brush

Re: Creating a Sven Co-op map

My guess: Our compiler calculates geometry using floating point coordinates (i.e. with decimals). When you clip or vertex manipulate a brush, you sometimes end up with coordinates that do not fit on the grid perfectly. Hammer will save the coordinates in floating point, but most compile tools will convert the coordinates to the closest integer. In your situation, this meant your map was leak-free, but in other situations it might have caused leaks. Because our compile tools do not convert coordinates to integers, a certain brush may be less than a unit apart from another brush, causing a leak. What you should do is to load the pointfile .lin, and follow the line until you find the leak. The entities are not leaks by the way, they are just listed to give you a place to start your search. I don't know if hammer 3.4 (which our hammer is based on) shows the line in the 3D view, so you may have to use hammer 3.5 for that. You can also consider in which places you have done unusual clipping and check those areas first.

Re: Creating a Sven Co-op map

Thanks for putting this together Nih, I'm sure a lot of folks are interested now with 5.0 out. I suggest you put this as a guide for the steam hub for the game as well to get some more exposure for it.

Re: Creating a Sven Co-op map

Originally Posted by Nih

My guess: Our compiler calculates geometry using floating point coordinates (i.e. with decimals). When you clip or vertex manipulate a brush, you sometimes end up with coordinates that do not fit on the grid perfectly. Hammer will save the coordinates in floating point, but most compile tools will convert the coordinates to the closest integer. In your situation, this meant your map was leak-free, but in other situations it might have caused leaks. Because our compile tools do not convert coordinates to integers, a certain brush may be less than a unit apart from another brush, causing a leak. What you should do is to load the pointfile .lin, and follow the line until you find the leak. The entities are not leaks by the way, they are just listed to give you a place to start your search. I don't know if hammer 3.4 (which our hammer is based on) shows the line in the 3D view, so you may have to use hammer 3.5 for that. You can also consider in which places you have done unusual clipping and check those areas first.

Thanks for the reply. The line appears to end at an area where everything appears to be in its spot. Bottom, top, left and right brushes are all connected just fine which results in a perfectly closed box. This is confusing...

Would you mind if I sent you the rmf so that you could take a quick peak/test compile and give me some hints if I've done anything wrong?

Re: Creating a Sven Co-op map

Nice idea.. But *.as is Actionscript and it was owned by Adobe System. Please change other extension for Sven Coop. I suggest *.agls for Angelscript.

Because i am using Flash Develop. Please change to *.agls for Angelscript. Thanks! If you don't know than you can download Adobe Creative Clounds and "Install" Flash CC 2015 or newer version than you can open *.as it is "Actionscript"

Re: Creating a Sven Co-op map

So, i was making a map. Im doing (as test) only:
A skybox,
a flat plate,
info_player_deathmatch entities.
Compile error, (Note, on my screen its in German, im trying to translate as best as i can.)
The Command failed. Windows reported the error:
The Syntax of the Filename, Directoryname, Volume label is wrong. (Volume label is very probably wrong, but i don't know better)
Continue?

Re: Creating a Sven Co-op map

@1lucia, The error -> The Syntax of the Filename, Directoryname, Volume label is wrong,
can be caused due to having "spaces" in your path name. e.g. C:\Program Files\Steam\SteamApps\common\Sven Co-op SDK\mapping\compilers,
if this is the case, you need to enclose it in double quotes:
"C:\Program Files\Steam\SteamApps\common\Sven Co-op SDK\mapping\compilers"

Also are you compiling via Hammer or some sort of batch process?

PS: If "spaces" in your path, is not the problem or is already in double quotes can you post your compile log ?

Re: Creating a Sven Co-op map

Originally Posted by SourceSkyBoxer

Please make sure and change path to "path"

Please change "Sven Coop" to "SvenCoop" if you update next version! Please don't use space! Thanks!

So, my path should be changed from
D:\Programme x86\Steam\steamapps\common\Sven Co-op\svencoop.exe
to
"D:\Programme x86\Steam\steamapps\common\Sven Co-op\svencoop.exe"
And, what do you mean by "Please change "Sven coop" to SvenCoop" if you update next version!
When i update the game, do you get the choice do rename it? Or how exactly do you mean it.
Thanks.

(This looks okay to me the path is enclosed in double quotes as it should be, the only possible problem I can see is "D:\Programme x86" (on D: drive). Also do you have a folder "C:\Programme x86" ? because it then says:

These are both Errors. Note the extra ':' after x86 in "D:\Programme x86:"
and that hammer then tries to fix this by swapping it to "C:\" (Which is also wrong.)

Suggest: Go into Hammer, Menu->Tools, Menu->Options, Pop-up Window -> "Configure Value Hammer" Check Both "Game Configurations" Tab and "Build Programs" Tabs. Look for any path beginning with "C:\" (They should all be on the same drive location which is D: in your setup)

If they are all on D: drive and you do not have "C:\Programme x86" on your C: drive, then I guess an old problem has re-occured (which I thought was fixed) and you may have to re-install Sven Coop and SC SDK to your C: Drive and then reconfigure the paths all to C: in "Game Configurations" Tab and "Build Programs" Tabs.

Re: Creating a Sven Co-op map

My C: is sadly full, any way around?
And, there was a ':' in "Place compiled maps in this directory before running the game."
and the "D:\Programme x86:\Steam\SteamApps\common\Sven Co-op\svencoop_addon\maps instead of C:\Steam\SteamApps\common\Sven Co-op\svencoo\SectoreZ.map"
i really can't explain, there is no C:\Programme x86 at all.