Skip to content

OpenCiv4 option: Quick enemy moves - #137

Closed
MortenLyhr wants to merge 9 commits into
bssth:masterfrom
MortenLyhr:fix/quick-enemy-moves
Closed

MortenLyhr wants to merge 9 commits into
bssth:masterfrom
MortenLyhr:fix/quick-enemy-moves

Conversation

@MortenLyhr

Copy link
Copy Markdown
Contributor

Stacked on #87 (fix/options-screen, the options' OpenCiv4 tab) and #124 (fix/show-moves, the shown moves' pacing); merge after both. This PR's own change is the last commit, 7033d63.

Why

With Show Enemy Moves or Show Friendly Moves on, the original shows each of the other civilizations' moves for about 1 s (#124). With many units their turn gets long. The original's Quick Moves speeds up only the player's own units. The user asked for a quicker option that still lets them follow each move.

The change

  • A check box Quick enemy moves on the options' OpenCiv4 tab, off by default, kept in profile.ini as quickEnemyMoves.
  • With it on, the turn worker waits 150 ms between the others' game updates while one of their moves is shown, instead of 250 ms. A move then takes 0.6 s instead of 1.0 s. The camera still goes to each unit, and the unit has arrived before the next move starts.
  • The game is unchanged: only the wait between updates changes. The 100-turn checksums equal master's (D7D43800), and ctest passes 14/14 (the options test now expects four OpenCiv4 options).

Test

The test map with barbarians and Vikings next to a Roman city, the turn ended with Show Enemy Moves on:

Quick enemy moves Camera on each barbarian move
off 3.23, 4.23, 5.23, 6.25, 7.25 s (1.0 s apart, as the original)
on 3.22, 3.82, 4.42, 5.03, 5.70 s (0.6 s apart)

With #127 (multi-plot walk)

#127 walks an AI unit's order in 1.0 s. With this option on, that walk should take 0.5 s so it ends before the next move; the play branch does this in its merge. Once both are in master, a small follow-up makes Entities::ExecuteMove use 0.5 s for the others' units when the option is on.

🤖 Generated with Claude Code

MortenLyhr and others added 9 commits November 20, 2026 13:50
… OpenCiv4's own options on their own tab

The original keeps the player options in its player profile and sends them to the
active player at the start of every game, new or loaded (CvGame::sendPlayerOptions);
OpenCiv4 used the XML's defaults for a new game and the save's own after a load, and
never wrote them to profile.ini. Now Utility holds the profile's (profile.ini player.N),
a choice sent from the options screen goes into it and is written at once.

The options screen's check boxes get the theme's GFC_Control_StandardCheckBox_Style, as
the custom game screen's; W A S D, idle turns and edge scrolling move to an OpenCiv4 tab.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rges cleanly with bssth#85)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ly with bssth#85)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…abs, GFC's box layout

Measured on the original's options screen (Wine, BUG + BULL): the standard window's title bar
with the title at the left, tabs as wide as their words from the left (the theme's tab skins,
the chosen one lighter, a baseline under them), 31 px rows (GFC's default control height),
16 px text, a box's children as wide as they need with the rest to those that expand (the
two columns of player options) or to the spacers (Language at the panel's foot), Restore
Defaults and Exit centred under the panel. Empty panels take no room. CyGTabCtrl's
setActiveTab/getActiveTab work, so a script can open a tab.

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

Before the player options were kept as choices, the options screen wrote
every player option it had shown, and it showed those the profile did not
have as off. Such a profile has Wait at End of Turn off (and advisor
pop-ups, Sid's tips) though the player never chose it; with Wait at End of
Turn off the game core ends each turn by itself once a unit has moved, so
turns seemed to end on their own.

The profile now has a version (2). One without it gets, once, the XML's
default for the options that are on by default and off there; every other
choice stays, and from then on off is the player's.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With Show Enemy Moves / Show Friendly Moves on, the game core gives a group
whose move ends where the player sees it a mission timer (4 game updates,
and one more a plot moved), tells the camera to look at it, and moves
nothing else of that player while it is busy: one group at a time, a stack
as one, the camera on each. The timer counts game updates, and the turn
worker ran the others' updates flat out for 100 ms at a time, so every
timer ran out at once and all units jumped together.

Now, while a non-human player whose turn it is has a busy unit, the worker
stops after that update and the next one runs a slice (250 ms) later; the
window stays live meanwhile and draws each step, the camera going to each
shown move. With nothing shown (the options off, moves out of sight) the
updates run flat out as before. The game itself is unchanged: the same
updates in the same order (the 100-turn checksums are equal).

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

Measured in the original under Wine: a game update every 0.26 s and a shown
move every 4 updates (about 1 s); OpenCiv4 ran the next move in the update
that ended the timer (0.75 s).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nstead of 1 s

The original has no such option (its Quick Moves speeds up only the
player's own units). With it on, the turn worker waits 150 ms between the
other civilizations' updates while one of their moves is shown, instead of
the original's 250 ms: a move every 0.6 s, the camera still on each. Off by
default, on the options' OpenCiv4 tab, kept in profile.ini as
quickEnemyMoves. The game is unchanged (checksums equal).

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 4/6, #148, 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 #148.

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