Skip to content

Add Cultural Victory victory condition - #1132

Open
Billytifft wants to merge 1 commit into
C7-Game:Developmentfrom
Billytifft:billy/culture-victory
Open

Billytifft wants to merge 1 commit into
C7-Game:Developmentfrom
Billytifft:billy/culture-victory

Conversation

@Billytifft

@Billytifft Billytifft commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Implements the Cultural Victory condition, following the Conquest/Domination work in #1037. Rules taken from https://civfanatics.com/civ3/infocenter/#culture Culture Victory section.

What changed

  • Added CultureVictory : IVictory:
    • Single-city win at the configured city threshold (C3C default 20,000, not scaled by map size).
    • Civilization-wide win at the configured empire threshold (C3C default 100,000 on Standard, scaled by map size).
Screenshot 2026-11-23 at 8 58 03 AM
  • Civ3 rule requiring at least twice the culture of every rival for the empire-wide win; enabled by default.
  • Status rows for the Victory Status screen (F8), showing the best city and empire totals against the top rival.
  • The victory announcement now names the path that was met, so the reason is visible before a Score screen exists:
    • The Celts have won a Culture victory (city)!
    • The Celts have won a Culture victory (empire)!
    • If both paths are met at once: (city and empire).
    • Implemented with an optional IVictory.Detail(VictoryStatus) method that returns an empty string for all other victory types, so existing announcements are unchanged.
  • Added an “Allow Cultural Victory” checkbox on the player setup screen with INI persistence. It defaults off, matching the current Domination default.
  • The 2x-rival-culture rule is deliberately not exposed on the player setup screen. It stays enabled by default and its INI key is reserved for a future Game Rules screen.
  • Imported OneCityCultureWin / AllCitiesCultureWin from Civ3 BIQ/SAV data where available. Imported empire thresholds are treated as the Standard-map base and scaled by map size: Tiny 60k, Small 80k, Standard 100k, Large 130k, Huge 160k. The single-city value is used as-is. Missing or zero values fall back to those defaults.
  • Preserved imported BIQ/SAV culture thresholds through new-game setup: GameSetup.Populate() carries them over from the imported ruleset before applying the settings-driven victory switches. Zero values still fall back to the map-size defaults.
  • Persisted both new rules in save JSON as part of VictoryConditions; older saves without the values get the defaults above.
  • Added a TODO for a future Game Rules screen to edit victory thresholds and the 2x rival rule.

Deliberate scope choices

  • Uses OpenCiv3's existing per-owner culture figure (City.GetCulture()), not Civ3's captured-city total culture. In the current engine a captured city is destroyed and removed, so its culture does not transfer to or remain counted for the original owner.
  • No editable threshold or 2x-rule screen in this PR; the player setup screen only gains the “Allow Cultural Victory” checkbox.
  • Culture Victory is off by default, matching Domination's current default.
  • The 2x rule stays on by default, matching Civ3, until a Game Rules screen can expose it.

Test plan

  • Confirmed through playtesting with smaller thresholds that both the city and empire victory conditions work as expected, including the need for your empire to be double that of your next biggest rival.
  • dotnet build C7/C7.sln, dotnet test C7/C7.sln, and dotnet format C7/C7.sln whitespace --verify-no-changes.

Notes for reviewers

  • Civ3's BIQ stores 20,000/100,000 even for non-Standard maps; C3C applies map-size scaling at runtime. This branch treats the imported 100,000 as the Standard base before scaling.
  • The (city) / (empire) suffix is a stopgap until a Score screen can show the full breakdown.
  • Open question: BIQ files expose a CulturalVictory enable flag (QueryCiv3.Biq.GAME.CulturalVictory), but this branch does not import it; the INI checkbox still controls whether the condition is enabled for new games. SAV imports do read the flag. This matches current behaviour for Domination and Conquest, which also do not read their enable flags from BIQ files. Should we change that for all victory types in a separate PR, or keep relying on the player setup screen?

Implements single-city and empire-wide culture wins with C3C threshold scaling, imported BIQ/SAV thresholds, save/load persistence, and a culture-path suffix in the victory announcement.
@Billytifft
Billytifft marked this pull request as ready for review November 23, 2026 18:09
@WildWeazel

Copy link
Copy Markdown
Member

Huh, I never realized that captured culture counts towards victory if you turn it on! That would be an interesting path to win, and gives me an idea for an achievement if we ever add those 😆

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants