Skip to content

About

CS2 CounterStrikeSharp re-creation of sm_teambalance by Otstrel.ru Team. Death-triggered balancing, JSON config, and hot reload.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

TeamBalancer

A re-creation of Team Balance (sm_teambalance v1.2) for Counter-Strike 2, built with CounterStrikeSharp.

The original CS:S/CS:GO SourceMod plugin was created by Otstrel.ru Team. Credit goes to the original author for the plugin and its balancing behavior. This CS2 re-creation is maintained by Magic8Ballin / Gloveworks.

Original plugin on AlliedModders · Download the latest release

What it does

If one team has more than one extra player, TeamBalancer moves the next eligible player who dies on that team to the smaller team after a short delay.

  • Default behavior follows the original: a 0.1-second delay, bots included in team counts, human players moved, and suicides ignored.
  • Generates its own JSON config. No database required.
  • Supports config reload and DLL hot reload.
  • Rechecks team counts and player state before moving anyone.
  • Can pause during asymmetric bot modes such as BotWaves.

Install

Requires a CS2 server with CounterStrikeSharp API 367 or newer. Tested with CounterStrikeSharp 1.0.378.

  1. Download TeamBalancer-1.0.0.zip from Releases. The release ZIP contains the compiled plugin; GitHub's automatic source archives contain source code.
  2. Extract the ZIP's addons folder into your server's game/csgo folder.
  3. Restart the server, or load it from the server console with css_plugins load TeamBalancer.

The plugin files belong here:

game/csgo/addons/counterstrikesharp/plugins/TeamBalancer/

The first load generates:

game/csgo/addons/counterstrikesharp/configs/plugins/TeamBalancer/TeamBalancer.json

Configuration

The original v1.2 plugin had no config or cvars. This re-creation exposes its hardcoded defaults and adds reload and compatibility settings.

Option Default Description
Enabled true Enable balancing.
MaxTeamDifference 1 Largest allowed team-size difference, from 1 to 63.
ChangeTeamDelay 0.1 Delay after death in seconds, from 0.01 to 30.
CountBots true Include bots in team counts.
BalanceBots false Allow dead bots to be moved.
IgnoreSuicides true Skip suicides.
IgnoreWorldDeaths false Skip deaths without a valid attacker when enabled.
PauseWhenBotJoinTeamRestricted true Pause when bot_join_team is t or ct, for asymmetric modes. Set false if your normal mode restricts bots to one team.
AnnounceBalance false Tell the moved player privately in chat.
Debug false Log successful moves.
ConfigVersion 1 Config schema version; leave at 1.

TeamBalancer does not change server cvars or disable other balancing plugins. Check your existing balancing settings if you run several plugins together.

Commands and hot reload

Server console command Action
css_teambalance_reload Apply config edits immediately. Invalid edits retain the last working settings.
css_teambalance_status Show team counts, paused/enabled state, and pending/completed moves.

In-game aliases are !teambalance_reload and !teambalance_status; both require @css/config.

Replace the DLL to hot reload when CounterStrikeSharp's PluginHotReloadEnabled setting is true. Config reloads and DLL reloads cancel pending moves safely.

Build from source

Install the .NET 8 SDK or newer and Python 3 for packaging:

dotnet restore TeamBalancer.csproj --locked-mode
dotnet build TeamBalancer.csproj -c Release --no-restore
dotnet run --project tests/TeamBalancer.Tests.csproj -c Release
python scripts/package.py

The compiled ZIP and its SHA-256 checksum are written to dist/. Framework dependencies come from CounterStrikeSharp and are not bundled. See tests/README.md for verification notes.

License and credits

Released under GPL-3.0-or-later. Original plugin: Otstrel.ru Team. CS2 re-creation: Magic8Ballin / Gloveworks. See NOTICE.md for attribution.

About

CS2 CounterStrikeSharp re-creation of sm_teambalance by Otstrel.ru Team. Death-triggered balancing, JSON config, and hot reload.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages