Skip to content

City bar: the original's art, layout, placement and size at every zoom - #64

Closed
MortenLyhr wants to merge 3 commits into
bssth:masterfrom
MortenLyhr:fix/city-bar-art
Closed

MortenLyhr wants to merge 3 commits into
bssth:masterfrom
MortenLyhr:fix/city-bar-art

Conversation

@MortenLyhr

@MortenLyhr MortenLyhr commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

The city bar was a simple pill ("6 □ Roma", the star missing from the font) floating over the city and hidden beyond 45 plots. It is now drawn from the game's own city bar, Art/Interface/CityBar/CityBar.nif, with its layout in the model's units:

  • the banner (CityBar_Base.dds, 128 × 32) with the growth bar in its upper half and the production bar in its lower half
  • the population on the capital's star (CityBar_Star.tga) or the circle (CityBar_Circle.tga), in getCityBillboardSizeIconColors' colours
  • the production symbol for the active team's cities: CvCity::getCityBillboardProductionIcon (the button of what the city builds, else INTERFACE_BUTTONS_NOPRODUCTION), cut round by ProductionIconMask.tga under ProductionIconBevel.tga
  • the name in the upper half, what it builds in the lower half, and buildCityBillboardIconString's icons above (CityTextMarker, ProductionTextMarker, IconTextMarkerTop)

Placement and size follow CIV4DetailManager.xml's CITYBILLBOARD_* faders, checked against the original (BtS 3.19 in Wine) at camera distances of 5 to 102 plots and with the city near the screen's edges:

  • The bar's top sits on the ground south of the city (towards the bottom of the screen) by CITYBILLBOARD_RADIUS: 90 units up close, no closer than 70. With the plot grid on, it lies on the city plot's south edge in both games.
  • Its size is the original's as measured (the star's width), from CITYBILLBOARD_SCALE's 1.5 up close to its 0.67 far out. It matches Wine's within 1.5 points at every distance measured.
  • It stays shown at every zoom, as the original's (not only within 45 plots).

A click on the bar is a click on its city (the city screen opens), over any unit figure under it, as in the original; hovering it gives the city's plot help.

Start view, zoom 0.45 and zoom 0.9:

start view
zoom 0.45
zoom 0.9

Close up (zoom 0.1, plot grid on) and with the city near the left edge:

close, grid
left edge

These were taken with #62 (camera) and #63 (scenario free units) applied, so that the views line up. What still differs:

  • Camera: at tilted zooms the original draws the map higher on screen (by up to 65 pt up close, 0 straight down), and up close its camera turns about 4°. That's the camera's, not the bar's: the bar sits on the same place of its plot in both games.
  • Defence text: the original shows " :+60%" after the icons. The game core builds it with a narrow "+" in a wide format (%s), which reads right on Windows' 2-byte wchar_t but fails on macOS, so the text is dropped. A separate fix.
  • Font: the theme's font is Sylfaen, which macOS doesn't have.

Checked:

  • ctest 13/13.
  • --turns 100 --map Fractal --size STANDARD --seed 7 checksums match master on every turn.

Note (2026-11-20): a single click on the city bar opening the city screen is replaced in #113: as in the original, one click on the bar selects the city and a double click opens it.

🤖 Generated with Claude Code

MortenLyhr and others added 3 commits November 19, 2026 14:57
The city bar is drawn from the game's CityBar.nif layout and textures:
the banner (CityBar_Base) with the growth and production bars in its
halves, the capital's star or the circle in the population's colour,
the production symbol (what the city builds, else the cancel button,
cut round by ProductionIconMask under ProductionIconBevel) for the
active team's cities, the name and what it builds in the banner's
halves, and buildCityBillboardIconString's icons above it.

It is placed and sized as the original's CITYBILLBOARD faders
(CIV4DetailManager) place it, measured in the original at camera
distances of 12 to 102 plots: out from the city towards the bottom of
the screen and raised, its size levelling off at 0.67. It is no longer
hidden beyond 45 plots, and a click on it is a click on its city (the
city screen opens), over any unit figure under it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…LLBOARD_RADIUS

The size came from a fit to zooms from the start view out, which grew
without end closer in. It is now the star's width as measured in the
original at 5 to 102 plots (1.39 points a model unit up close to 0.69 far
out). The bar's top sits on the ground south of the city by
CITYBILLBOARD_RADIUS (90 units up close, no closer than 70), as the
original's plot grid shows, not twice that and raised.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…onIcon

The host may call only the game core's exports on Windows: the order
queue and GC's info getters are not, so the Windows build did not link.
getCityBillboardProductionIcon is the engine's own call for the symbol:
the player's button for a unit, and INTERFACE_BUTTONS_NOPRODUCTION when
nothing is built (as the original shows), not the cancel button.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@MortenLyhr

MortenLyhr commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor Author

Included in bundle 1/6, #145, merged there with its own commits and with its conflicts with the other open PRs resolved (the bundle PR lists them). Closing in favour of #145.

@MortenLyhr MortenLyhr closed this Nov 21, 2026
bssth pushed a commit that referenced this pull request Nov 23, 2026
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