Skip to content

Map yields: faded on unworked plots, larger on worked ones, as the original's - #164

Open
MortenLyhr wants to merge 3 commits into
bssth:masterfrom
MortenLyhr:fix/yield-display
Open

MortenLyhr wants to merge 3 commits into
bssth:masterfrom
MortenLyhr:fix/yield-display

Conversation

@MortenLyhr

@MortenLyhr MortenLyhr commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

This PR now stands alone on master. It carries go140point6's commit from #55 (#55), rebased on master, with go140point6 kept as its author: the stacked yield icons this PR changes come from that commit. Thanks to go140point6 for the stacked yield art and the city screen's yields.

What the rebase changed in #55's commit: its plot circles (and the Overlay::outline helper they used) are left out, because #151, now merged, draws the city's plot circles on the ground. Its resource icon box gave way to master's resource bubbles. The stacked yields and the city screen's workable-plot yields are kept as #55 has them.

If this PR merges, master has everything #55 brings (its plot circles through #151), so #55 could be closed then. That is for the maintainers to decide.

Commits: b878136f (#55, by go140point6, rebased) and 6d216caf (the yields' look, below).

The original draws a plot's yield icons partly see-through, and larger and solid on a plot a citizen works. OpenCiv4 drew them all solid and at one size.

The rule, from the SDK's CvPlot.cpp (getSymbolSize, updateSymbolDisplay, isVisibleWorked, isShowCitySymbols):

not worked worked (by the active team)
map (yield layer on) size 0.8, 0.6 opaque size 1.2, 0.8 opaque
a city's screen, the plots it can work size 1.2, 0.8 opaque size 1.6, opaque

The icons' base size stays what #55 calibrated: an unworked plot's icon is the size seen in Wine, both on the map and on the city screen. A worked plot's icon is larger by the original's ratio (×1.5 on the map, ×4/3 on the city screen).

Seen in Wine (plain BtS, the test scenario):

  • The faded icons on unworked coast and ocean (yd-a-y), and on the opponent's land (yd-foe-y).
  • On Roma's city screen, the worked plots' icons are larger and solid, and the others are smaller and faded (city-roma).

Already the same (no change), seen in Wine and read in the SDK:

  • A plot shows yields when CvPlot::calculateYield gives any. That is 0 for a plot no city could ever work (isPotentialCityWork, set by updatePotentialCityWork: no land plot within its 21-plot city radius). So ocean more than two plots from any land shows no yields in either game, with or without a city. Coast and ocean near land always show yields; a city nearby is not needed. In Wine yd-a-y, the three rows of deep ocean between the islands have none.
  • Our land, an opponent's, and no one's all show yields (yd-foe-y).
  • Under the fog the yields stay, for the plot as last seen (the display form, calculateYield(..., true)). Unrevealed plots show none (updateSymbolVisibility: isRevealed) (yd-fog-y).
  • Not seen in Wine: the World Builder. OpenCiv4's World Builder shows every plot's own yields, unrevealed ones too.

Pictures (Wine | before | after):

Coast row, close up (top to bottom):
coast

yd-a-y:
yd-a-y

yd-foe-y:
yd-foe-y

yd-fog-y:
yd-fog-y

Roma's city screen (Wine | after):
city-roma

Roma on the map, after (worked plots larger):
roma-map

Tests: ctest passes (15/15 on master 8b7d8557); the turn-100 checksum is unchanged (all 100 turns equal master's, ending D7D43800, --turns 100 --map Fractal --size STANDARD --seed 7): drawing only.

🤖 Generated with Claude Code

go140point6 and others added 2 commits November 23, 2026 09:21
…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.
…iginal's plot symbols

The original draws a plot's yield symbols at CvPlot::getSymbolSize's size and
updateSymbolDisplay's opacity (both in the SDK's CvPlot.cpp): on the map 0.8 and
0.6 opaque, a plot the active team works 1.2 and 0.8; on a city's screen, the
plots it can work (isShowCitySymbols) 1.2 and 0.8, a worked one 1.6 and opaque.
OpenCiv4 drew them all opaque at one size. Seen in Wine (plain BtS): the faded
icons on unworked coast and ocean, and the larger, solid ones on Roma's worked
plots on its city screen. The plots that show yields were already the same in
both (seen in Wine: none on ocean more than two plots from land, as
CvPlot::isPotentialCityWork; under the fog as last seen; none on unrevealed plots).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…d isn't DllExport)

The Windows host links only the game core's exported functions, so the call to
CvPlot::isVisibleWorked failed to link (LNK2001). The same rule, from the SDK's
CvPlot.cpp: getVisibleImprovementState's worked (being worked, and the active team
sees the plot) and the plot owner's team is the active team; a team always sees the
plots it owns (CvPlot::updateSight). In the debug mode only worked plots the active
team sees are marked. Checked against isVisibleWorked on macOS: no differences on
5136 worked plots across the kit's yd-roma-y, city-roma and yd-foe-y views.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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