Skip to content

City age tracking, culture expansion, and info added to city zoom UI - #1141

Open
zack-the-coding-actuary wants to merge 4 commits into
C7-Game:Developmentfrom
zack-the-coding-actuary:city_ages
Open

zack-the-coding-actuary wants to merge 4 commits into
C7-Game:Developmentfrom
zack-the-coding-actuary:city_ages

Conversation

@zack-the-coding-actuary

@zack-the-coding-actuary zack-the-coding-actuary commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

I originally was just going to track the turn / year a city was founded so I could finish the TODO in GameData.cs related to resolving tile conflicts, but adding the usual UI information to the city zoom screen seemed like a natural extension of this. Changes below:

  • Track city founding turn (City.turnFounded); use it as the Law V tiebreaker (older city wins) in tile ownership conflicts
  • Added Rules.BorderFactor (culture cost N of the first border tier, tier k costs N^k), replacing the hardcoded 10
    • New games and older C7 saves: default from Lua gameplay.culture.border_factor (10)
    • Civ 3 BIQ/SAV loads: use the BIQ's BorderFactor
  • Added City.TurnsUntilBorderExpansion and City.Population (base-game formula for display purposes only)
  • City screen: add founded date, "Expands in N turns", gold, government, population, and current year (BC/AD)
    • Cities from older saves show as founded on turn 0
  • Added tests for border levels and the population formula

Before:

zoom_before

After:

zoom_after

- Add City.turnFounded, set via an optional constructor argument that CityInteractions.BuildCity passes from the current game turn
- Apply the city age tiebreaker (oldest city wins) as Law V in GameData.ResolveTileOwnershipConflict
- Add a Founded label under the city name in the city screen showing the in-game year the city was founded
- Add Rules.BorderFactor, the culture cost N of the first border expansion tier, where tier k costs N^k
- Default the border factor from the new gameplay.culture.border_factor Lua function for new games and older C7 saves, and import it from the BIQ RULE section for Civ 3 BIQ and SAV loads
- Replace the hardcoded base 10 in City border logic with the border factor, using an integer loop in GetBorderExpansionLevel and a new CultureForNextBorderExpansion
- Add City.TurnsUntilBorderExpansion and show "Expands in N turns" under the culture header on the city screen
- Use CultureForNextBorderExpansion for the "Total" culture line on the city screen
- Add BorderExpansionTest covering border levels and thresholds for several border factors
- Add City.Population, computed with the base game formula from city size and the fraction of the food box filled
- Show the owner's gold, the owner's government, the city's population and the current turn's year (BC/AD) under the city name on the city screen
- Reposition the city name and founded labels to make room for the new fields
- Add CityPopulationTest covering the population formula
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.

1 participant