Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,4 @@ jobs:
python3 contract/scripts/modes.py select catalog "${mode##*/}"
done
python3 -m unittest discover -s contract/tests -p test_modes.py
python3 -m unittest discover -s catalog/tests -p 'test_*.py'
31 changes: 31 additions & 0 deletions docs/zombies-voting.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Zombies native map voting

Enable existing native voting for `/callvote map mp_crash` (select next map)
and `/callvote map_rotate` (switch through the existing engine transition).
Only rotation maps are accepted. Killhouse remains excluded; native BTD startup
fails in its waypoint loader and supervised gameplay is not qualified.

Zombies mode sets configurable `g_voteCooldown=5`, `g_voteTime=30`,
`g_voteMaxVotes=2`, `g_voteAbstainWeight=1`. Kick, restart and gametype votes
are disabled. The engine excludes bots from calling, casting and quorum.
Promod configuration is unchanged; no wave globals are manipulated by this change.

Baseline config master: `9fd5c9d`. Catalog policy test and 22 discovery contract
tests passed. Companion engine native vote/rotation tests passed. Local BTD
integration passed 89/89 checks across 15 supported maps and process restart:
`/tmp/cod4-btd-qualified-18naigad`. This checks policy, map startup, purity,
eight integrity headers and absence of script errors. It does not certify
real-client vote UI or vote-driven transitions during combat.

Additional local evidence: BTD lifecycle passed with the proposed policy at
`/tmp/btd-death-regression-uh2phcph` (death, respawn, wave two, admission and
administrative map transitions). Fresh pinned Promod overlays passed 53/53
integration checks at `/tmp/cod4x-promod-integration-6yoxi62_`, including ready-up,
voting and administration. An older prepared runtime failed ready-up checks;
its overlay differs from current preparation and is retained as historical evidence.

Keep `bot_enable=0` until a separate BTD ally adapter is implemented and qualified.
Require independent review, green mandatory Configuration tests and owner merge.
Operator-supervised gameplay and explicit approval remain necessary for deployment.
Rollback by reverting this focused policy change through the existing reviewed
workflow. No running service was changed.
14 changes: 12 additions & 2 deletions modes/zombies/server.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,18 @@ set g_gametype "war"
set sv_mapRotation "gametype war map mp_convoy gametype war map mp_bloc gametype war map mp_bog gametype war map mp_broadcast gametype war map mp_countdown gametype war map mp_crash gametype war map mp_creek gametype war map mp_crossfire gametype war map mp_farm gametype war map mp_overgrown gametype war map mp_pipeline gametype war map mp_showdown gametype war map mp_strike gametype war map mp_vacant gametype war map mp_cargoship"
// Zombies are provided by BTD; never attach the Promod Bot Warfare integration.
set bot_enable "0"
set g_allowVote "0"
set g_oldVoting "0"
// Native vote UI; only rotation maps may be selected. Bots are ineligible.
set g_allowVote "1"
set g_oldVoting "1"
set g_voteAllowMap "1"
set g_voteAllowMaprotate "1"
set g_voteAllowRestart "0"
set g_voteAllowGametype "0"
set g_voteAllowKick "0"
set g_voteTime "30"
set g_voteMaxVotes "2"
set g_voteAbstainWeight "1"
set g_voteCooldown "5"
set scr_teambalance "0"
set scr_war_scorelimit "0"
set scr_war_timelimit "0"
Expand Down
26 changes: 26 additions & 0 deletions tests/test_zombies_voting.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
"""Mode policy contract; native voting behavior is tested in the engine suite."""
from pathlib import Path
import re
import unittest

ROOT = Path(__file__).resolve().parents[1]


class ZombiesVoting(unittest.TestCase):
def test_native_map_votes_only(self):
cfg = (ROOT / 'modes/zombies/server.cfg').read_text()
pairs = re.findall(r'^set (\w+) "([^"\n]*)"$', cfg, re.M)
values = dict(pairs)
self.assertEqual(len(pairs), len(values), 'ambiguous repeated mode setting')
expected = {'g_allowVote': '1', 'g_oldVoting': '1',
'g_voteAllowMap': '1', 'g_voteAllowMaprotate': '1',
'g_voteAllowRestart': '0', 'g_voteAllowGametype': '0',
'g_voteAllowKick': '0', 'g_voteCooldown': '5',
'g_voteAbstainWeight': '1', 'sv_pure': '1', 'bot_enable': '0'}
for name, value in expected.items():
with self.subTest(name=name):
self.assertEqual(values[name], value)
maps = re.findall(r'\bmap (mp_\w+)', values['sv_mapRotation'])
self.assertIn('mp_crash', maps)
self.assertNotIn('mp_killhouse', maps, 'requires supervised qualification')
self.assertEqual(len(maps), 15)
Loading