The player spawning system in Enemy Territory has one spawn entity per team with 2 spawnflag values as follows:
Generally an Enemy Territory map will have an initial spawn area for both teams and possibly one or more capture/autospawn areas.
The initial spawn areas are made up of team-specific spawn entities with the spawnflag values both set so that players can start the map without being killed immediately.
The capture / autospawn areas will have Axis / Allied player spawn entities and both sets should be given a targetname key. The targetname key is used so that the game can switch the spawn entities from one state to another. Initially one set will be active and the other set will be dormant until triggered via the targetname key.
Located near all spawnpoints in the game is a team_WOLF_objective entity which appears on the command map, determines who owns the spawnpoint initially (If you select both spawnflag values then it WILL produce erratic results) and has a description key used by the autospawn feature.
If the spawnpoints are spread out across a wide area or in several rooms then the team_WOLF_objective entity should be located somewhere in the middle of the spawnpoints. When the game spawns a player it will choose the next available spawnpoint closest to the team_WOLF_objective entity. Some spawnpoints will not be used unless you have a lot of players spawning at once. All spawn areas should be designed to cope with 16 players spawning at once on each side.
The autospawn feature is designed to start players at the most forward spawn point on the map for the relevant team. As spawn areas are captured temporarily or permanently the script system needs to keep the autospawn feature up to date.
The description key is used by the autospawn system to switch the state of the team_WOLF_objective entity from one team to the next. The autospawn feature is totally controlled via the script and does not switch spawnpoints around either. (You still need to triggered the spawnpoint entities as before)
The setautospawn command (used in the script) uses the description key of the team_WOLF_objective entity to determine which spawn area to use, followed by a 0/1 value for which team. 0 represents Axis and 1 is for the Allied. There is no default for the setautospawn command so it needs to be setup at the beginning of the game, usually located in the game_manager routine of the script.
Please note that Enemy Territory maps still require the game_manager entity to be present in all maps. The map script usually starts with the game_manager routine because it always exists in every map.
Spawn area considerations
Unfortunately there is a certain type of player who insists on disrupting online games as much as possible. These tactics range from spawn camping to door blocking and sadly these things can ruin a game for all people involved.
There is currently no way of "bumping" players out of the way in RtCW / Enemy Territory and some players on public servers insist on disrupting games by blocking doorways to / from spawn areas.
When designing spawn areas we considered the following points:
- If you can spare the space then create all spawn areas with at least two entrance/exits so one player cannot block a whole spawn area.
- If you have only one entrance / exit to a spawn area then make it at least 3 players wide in order to prevent 1 player from blocking the doorway.
- Make sure that neither team can place landmines on the floor of the spawn area.
- Place all spawn entities as close as possible against a wall so that enemy players cannot stand behind the spawn entities and spawn camp.
- If possible place spawn areas under cover so that mortar / artillery strikes cannot affect new players joining the game.
- Remember to make sure all spawn entities have the spawnflag set to invulnerable so that new players are not killed instantly upon spawning into the game.
- Try creating spawn areas high up so that the new players have a height advantage over the opposing forces.
- Create multiple spawn locations for critical areas to minimize spawn camping and door blocking.
No spawnpoint is entirely spam-proof. Regardless of how many features you build into a spawn area to prevent disruptive game play, some players will always find a way to spam it. All you can do is to try and prevent as many of the most obvious problems associated with spawn areas as possible.