# Modes

### From Q4MAX

## Overview

Modes are "groups" of settings that persist across map changes. Modes are an extremely powerful mechanism and actually very easy to use, but they do have rules that must be followed.

Modes can be selected via the si_mode cvar, while si_gametype should not be used.

## Motivation

Servers are generally configured through extensive use of CVARS. Aside from issues with bloated server.cfg files, this scheme is simply not suitable for mods that support multiple gametypes, each of which has fundamentally different behaviour and thus REQUIRES fundamentally different settings for optimum gameplay.

"Casual" gametypes such as Clan Arena are generally meant to provide newbies with a gentle introduction to FPS play and simplify the game to just one or two elements; more advanced gametypes such as DM are intended to tax every possible aspect of a player's ability, and demand a wider range of "overall" skill from them.

Modes provide a simple way for server admins to address these different audiences by localising the rules of each gametype rather than attempting to come up with a "best mix" in a global config instead.

The mod ships with several standard modes to facilitate competition play.

Hopefully, an explanation of how these work will clarify the concept and behaviour before getting into how admins can define modes of their own.

## Details

Despite the need for variances in settings, there are certain elements of gameplay that are common across a large number of gametypes. These form the "base" configuration for all modes, and are as follows:

  Spawn Health: 125
  Spawn Armour: 0
  Armour Decay: On
  Self Damage: Full
  Team Damage: Full
  Falling Damage: On
  Armour Types: Standard VQ4
  Starting Weapons: Gauntlet and MG
  Weapon Dropping: Off
  Instagib: Off
  Overtime: Sudden Death

Fraglimit and Timelimit are set to 0 as well, since derived modes generally only want one or the other.

To this base configuration, the standard modes apply any changed or additional rules needed to acheive optimum gameplay within the context of their specific gametype.

As an example, for Deathmatch play those rules are:

  Timelimit: 15 minutes
  Overtime: 2-minute periods
  Weapon Respawn: 15 seconds

If it can be voted, it can be used in a mode file. Play around with it.

## Custom Modes

Custom modes are on equal footing with the built-in modes. You start with the same "base" settings, and add or change from there. You MAY NOT use the "mode" vote inside a custom mode: while it might be trivially easier to derive modes from each other, it's too prone to people becoming confused and creating cyclical modes.

You can't try and replace a standard mode with one of your own: the system will always try the built-ins first. Hence STANDARD modes. :)

Power comes at a price. The settings in your custom mode are subject to only the most minimal validation: if you try to do something stupid in them it's quite likely that the system will allow it. Be careful.

Q4Max ships with a few custom modes of its own in the modes/ directory. These can be quite useful as a reference for how to acheive a particular style of gameplay. The "base" settings are always applied first, then the customisation defined by the mode is added in. Modes are matched case-INsensitive to avoid problems on *nix filesystems.

## Reference Modes

Below you will find a list of the built-in modes as of version 0.71, as well their default settings. This allows server admins to quickly get all the properties for a given mode and change them as they see fit in a Custom Mode.

### Clan Arena

- Mode name : CA

    fraglimit 5
    timelimit 0
    dropweapons 0
    teamdamage 0
    falldamage 0
    selfdamage 0
    health 100
    armor 150
    gametype 5

### Free For All

- Mode name : FFA

    fraglimit 30
    weaponrespawn 5
    gametype 0

### Team DeathMatch

- Mode name : TDM

    overtime 1
    timelimit 20
    weaponrespawn 30
    gametype 2

### Capture The Flag

- Mode name : CTF

    timelimit 20
    caplimit 0
    teamdamage 0
    weaponrespawn 5
    gametype 3

### Arena Capture The Flag

Arena CTF is Raven's standard CTF with the four powerup-based "classes" from Q3:Team Arena (Ammo Regen, Scout, Guard, Doubler).

- Mode name : ACTF

    timelimit 20
    caplimit 0
    teamdamage 0
    weaponrespawn 5
    gametype 4

### Capture Strike

A mix of CA and CTF. Teams take turns attacking and defending every round.

- Mode name : CTFS

    fraglimit 15
    timelimit 2
    dropweapons 0
    falldamage 0
    selfdamage 0
    teamdamage 0
    health 100
    armor 150
    gametype 6

### Tourney

Tourney is Raven's standard 1 on 1 tournament mode with a single elimination bracket.

- Mode name : Tourney

    overtime 1
    timelimit 15
    weaponrespawn 15
    gametype 1

### Duel

Q3-style duel mode.

- mode name : "DUEL" or "DM". "DM" is provided for backwards compatibility.

    overtime 1
    timelimit 15
    weaponrespawn 15
    gametype 7