Repository navigation
FreeCiv: support runs with different numbers of players - #14
Merged
Merged
Conversation
run_world.py --barbarians (e.g. DISABLED) sends /set barbarians at game setup. The setting is stored in the savegame, so forks inherit it. Empty (the default) leaves the server default, so existing runs are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- consolidate_v4.py --n-main: number of main players (was fixed at 5) - bank_v1.py: no W5_tech_lead, W1_wonder_race, civ_score_leader or P6_world_techs with one civ; S3 k capped at the number of pairs; civ count in the P6 text; minimum counts a tenth of the replays (100 at 1,000, as before); --horizons and --binary-only (skip continuous and reveals) - sweep_v4.py: the same one-civ guard and P6 wording - draw_v1.py: --binary-only writes bank, tails and mirrors; --no-natcond adds continuous but skips natcond - criteria_v1.py: civ and pair counts from the world instead of five/ten; --no-barbarians drops the barbarian clauses of the capture and loss rules; skips set files a partial draw does not write Defaults reproduce the five-player behavior. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Tze4TyWfLhxtj3vrQ8sXgs
…from the setting regen_reports.py calls generate_txt_report with map_interval 0, which crashed on range() with step 0; the renderer now skips the map section instead. The report header's barbarian line now follows the savegame's barbarians setting. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Tze4TyWfLhxtj3vrQ8sXgs
The paper's turn-60 reports have a DIPLOMACY table (state, first contact turn, embassy per pair) whose generator was never committed. Rebuilt from diplomacy.relations in the game data: pairs in ID order, 'never' as the first contact turn of pairs that have not met, Embassy from the lower ID's record of the pair. On the eight paper anchors (their data json beside the reports) the section is byte-identical to the published reports. Left out with fewer than two civilizations. regen_reports.py inserts BORDERS after it, so BORDERS reappears too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Tze4TyWfLhxtj3vrQ8sXgs
- anchor_one.sh: FBSIM_N_PLAYERS and FBSIM_BARBARIANS; writes settings.txt; skips the diplomacy publish gate with one player; publishes ruleset.json, the recording's turn states (recording_states.tar.gz) and the sgtables - make_bundle.sh ships draw/sg_tables.py, which finish_pod.sh and anchor_one.sh run on the pod (finish_pod.sh used to fail without it) - the old run's hard-coded archive pod IDs replaced by state/archive_pods.txt; scripts that need it stop when it is missing; requeue_slice.sh no longer assumes 32-vCPU workers - finalize.sh: anchors from FBSIM_ANCHORS or state/anchors/, --n-main from FBSIM_N_PLAYERS, ruleset from the pulled anchors - rp.sh and switch_anchor.sh find rp_list.py and make_queue.py under draw/; switch_anchor.sh takes the rng range from FBSIM_RNG - regen_reports.py: main players from the anchor's settings.txt (5 without one); unpacks recording_states.tar.gz when the turn states are missing; the ruleset falls back to the anchor's own - worlds/freeciv requires Python 3.11.4 (tarfile's extraction filter) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Tze4TyWfLhxtj3vrQ8sXgs
FBSIM_FREECIV_N_CIVS (1-5) replaces "Five AI civilizations are competing." in the elicitation prompts, and stops if a prompt lacks that sentence; FBSIM_FREECIV_V3_DRAW names the draw folder under sets/ for elicit_v2.py and score_v2.py. Defaults reproduce the paper's prompts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Tze4TyWfLhxtj3vrQ8sXgs
fdrocha
marked this pull request as ready for review
October 27, 2026 10:43
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adapt FreeCiv pipeline to run worlds with a different number of civilizations than the previous N=5. In particular, add support for one player runs, disabling some of the questions and contents of world report. Also support running without barbarians since one they are one they can effectively add new civilizations in some circumstances.
With default settings and arguments, the five-player paper behavior is unchanged.
Details from Claude:
Commits
run_world.py --barbarians(e.g.DISABLED) sends/set barbariansat game setup. It is stored in the savegame, so forks inherit it.consolidate_v4.py --n-main.bank_v1.pyandsweep_v4.pyskip families that need other civs (W5_tech_lead,W1_wonder_race,civ_score_leader,P6_world_techswith one civ) and capS3k at the number of pairs.criteria_v1.pytakes civ and pair counts from the world, and--no-barbariansdrops the barbarian clauses.draw_v1.pyadds--binary-onlyand--no-natcond.generate_txt_reportno longer crashes atmap_interval0. The report header's barbarian line follows the savegame setting.DIPLOMACY (TURN N)table from the paper's v3 reports, whose generator was never committed. On the eight paper anchors it is byte-identical to the published section, andregen_reports.pynow inserts BORDERS again. It is left out with fewer than two civs. Everygenerate_txt_reportcaller gets it, the legacy CivBench scripts included.anchor_one.shtakesFBSIM_N_PLAYERS/FBSIM_BARBARIANSand publishessettings.txt,ruleset.json, turn states and sgtables. The old run's hard-coded pod IDs are replaced bystate/archive_pods.txt. Pre-existing path bugs are fixed:sg_tables.pywas not shipped to pods, andrp_list.py/make_queue.pywere looked up in the wrong directory.regen_reports.pyreads the player count fromsettings.txt.worlds/freecivnow requires Python ≥ 3.11.4, fortarfile's extraction filter.FBSIM_FREECIV_N_CIVS(1–5) sets the civilization sentence in the elicitation prompts, andFBSIM_FREECIV_V3_DRAWnames the draw folder.Testing
DISABLED, each replayed 20 times T60→T210. The T60 saves carry"barbarians","DISABLED". All 40 replays published, with no truncations or gate failures.consolidate_v4 --n-main→bank_v1→draw_v1(--binary-onlyand--no-natcond) →criteria_v1→regen_reportsrun end to end on both smoke corpora. The later refactors (draw_v1write helper, number words) were checked to produce identical sets and criteria.regen_reports.pyoutput is byte-identical with and withoutsettings.txton the smoke anchors. Elicitation prefixes are unchanged by default.bash -n. They have not run on RunPod since these edits.