02 - Horde Mod Support and Spawn Jail

Earlier versions of the Horde kismet included a server-killing bug that caused the game to continuously spawn non-existent pawns, known as "the ping bug". This was caused by how the player spawns were originally handled, spawn points were simply disabled mid-wave. Chivalry's code bugged out on this.

So now we have a new way of handling mid-wave player spawning - or lack there of. Well, actually two ways. This is where Horde Mod will be introduced to this guide. Horde Mod is a support mod for Horde Maps. Horde type maps should be made to be able to run without it (if, for instance, you wanted to run another mod on a horde map, the map will be broken if it requires horde mod to be running), what Horde Mod does is change some handling of player spawning. It also places friend markers on all teammates, disables "bot has joined the battle" chat messages, and other small things to enhance the horde experience.

HordeMod is supported in kismet by activating an AOC Remote Event named "HordeMod" and for all Horde Mod specific actions your map's kismet should include include two possibilities, one that only happens if HordeMod is activated and one that only happens if it isn't (ie. both a gate that is closed by default and opened when HordeMod is activated and a gate this is open by default and closed if HordeMod is called).

Horde Mod spawning

The first way of handling spawning, also the much simpler way, requires the Horde Mod to be running. The following image is the entirety of player spawn handling when using the mod. When a wave starts we activate a remote event called DisableSpawns. DisableSpawns goes through our HordeMod gate only if the mod is running, this then goes out to a "set minimum spawn time" action with a time set extremely high to ensure that a player should never reach the end of the timer. When the wave ends we set the spawn time extremely short. Note: the "wave start" remote event is called elsewhere and isn't present in the old horde kismet. Horde Mod updates your respawn timer while you're dead based on the "set minimum spawn time" action, un-modded chivalry doesn't do this so we need a second way. 

Non-Horde Mod spawning

So then this is what we do if Horde Mod isn't detected. There are two gates, the first is open as long as HordeMod isn't running. The second is open after our DisableSpawns event from above is activated, and closed after CompleteWave (activated elsewhere) is activated. If both gates are open we instantly teleport any spawned player to a target point in our spawn jail, with a switch and multiple targets just to avoid unnecessarily teleporting players on top of each other. We also display a Sub Crosshair text (with private message enabled and our spawned player as the target) explaining to them that they are in prison and will respawn when the next wave starts. When the wave ends and CompleteWave fires we will force forward spawn anyone in jail (using an AOCTriggerVolume set to detect Masons in the jail) and then everyone's back in the game.

Part 2 of the non-horde mod solution is very important. Normally we keep track of all player spawns, the game ends when the number of player deaths equals the number of player spawns. If you're counting spawns in the jail, the game will never end, so we need to gate off the counter. Close the gate after DisableSpawns, open it again after CompleteWave, and problem solved.

This is what HordeTown's spawn jail looks like. It's simply an isolated area with 4 targets and its own pylon. It's completely disconnected from the rest of the map's path network, and the AOCTriggerVolumes that count players in each area do not touch it.

Other Horde Mod Implementations

Since your map should be set to 60 minutes, and TO2 as of writing this is kind of broken in modifying time, we're just going to let players win after 59 minutes and 59 seconds. BUT WAIT, HordeMod constantly resets the time, effectively getting rid of the time limit, so if we detect HordeMod just go ahead and don't even start the victory timer.

You should also include a message to let players know they are playing on the mod. It will also let you know that the mod and your implementation are both working properly.