Skip to content

Fix city plot rings and show stacked tile yields - #55

Open
go140point6 wants to merge 1 commit into
bssth:masterfrom
go140point6:fix/city-plot-overlays
Open

go140point6 wants to merge 1 commit into
bssth:masterfrom
go140point6:fix/city-plot-overlays

Conversation

@go140point6

@go140point6 go140point6 commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

What it changes

Opening a city did not automatically show its tiles' yields, and the worked-plot rings stayed flattened even in the overhead city view. The optional map yield overlay used small, evenly spaced font icons instead of the game's stacked artwork.

  • Project plot rings from circles on the terrain, so they are round from above and foreshorten with the camera.
  • Show yields automatically on tiles the selected city can work. Leaving the city restores the normal map yield toggle; it still starts off.
  • Read the yield billboard textures referenced by CIV4YieldInfos.xml and draw food, production and commerce stacks side by side. Both views use the larger size rule, and quantities above MAX_YIELD_STACK use additional groups. Game-font symbols are the fallback when stack textures are unavailable.

canWork is called through the existing Python API for the city's plots because it is not exported by the Windows game-core DLL. The game-core sources and submodule revision are unchanged. No game assets or saves are included in the source branch.

Screenshots

City view, with yields shown without enabling the map toggle:

City rings and stacked tile yields

Normal map, with the yield toggle enabled:

Stacked yields on the normal map

How it was checked

  • ctest --test-dir build\Release passes: 12/12 on native Windows, built with Visual Studio 2026 in Release mode.
  • Game results unchanged: every checksum in --turns 100 --map Fractal --size STANDARD --seed 7 matches unmodified 0562d4e, ending at D7D43800.
  • Original saves still load: not independently tested with an original 32-bit BtS save. An existing OpenCiv4 turn-50 save loaded during graphical checks.
  • Scripted screenshots check automatic city yields, removal on closing the city, and the normal map toggle. Separate scenes cover counts 1-7 for food and production and 1-6 for commerce.
  • Played and visually checked on Windows with an installed BtS copy; the contributor confirmed the rings and stacked presentation. macOS/Linux and custom game cores have not been tested.
  • git diff --check passes.

Related independent visual PRs and possible merge overlap

This PR, #56, and #57 are based on separate branches created directly from upstream master (0562d4e). They do not contain or depend on one another, so each can be reviewed and merged independently in any combination. All three touch src/render/MapView.cpp in separate feature areas, so merging them in a different order may produce a small mechanical conflict even though there is no functional dependency.

MortenLyhr pushed a commit to MortenLyhr/openciv4 that referenced this pull request Nov 23, 2026
…elds

go140point6's bssth#55 ("Fix city plot circles and display stacked
tile yields"), rebased on master by mortenlyhr. Its plot circle part and the
Overlay::outline helper it used are left out: bssth#151, now merged, draws the
city's plot circles on the ground. Its resource icon box gave way to
master's resource bubbles. Kept as bssth#55 has them: the yields as the game's
stacked yield art (maxYieldStack a stack), and on a city's screen the yields
of the plots the city can work.
@MortenLyhr

Copy link
Copy Markdown
Contributor

Hi @go140point6, thanks again for this one. The stacked yield icons look great, and my #164 builds on them.

#55 and #164 both conflicted with master after the last round of merges. So that #164 could stand on its own, I rebased your commit onto master and put it at the base of #164 (#164). You're still the commit's author, and #164 credits you and links back here.

In the rebase I left out the plot-circle part (and the Overlay::outline helper it used), because #151, now merged, draws the city's plot circles on the ground. The resource icon box gave way to master's resource bubbles. The stacked yields and the city screen's yields are as you wrote them.

If #164 is merged, everything #55 brings would be in master, so this PR could then be closed. That's up to you and the maintainers, of course. If you'd rather land #55 yourself first, I'm happy to rebase #164 onto it instead.

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