Repository navigation
Options: CivilizationIV.ini's settings on the OpenCiv4 tab (autosaves, tech splash, messages, field of view, frame cap) - #120
Closed
MortenLyhr wants to merge 10 commits into
Closed
MortenLyhr wants to merge 10 commits into
MortenLyhr wants to merge 10 commits into
Conversation
… 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>
No tech splash (NoTechSplash), no event messages on the screen (NoEventMessages), autosave every N turns and keep M (AutoSaveInterval 4, MaxAutoSaves 5: the original's names and folder, Saves\single\auto) or OpenCiv4's own autosaves, field of view (FIELD_OF_VIEW, 0: GlobalDefines.xml's), a frame cap (SetMaxFrameRate). Kept in profile.ini; number boxes take digits only and are kept as typed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…fore) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…reens have none) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rt getGameTurnYear) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 21, 2026
Contributor
Author
This was referenced Nov 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #87 (
fix/options-screen), which brings the OpenCiv4 tab and the option saving inprofile.ini: this branch holds its commits, so merge #87 first (or this merges both). The four commits from527cb5fto2d8e815are new.The original reads some settings only from
CivilizationIV.ini; its Options screen can't set them. OpenCiv4 has no such ini. This adds the ones that matter on a Mac to the Options screen's OpenCiv4 tab, under "From CivilizationIV.ini". Their defaults are the ini's, and they are kept inprofile.inilike the tab's other options.What it changes
NoTechSplashnoTechSplash()answers yes, so the game core shows no splash screen for a new tech.NoEventMessagesAutoSaveIntervalAutoSave_Initial_BC-4000, then every Nth turn's start asAutoSave_<year>(BC-3920), inSaves\single\auto, as seen in the original. (An AD year is written the same way,AD-1250; not seen.)MaxAutoSavesAutoSave_<year>is written, the oldest goes.AutoSave_Initial_…doesn't count and stays, as in the original.My Games\openciv4\Saves\auto, each game its own files, kept in turn, every 25th turn kept for good. With every 1 turn and keep 10 it is exactly the old behaviour.FIELD_OF_VIEWFIELD_OF_VIEW: set as each game starts, and at once when changed. BUG's slider on the map still changes it afterwards, as in the original.SetMaxFrameRateMapWindowwaits after presenting a frame until that frame's share of the second has passed.Behaviour change: by default, autosaves now follow the original (every 4 turns, 5 kept, in the original's folder with its names). Before, OpenCiv4 saved every turn into its own folder. The "OpenCiv4's autosaves" check box, with every 1 turn and keep 10, gives the old way back.
AutoSaves.h.oc4screensnow callseditTypedhooks after keys go into an edit box.The ini's other settings are already in game (Language, Full-screen Mode, Bandwidth, the No Sound boxes, voice). Some are covered by OpenCiv4's own options or command line (edge scrolling,
--mod,--seed,--turns,--log-dir). The rest don't apply (Direct3D, Bink, Pitboss, GameSpy, Windows input).How it was checked
ctestpasses: 16/16 (macOS, Release), with two new tests:ini_options(oc4options.pywith a stand-in host): the defaults reach the host, check boxes and typed numbers go intoprofile.iniat once and come back after a restart, letters are dropped, and an empty box is 0. The field of view replaces the XML's only once a game has started, and 0 brings the XML's back.auto_saves(AutoSaves.h): when an autosave is due, the original's names for BC and AD years, OpenCiv4's names, and which old autosaves are deleted (only the oldestAutoSave_<year>files: never the initial one or other saves).--turns 100 --map Fractal --size STANDARD --seed 7gives the same checksum as before on all 100 turns, ending atD7D43800.Saves/single/auto/AutoSave_Initial_BC-4000.CivBeyondSwordSave.AutoSaveInterval = 2,MaxAutoSaves = 3,Saves\single\autolisted at the start of each of 16 turns: a save at turns 2, 4, 6, … namedAutoSave_+ the year (AutoSave_BC-3920); from the 4th on, the oldest goes in the same turn;AutoSave_Initial_BC-4000is never counted or deleted. Listing:autosaves-listing.txt.Field of view 60, Wine | OpenCiv4:

Source of the autosave rule (re-checked 2026-11-22)
This PR first based the later autosaves on
stringsread fromCiv4BeyondSword.exe. That breaks CONTRIBUTING's rule, so the rule was watched instead in the running game under Wine (above). One part differed: OpenCiv4 counted the initial save among the kept ones and would have deleted it; the original keeps it. Commita864bdeffixes that and its test. Only BC years were seen, so the AD name is marked as our guess. Interval 0 = no autosaves is from the ini's own comment ("0 means no autosave").🤖 Generated with Claude Code