Advanced Civ

Advanced Civ 1.10

This update contains mostly just bugfixes, some significant but situational ones (listed below), and a bunch of very minor ones covered by the GitHub change history. Thanks to @keldath, @SantaFlagship and @Deaf Metal for helping me with some of those. The update is mostly from the summer and fall of 2023; I didn't touch the mod at all after that for a couple of months. I also haven't run all my usual smoke tests at the end this time; hoping for the best.
(A slightly slower DLL allowing up to 48 civs can be downloaded here.)
• When installing and running AdvCiv for the first time, i.e. when no AdvCiv\Settings folder was yet present under My Games, any changes on the BUG menu had been discarded upon exiting the game. Astoundingly, it appears that all BUG-based mods have this issue. Well, except mine now. Bug report
• Networked co-op games, i.e. with several human players on the same team, had been entirely unplayable since AdvCiv 1.0. Thanks to @keldath for diagnosing the problem and even providing a hotfix (now obsolete). Bug report 1 2
• When playing with Random Personalities, the intro diplo music had sometimes given away the true (secret) personalities. Bug report
• Alerts about cities that will become happy on the next turn had been one turn off when predicting the effect of hurry, conscription and defiance anger. This seems to be a bug in the original Civ4lerts mod component. (NB: AdvCiv disables those alerts by default.) Bug report
• The Financial Advisor tab now consistently excludes cities in disorder and labels a catch-all item that includes extra commerce from Bureaucracy more clearly. Related CFC post (1st paragraph; bug report in previous post)
• Tiny rule change: Vassal and master may help each other supress third-party revolts. [change id advc.184] Proposal (toward the end of the post)
(A slightly slower DLL allowing up to 48 civs can be downloaded here.)

This rather small update mainly fixes some issues with the mod's user interface:
• For some display dimensions, a few widgets had been placed awkwardly (since v1.06): the Globe view button, the help text area and the specialist buttons on the city screen. [change id: advc.092] Bug reports: 1 | 2 (toward the end)
• Seems that I've finally found a way to avoid lagging animations upon expansion of AdvCiv's fly-out scoreboard. [advc.085] Related post (last paragraph)
• Having cycled through all units causes queued unit orders ("auto-moves") to be executed as it did in BtS and K-Mod. AdvCiv 0.99 had broken this. [advc.154] Bug report
• Fixed display problems in cities with a corporation but no religion. I probably broke this in AdvCiv 1.06. [advc.092] Bug report
• When a player pillages one of their own tiles, holding down the Ctrl key will cause a tile improvement to be pillaged first instead of a (rail-)road – to accommodate players who pillage improvements as a way to steer their automated workers. [advc.111] Related post
• The revolt help text on the main map shows the total garrison strength of the currently selected units (if any). This should make it easier to decide how many units to keep in a rebellious city. [advc.101] Related post

AI enhancements:
• Fear of third-party interventions tweaked. On large, (very) overcrowded continents, the AI had been (far) too reluctant to go to war in the early game for fear of becoming vulnerable to a third party. Thanks to @spqkfk for making me aware of this problem – and of some smaller ones, also addressed by this update.
• When deciding whether to defy a global-civic vote, the AI evaluates the economic impact of the resulting anger. Previously (as in BtS), it was sometimes possible to ruin the economy of an AI civ by proposing a global civic over and over. [advc.118b] Related post (I agree that defiance anger shouldn't accumulate the way it does, but I didn't want to overhaul those game rules.)
• Fixed an issue with my AI logic for the Domination victory strategy: The AI had usually abandoned that strategy when getting close to victory. [advc.104c]
• Improved AI exploration path choices a bit, which will also benefit human units on Auto-Explore. [advc.pf] Related post

Game rule changes:
• The amount of culture that cities spread deep into foreign borders has been reduced. Specifically, if a foreign-owned tile is 3 or more tiles away (air distance, diagonals counting as 1.5) from the nearest tile owned by the city owner, the amount of culture that gets added is reduced; at a distance of 5 tiles or more, it gets reduced to 0. [advc.098] Related post (2nd paragraph)
• The number of citizens that a city can sacrifice through a single use of Slavery is no longer limited to 3. AdvCiv had introduced this hard limit, the BtS limit based on the city's total population still applies. [advc.064c]. Related post (6th quote box)
• The Start-points-as-Handicap option again allows start points to be assigned unequally (by entering two numbers into the Base Points box as explained in the manual). I had accidentally broken this a good while a go. [advc.250b] Bug report

Some minor misc. tweaks adopted from the "We the People" (@Nightinggale, @devolution) and "Close to Home" (@Charriu) mods: Git commits 1 2 3 4 5

Plus a fair number of minor tweaks not worth mentioning here, covered by the GitHub change history.
(A slightly slower DLL allowing up to 48 civs can be downloaded here.)

This update mainly addresses minor issues that I've encountered when playing along with @Jorunkun's Marathon game.

Barbarians: [change id advc.300]
Spoiler :
These changes mostly address problems described in this post of mine (a bit above the 2nd inner spoiler box).
• When deciding whether to place additional Barbarian units, the present number of Barbarian units tied down as city defenders is accurately subtracted (rather than subtracting the Barbarian city count times the number of initial free defenders).
• Slightly decreased the number of extra defenders that large Barbarian cities aim at keeping as a permanent garrison.
• AI civs may train some city attackers just for the purpose of conquering nearby Barbarian cities. This is mainly relevant for AI civs that haven't yet had a war plan against a rival civ.
• Slowed down the diffusion of Sailing to the Barbarians; this should delay the appearance of Barbarian Galleys a little bit. This is implemented through a new XML tag that can adjust the rate of diffusion to the Barbarians on a per-tech basis. [advc.301] Related post (2nd quote box)
• Effect of Raging Barbarians dialed down a little bit.
• Barbarian combat handicaps are shown when hovering over a Barbarian unit. This includes a city attack penalty that already exists in BtS but is difficult to notice because it only applies when Barbarians attack. [advc.313] Implemented just as I proposed in this post (2nd and 3rd paragraph).

UI:
Spoiler :

• Optional message upon meeting rivals to remind the player to set espionage weights. Can be enabled on the bottom of the Alerts tab of the BUG menu; disabled by default. [advc.120l] Related post
• Fixed problems with promotion glow and founding borders (around settlers) not being updated.
• Fixed Privateers refusing to attack directly from a city tile (bug introduced long ago, in v0.97b).
• Fixed fast human units pillaging twice when only ordered to do so once (bug introduced in v0.99). [advc.004c]
• Fixed a bug that had prevented on-screen messages triggered in between turns from being delayed until the human turn. The intention was, on the contrary, to delay all such messages when in Globe view. This is how it worked prior to v1.0 – and how it is working now. [advc.106]
• Messages about enemy attacks include the attacker's survival odds, e.g. "While defending, your Grenadier has destroyed a Sumerian Knight (attacker's odds: 39.5%)." [advc.084c]
• Citizen Automation assumes that pressing an emphasis button is intended to change the citizen assignment. Still doesn't guarantee such a change, but will try harder if the normal emphasis effect isn't strong enough to cause a re-assignment. [advc.131d] Related post (under "Citizen automation")
• Unit cycling no longer gets stuck when an order is issued to a group in which some units have moves left and others do not. [advc.001]
• Clicking the center tile on the city screen again enables citizen automation and has no effect if it's already enabled. AdvCiv 1.06 had, on mistaken assumptions, changed the behavior to toggling citizen automation. [advc.004t]

Game rule tweaks:
Spoiler :

• Decreased the land threshold for Domination victory by 7 percentage points. E.g. in a game wih 8 civs, the threshold is now 55% instead of 62%. Additionally, the victor's land percentage needs to be at least 25 points greater than the percentage of the second largest civ (same mechanism as for the population threshold). [advc.254]
• Decreased the impact of map crowdedness on distance maintenance for cities, i.e. the impact of the ratio of the initial civ count to the default civ count for the map's size and sea level. This tweak to change [advc.140] increases (compared with earlier versions of AdvCiv) the distance maintenance on undercrowded maps and decreases it on overcrowded maps. Related post (at the end)
• Decreased unit cost and supply on Marathon speed (in line with units being relatively cheap to train). Unit cost also gets slightly adjusted to map size – lower cost on larger maps, higher cost on smaller maps. [advc.252]
• Decreased the impact of the population ratio on espionage mission costs. The K-Mod formula had made the espionage points spent sometimes almost irrelevant for mission costs when one civ has far less population than the other. This tweak should reduce the frequency of spy attacks from small disgruntled civs, especially if the (large) target civs accumulate some espionage points (against whoever). [advc.120k] Related post 1 (under "Espionage") | 2 (in the middle)
• War no longer prevents revolts in cities under occupation. Instead, the culture strength of war enemies is halved (this essentially restores a BtS rule) and all foreign culture strength is halved under occupation. When both apply, culture strength is quartered. Previously, in AdvCiv, war had ruled out revolts, and occupation had halved the revolt probability. This did not actually make it easier to bring the probability all the way down to 0, whereas halving foreign culture strength means that half as much garrison strength is needed for 0 revolt risk. The result should be that revolts in quick succession will only affect cities that are substantially under-garrisoned and that a modest garrison will keep cities from revolting (or at least from ultimately flipping) while fighting a war. It's no longer possible to "freeze" newly conquered cities in a state of occupation by not providing a garrison. [advc.023] Related post (paragraph that starts with "Keeping Boudica alive", somewhere in the middle)
• Air Bomb missions can destroy Roads and downgrade Railroads to Roads in unimproved tiles (i.e. terrain improvements get destroyed before routes). Pillaging a Railroad also turns it into a Road rather than destroy it straight away. Players can air-bomb their own routes. [advc.255] Inspired by the Close to Home mod (Git commit)
• When playing with Random Personalities, favorite civics are based on the displayed leader head, not on the secret personality. This was easier for me to implement than fixing remaining issues with BUG's "Favorite Civic Detector" – and it makes more sense. [advc.130n]
• Ranks shown on the Demographics tab (Info screen) are based only on known civs – the rank numbers had given away too much information about unmet civs. [advc.077]

AI:
Spoiler :

• Fixed a bug that seems to have made the AI willing to be hired for war only when very close to beginning war preparations of its own accord. As far as I can tell, this has been broken since the initial release of AdvCiv.
• Fixed a bug that seems to have prevented religion hate ("heathen religion") from intensifying over time. This bug was introduced in AdvCiv 1.01. [advc.130n]
• Fixed a bug that had sometimes caused large AI stacks to bombard ungarrisoned cities (due to a numeric overflow). [advc.159] Bug report
• Fixed a bug that had sometimes caused the AI to assume no military build-up by civs with a very high production capacity (again, due to overflow). This had e.g. lead to the suicidal declarations of war described in this post (middle paragraph).
• Moderately decreased the rank hate ("you're getting ahead of us") between civs in the middle of the scoreboard. [advc.130c]
• The diplo penalty for capitulated vassals decreases over time. (Gradually decreases to 50% over the course of 75 turns on Normal speed.) [advc.130w]
• Decreased the AI food weight during the Industrial era, which should mean that the AI (including the governor assisting human cities) will be less interested in growing cities. In anticipation of health problems. (This is in addition to an earlier tweak that slowly de-prioritizes food over the course of the late game as there is less and less time for extra population to pay off.) [advc.110]
• The AI stops guarding its workers toward the late game. This is based on the production cost of the units involved; will e.g. guard a single worker with a Knight but not with a Cuirassier. (Those frequent AI moves are annoying for watching humans and accomplish little.) [advc.010]
• AI Scouts exploring the map try to avoid (visible) enemy units except for the very early game (when there are just Animals). Automated human Scouts and, after the very early game, Warriors also try to avoid enemy units. [advc.031d]
• The AI (somewhat) considers the effect of Hereditary Rule when deciding whether to cancel a deal that imports a luxury resource. This is specifically about the extra happiness from luxuries introduced by change [advc.912c]. This AI tweak should make situations in which the AI cancels a deal and immediately agrees to a new deal with the same conditions (even) less common.

Map generation: [change id advc.129e]
Spoiler :

• Lakes can no longer replace Peaks.
• Fixed a bug (overflow) that had made maps with more than ca. 20000 land tiles impossible to generate. (Huge maps normally have only about 10000 tiles in total.) This problem was introduced by AdvCiv 1.07. Bug report

Performance: More efficient update of trade networks ("plot groups"), decreasing turn times by 10% in a test. [advc.pf]

Plus a fair number of minor tweaks not worth mentioning here, covered by the GitHub change history.
Some changes in preparation for a community game on Marathon speed (discussed in this and subsequent posts).

(A slightly slower DLL allowing up to 48 civs can be downloaded here.)

Game speed: [change id advc.252] (related post - starting at "Regarding Marathon")
• Marathon games now take up to 1250 turns instead of 1500. Reduced all 300% Marathon modifiers, most of them to 250%. This means that e.g. building production costs on Marathon are now only 25% higher than unit production costs (50% higher in BtS).
• The Barbarian creation rate on Marathon speed is 2.25 times slower than on Normal speed. This corresponds to the mean of the tech cost and unit production modifier. In earlier versions of AdvCiv, it had been 3 times slower, corresponding to the old tech cost modifier. (BtS had no speed adjustment at all.) [advc.300]
• The AI trains more units in Marathon games. This adjustment is based on a diluted ratio of tech cost modifier to unit production modifier; i.e. the AI is supposed to take advantage of units being relatively cheap. With the tech cost modifier at only 250%, this isn't a drastic change, but the effect should be noticeable. [advc.253]
• Most AI contact rolls (for offers, requests and demands to humans and to other AI civs) are slightly adjusted to game speed, i.e. slightly less frequent on slower settings. [advc.130r]
Random events are speed-adjusted, i.e. have a (somewhat) lower per-turn probability on slower game speed settings, slightly higher on Quick speed. Inspired by Civ 4 Reimagined.
• The chance of lowering the occupation timer in conquered or rebellious cities is no longer affected by game speed. By accident, the timer was likelier to decrease on slower settings. (Revolt chance, as before, is moderately speed-adjusted, i.e. lower per-turn chance on slower speed.) [advc.023]
• Added a total of 8 new modifiers to Civ4GameSpeedInfos.xml for easier customization, affecting rules and AI behavior that had not been speed-adjusted previously or had been tied to unrelated modifiers.
Culture level thresholds on Marathon are only twice as high as on Normal speed, except for the Legendary threshold, which is 2.25 times as high, i.e. almost fully adjusted to game speed. This should make the wait for border expansion less annoying and compensate a bit for the relatively high building production costs. [advc.251]
• The victory countdown after launching the Spaceship is no longer fully adjusted to game speed, e.g. only 20 turns now on Marathon when Thrusters and Engines are maxed out.

Barbarians: (related post - under "Barbarians")
• Tweaks to the (randomized) choice of the spawned unit type: [advc.301]
- Warriors stop appearing already when the Barbarians reach the Classical era, i.e. (normally) once Swordsmen become available. And there may have been a bug causing Spearmen to stop appearing already in the Classical era - the Copper-based units should get placed until the Barbarians reach the Medieval era.​
- Somewhat higher chance of Archers being placed, lower chance of metal-based units.​
• Tweaks to per-tile memory about recently placed Barbarians (which discourages further Barbarian placement in the vicinity): [advc.304]
- Decay of the memory is speed-adjusted, i.e. discouragement will be more lasting on slower game speed settings.​
- Also affects placement aboard Galleys now.​
• Tweaked the probability of Barbarians being placed aboard Galleys in situations when multiple Galleys in the fog of war are ready to receive cargo. The aim of these changes is to rein in the threat of seaborn(e) Barbarians on maps with long coastlines. [advc.306]
• Decreased the chance of Barbarian cities producing defenders once they're fully garrisoned. [advc.300]
• Can no longer obtain Great General points from Animals. (This had been unintended.) [advc.312]

PerfectMongoose map script: [advc.021b] (related post - after the 3rd quote box)
• Lakes with inflow from a river no longer have a minimum size of 3 tiles.
• PerfectWorld2-style island chains restored for big maps. I had previously dialed down the respective parameter ("ripple amplitude") because it seemed to contribute to the thin landmass shapes, but that's not much of an issue for larger map sizes, so that parameter is now set based on the map size. This change - and the next one - only affect the "Plate Tectonics" land generator.
• Reduced likelihood of continents being placed at the western and eastern edges of the map - to make continents that cross the edges of the minimap less likely.

Misc.:
• Lakes are less likely to be placed on Desert by Fractal and by all other scripts that don't override Lake placement. [advc.129e]
• Bugfix: Unit upgrade buttons had not been grayed out when gold insufficient. Introduced by v1.06. [advc.004k] Bug report
• Bugfix: The Demographics tab had shown garbled numbers on turn 0, since v0.97b. [advc.077]
• Made large AI stacks less willing to pillage roads and marginal improvements when a city is too strongly defended. The AI should now sooner retreat (possibly to return in greater numbers). [advc.083]

Full change history (GitHub)
(A slightly slower DLL allowing up to 48 civs can be downloaded here.)

Apart from a fair number of bugfixes, this update mainly increases the size of - and distance between - various widgets (panels, buttons) of the game's HUD, i.e. on the main screen and city screen. The size adjustment is based on the (window or full-screen) resolution and can be disabled on the General tab of the BUG menu. [change id advc.092]

Crucially, in my book, the size of the balloon (or "bubble") icons for resources, units and event messages now scales sensibly with the resolution and the camera's field of view. The size can be tweaked on the Map tab of the BUG menu. [advc.092b]
This particular change is somewhat experimental. It might cause problems (but I'm aware of none thus far) with certain editions of the game or on certain operating systems; if so, the size will be just as in BtS or the mod might crash upon displaying the main map. There could also be trouble with virus scanners. Ideally, such problems should be reproduced with the minimod in this thread and be reported there if appropriate.

The other HUD changes are also error-prone, but I expect that most bugs have been fixed during the beta phase of this update; thanks to @keldath, @SantaFlagship, @Jorunkun, @xyx, @UltravioletCatastrophe, @giorgio1234 for reporting those and other bugs.

Some other UI tweaks:
Spoiler :
• The building list on the city screen now shows icons in addition to the building names (like in the BAT mod). This can be disabled on the City Screen tab of the BUG menu. Names of obsolete buildings are grayed out in the list. [advc.097]
• Cleaner layout for the resource list on the city screen. [advc.092] Related discussion
• Changes to the order of unit command buttons. Promotion and upgrade buttons are placed in a separate row if the screen is wide enough to fit all buttons in two rows that way. "Delete" and some other rarely used buttons are placed toward the right end of the first row. [advc.004k] Related posts 1 (under "Unit command buttons") | 2 (2nd quote box) | 3 (2nd paragraph)
• Sea Patrol can only be used when there is actually an adjacent improvement to guard. Since this change causes the Sea Patrol button to be hidden most of the time, the BUG option for disabling Sea Patrol has been removed. When a unit on Sea Patrol is selected, the guarded tiles are highlighted in blue on the map. And the AI now sometimes uses Sea Patrol to guard a resource from an adjacent tile rather than stitting on top of it. [advc.004k]
• Optional threshold for letting the Show Friendly Moves option ignore moves of small stacks or individual units. On the Map tab of the BUG menu. [advc.102b] Related post
• Increased font size on the Domestic Advisor screen (both the BtS and the Customizable version) when there is significantly more horizontal space available than needed. (Ca. 1400 pixels screen width or greater.) On the Customizable screen, the column widths are also increased to match the available space; for the BtS screen, that had already been the case. [advc.193] Related post
• Fixed mispositioned headings on the Civics screen. (This issue had been introduced in v0.99.) Bug report
• Fixed slightly mispositioned icons on the (tabular) scoreboard. [advc.002b] Bug report
• Increased camera scroll speed (arrow keys or cursor at edge of screen). [advc.004m] Related post
• Clicking on the city tile while the city screen is up toggles citizen automation rather than only enable it. [advc.004t]
• Units with available moves are preferred as the "center unit" of a tile, i.e. the unit that gets shown on the main map and gets selected when the tile is clicked. This change partly reverts an earlier K-Mod/ AdvCiv change. Now works as in BtS again except that remaining moves are disregarded during AI turns in AdvCiv. [advc.001] Related post
• The mod's name is written into replay files, meaning that the BtS Hall Of Fame (HoF) screen will no longer list replays created by AdvCiv. There is an option on the System tab of the BUG menu for restoring the behavior from previous versions of AdvCiv, i.e. to omit the mod name so that the BtS HoF will list AdvCiv replays. I've come to think that players may find it intrusive that AdvCiv sneaks its replays into the BtS HoF by default. [advc.106i]

Map generation:
Spoiler :
• Changed the aspect ratios of the map grids of the widely used map scripts to be closer to 7:5 than to 8:5. [advc.137] (Given the linear distribution of the generated latitude values, square dimensions would really make the most sense to me, but that goes too much against the intuitive notion of world maps being oblong.)
• Land Ice ("snow") should no longer occur outside of the Polar Circles on most maps. [advc.tsl]
• Increased the "grain" value for Huge maps – so that hills and forests don't clump together as much. [advc.129]
• The Tectonics map script places fewer hills and peaks (but typically still more than the standard map scripts). And fixed an old AdvCiv bug that may have caused Tectonics to generate too few rivers. [advc.021a]
• Balanced Resources option: Made the tiles where strategic resources get placed less predictable; Marble no longer affected by the option; avoids placing Oil on water. (For the record, I still don't like this option. It only deals with the placement of strategic resources, which is not among the chief sources of unfairness imo.) [advc.108c]
• Regenerating the map should no longer result in graphical glitches on terrain surfaces (dark lakes, shadows on hills, fragmented Flood Plains). [advc.001] Related post
• Regenerating the map in a True Starts game no longer results in additional starting techs. [advc.tsl] Bug report

Misc. bugfixes:
Spoiler :
• Crash to desktop, sometimes, when a vassal breaks free from a human master. [advc.062] This error had been in the mod since v0.97b. Bug reports 1 | 2 (last paragraph)
• The game-end sequence hadn't been triggered upon defeat of the (last) human player (since v1.00). Bug report
• The mod had been auto-saving twice at game start (silently, the second save overwriting the first) since v0.97b. [advc.106l]
• The AI had not been buying terrain improvements in Advanced Start since v0.97b.
• BBAI bug that had caused coastal AI cities to (sometimes) produce transports while preparing war against a land target that the city owner did not have Open Borders with. [advc.001] Thanks to @spqkfk (AdvCiv Plus mod) for making me aware.
• The AI relations boost for favorite civics had been one lower than intended since v1.01. This had also caused occasional Python crashes in BUG code for detecting favorite civics when playing with Random Personalities. [advc.130n] Bug report
• Rank hate ("You're getting ahead of us") had turned into rank love when an AI civ was far behind. Introduced in v1.05. [advc.130c] Bug report
• Game text for the past-event relations modifier (caused by random events) had been mixed up since v0.99. Bug report - see the link above.

Misc. rules and AI changes:
• Can't nuke cities with 10% or greater friendly nationality nor cities culturally owned by a neutral party. [kekm.7] Related post
• Reduced research cost of Calendar by 1/7. [advc.174]
• Gandhi made (even) less willing to start a war when his attitude is more favorable than Annoyed. [advc.005a]
• Injured Animals are less likely to attack. May (randomly) continue to patrol rather than heal. [advc.309]

And some changes to (re-)align tech progress with the game year: [advc.910]
• Very slightly increased tech costs for Medieval and later techs, moderately increased the costs of a few conspicuously cheap techs, namely Literature, Drama, Feudalism, Banking, and slightly increased (by less than 10%) the cost of Paper, Liberalism, Biology, Mass Media and Advanced Flight.
• Revised the years-per-turn progression so that 1950 is reached after a considerably smaller number of turns than in BtS and AD 1 a little later.

For developers:
I've uploaded the Visual C++ toolkit and Platform SDK that AdvCiv is compiled with here on GitHub. They're originally from the Caveman2Cosmos subforum. @keldath made me aware that the packages recommended by the CFC guides for compiling the DLL cause some linker warnings when used with AdvCiv. The uploaded versions should also work for any other mods. They should not require a particular version of Visual Studio to be installed, but I haven't been able to test that.

This omits very minor changes. The full change history can be viewed on GitHub. This view separately shows some minor misc. changes adopted from @lfgr's MNAI-U mod.
  • Like
Reactions: devolution
(A slightly slower DLL allowing up to 48 civs can be downloaded here.)

• New game option "True Starts" that chooses a civ based on the geography of the starting location for every player whose civ was set to "Random" during game setup. See the manual for specifics, or also this thread, where I've uploaded some screenshots.

• Barbarians: Several tweaks, mainly to the timing of land unit spawns. Should result in more pressure in the early game, especially around the time that players found their second and third city – though not quite as much as in BtS, at least not on the higher difficulty levels. [change id advc.300]
Spoiler :
- The aggressiveness of Barbarian units increases more gradually, i.e. they don't all at once switch from patrolling unowned tiles to seeking out cities to forming stacks; instead the behavior is randomized on a per-unit basis. Which also means that (sporadic) aggressive behavior can now be encountered a bit earlier in the game.
- Slightly increased the (base) target for the number of Barbarians to be placed overall.
- Barbarians start appearing slightly earlier overall, and especially on slower game speed settings or when playing with the No Animals option.
- Decreased the number of Animals to be placed (mainly) on the high difficulty levels. [advc.309]
- Decreased the attack probability of animals to 70% on Noble and above (was 85% on Noble and 90% above Noble). This should make them feel a bit more animal-like without affecting gameplay too much. [advc.309]
- Looks like an old AdvCiv change had reduced the chances of producing military units in Barbarian cities when the Barbarians owned exactly one city. Fixed. [advc.109]
- Barbarian cities can never trade along unowned river, coast and ocean tiles. Because it's unexpected when a Barbarian city gets access to a strategic resource that way. Related post (2nd quote box)
The Great Wall no longer requires Archery. To match the changes to Barbarians in this and the last few updates; need to make this wonder easier to access. [advc.310]

• Some tweaks to Tribal Villages: [advc.314]
Spoiler :
- Reduced the gold and research to be gained, and made extreme outcomes a bit less likely. These changes reinforce earlier changes to the same effect.
- Hostile Villagers can occur slightly closer to cities, but all cities count now, not just those of the player who enters the Tribal Village. When multiple Hostile Villagers appear, only one of them will attack right away. (Technically, they all won't attack any injured units right after appearing.) To make this outcome less punishing.
- Decreased the size of the Tribal Village 3D model. Still bigger than in BtS, and still easy to spot I think.
- Fixed a BtS issue with outdated graphics (notably Tribal Villages) being shown briefly upon revealing a tile. This had occurred only after having temporarily revealed the entire map through WorldBuilder (or Debug mode). So it wasn't much of a problem, but I still thought I'd mention it in case that someone else has ever run into this and wondered about it. [advc.001]

• Other rule changes:
Spoiler :
- Granary stores 50% food again, but Slavery yields only 24 production per population sacrificed (instead of 30). [advc.912d] Inspired by this post. I've increasingly gotten the impression that Granary, on its own, is far from being overpowered. I haven't reduced the Slavery yield as much as proposed in the linked post because AdvCiv already weakens Slavery in several subtle ways, in particular through less abundant food at starting sites.
- Workers can again be captured – however, not on the same turn as declaring war, and there's always a 50% chance of destroying the enemy worker (or settler) without gaining a captured worker. On top of that, the AI may (probabilistically) delete workers trapped in a city that is about to be conquered. [advc.010] Related discussion (3rd quote box)
- Once a civ discovers Nationalism, its cities no longer "demand military protection." Doesn't affect AI behavior, but human players can then feel free to delete any ancient units that they've kept around just for preventing anger in undefended cities. [advc.500c] Related post (last paragraph)
- The Vassalage civic reduces colony maintenance to 0. [advc.912g] @Leoreth's idea (though he had proposed it for Mercantilism)

• Minor changes to the map generator and to starting sites:
Spoiler :
- Slightly stricter latitude limit for Spice (45° instead of 60°). (In reality, the highly valuable spices only grow in the tropics, i.e. below 30°.)
- Adopted a tweak to the placement of starting sites from Kek-Mod. Not terribly relevant because AdvCiv normally uses the BtS starting locations only as an initial solution for its own algorithm, but, anyway, this brings AdvCiv up to date with the latest Kek-Mod release (0.26 - apart from changes to PitBoss games). [kekm.35]

• Misc. bugfixes:
Spoiler :
- In the AI evaluation of tech paths (which sequence of techs to research next), the AI had, after narrowing down the search to a few decent paths, chosen the worst rather than the best candidate. This bug had been introduced in AdvCiv 0.99. Also fixed a similar but less consequential K-Mod bug. [advc.550g]
- AI tribute demands and pleas for help had not resulted in a peace treaty. This bug was introduced in v1.00.
- Amended an old AdvCiv AI tweak that was supposed to make the AI prefer Plantations over Forts on workable tiles. Hadn't been counting the Plantation yields correctly, should finally work now. [advc.121]
- Out-of-sync error introduced in v1.03, and likely another that has been in the mod for much longer. Not sure how frequently these bugs had disrupted network games on average, maybe about once every 50 turns in games with a many AI civs.
- Had been impossible to buy improvements in Advanced Start. This bug has existed at least since v0.97.
- Potential early-game crash with the Legacy (Aggressive) AI option, introduced in v0.99. [advc.004s]
- Fixed a BtS leak of map knowledge through settler action recommendations. [advc.181] Related post (2nd paragraph)

• AI:
Spoiler :
- Encourage land explorers to stay closer to cities. Because early far-flung exploration isn't usually smart, and I don't want humans to meet all AI civs already in the Ancient era. [advc.031d]
- Tweaks that make city-attack stacks less patient and less risk averse when weighing their odds against city garrisons. [advc.114c] May now bombard and attack on the same turn. [advc.004c]
- UWAI component: War utility gets increased when there hasn't been any warfare for a long time, in particular around turn 100 on Normal game speed, and decreased when there are many wars ongoing. This is purely to shape the dramatic arc of the game.
- Smoothened the rank-based diplo modifier ("you're getting ahead of us") by taking into account game score in addition to rank. To make the modifier less volatile when ranks change back and forth. [advc.130c]
- The three early religions are founded in a more rational way (taking into account the need for happiness and for expanding borders). This results in Hinduism and Buddhism getting founded around the time that the AI founds a second city, which, on average, is similar to the K-Mod behavior. (K-Mod was already founding religions a good deal later than BtS.) The early religions are prioritized more highly once one or two of them are taken. As for the later religions, the AI tries harder to avoid founding a religion that happens to lie on the path to its favorite religion. [advc.171]
- Negative weight for Sailing (stop-gap measure until someone figures out why exactly the AI values that tech too highly). [advc.131b]
- Slight negative weight for Bureaucracy - so that not every AI civ uses it virtually all the time. [advc.131b]
- Workable land tiles discourage Lighthouse and the Moai Statues. So that the AI doesn't put the Moais in cities that may as well work land tiles as they grow. [advc.131]

• UI:
Spoiler :
- Option for disabling city soundscapes added to the BUG menu ("City Screen" tab). [advc.002q] Related post
- While selecting a tile to nuke, all 9 affected tiles are highlighted, not just the target tile. [advc.563]
- "Snow" terrain renamed back to "Ice". It was nice to have distinct names for land ice and sea ice, but "snow" sounds too much like a weather report after all. [advc.004g]
- Sevopedia shows strategy help ("Sid's Tips") for technologies. That text also mentions K-Mod and AdvCiv rule changes. [advc.004y]

And quite a number of smaller changes not worth mentioning here; full Git commit history: GitHub
This is a larger update than I had been planning on, but my intention remains to cease active development apart from minor tweaks and maintenance.
  • Like
Reactions: gi@c and Major Tom
48-civ DLL (for those who need it)

AI:
• About a dozen small tweaks to the UWAI (war planning) component, aimed at either making the AI less willing to start wars in the late game or more willing to start wars in the early game (first millennium BC).
• Decreased dimensions of Pangaea a little bit (after having increased them in v1.00). This seems to make quite a difference with respect to early wars started by the AI. [change id advc.165]
• The AI will no longer adopt the final stages of the "Space" victory strategy just based on technological progress; some spaceship parts need to be produced first. [advc.115]
• Made the "traded fair and forthright" diplo modifier a little easier to get. [advc.130p]
• Fighting Barbarians now only contributes to the "mutual struggle" diplo modifier when the Barbarians are fought within the territory of another civ (as had been my intention all along). [advc.130m]

Misc.:
• Fixed a crash upon selecting a Creative leader on the Play Now screen. This bug was introduced in v1.00. [advc.908b] Bug report
• Wars started and ended by vassal civs are no longer announced in separate main screen messages; instead, a single message lists all war parties. [advc.106o]
• The chance of Global Warming events gets adjusted to the initial number of civs on the map. For example, in a game with 18 civs, the chance is now 1.3 times greater than in a game with 8 civs. I've been getting the impression that Global Warming tends to be less severe in large games, and I'm guessing that this is because a larger portion of the world doesn't fully industrialize when there is a higher number of factions. [advc.055]
• PerfectMongoose: The "Plate Tectonics" map option generates somewhat bulkier continents sometimes (randomized). And PerfectMongoose now makes a greater effort to center the map so that no continents cross the margins. Both of these tweaks are inspired by the Totestra script (a different fork of PerfectWorld). [advc.021b]
• "Starts Points as Handicap" option: Fixed some potential or actual issues with uneven distributions of start points. [advc.250b]

Complete change history: GitHub
  • Like
Reactions: cobbaut
This update should rein in questionable AI warfare in (especially) the late game. (Improved AI war planning being the biggest feature of this mod, it's important to me to have it working somewhat as intended; hence the frequent minor updates as of late.)

48-civ DLL (for those who need it)

AI war planning (UWAI component), tactics:
• Fixed a bug (introduced in v1.00) that had caused the AI to greatly overvalue the utility of an anticipated capitulation. The prospect of gaining a vassal is indeed a good reason for starting or continuing a war, so this bug was often inconsequential; however, sometimes it had outweighed important reasons against a war.
• Fixed a bias in the AI predictions about the course of wars between multiple civs. The AI had often overestimated the distraction posed by militarily weak war parties.
• Made the AI more reluctant to unfairly gang up on a civ by fixing a likely bug introduced in v0.90 or so.
• Added AI code for anticipating military interventions by hostile third parties. This should make the AI less carefree about exposing itself to disastrous two-front wars. That said, the AI still isn't really careful about this.
• Made AI leaders with a peaceful personality much less willing to start wars aimed at cinching a game in which they're already doing very well.
• The AI will no longer plan war against a faraway member of a Defensive Pact when it can instead plan war against a member whose territory is much easier to reach. This matters because the AI will only declare war by crossing into the territory of the war target (or its teammates or vassals).
• Reduced the target size for AI city attack stacks on small continents where neither the AI nor its war enemies have their capitals. Because such colonies tend to be lightly defended. Also reduced the overall target size for city attack stacks a little bit. [change id advc.104p]

Tweaks to city trades, liberation: [change id advc.ctr]
• Fixed a bug (introduced in AdvCiv 0.97) that had caused the AI to liberate a colony whenever a hostile city existed on the same continent.
• The AI doesn't liberate cities (for free) when that will likely hurt cultural control over nearby cities.
• Cities ceded in trade at peacetime are now announced as "traded" rather than "ceded" to make clearer that the city hasn't been given away for free.

A couple of tweaks to Global Warming (GW): [advc.055]
• Further decreased the probability of GW events (beyond the tweak in v0.99).
• Made the GW "severity rating" slightly more sensitive. Apart from being shown prominently on the Environment tab (Economics Advisor), the rating also affects city anger from GW. I.e. GW makes citizens slightly more angry now.
• Slightly decreased Modern-era tech costs (they're still quite a bit higher than in BtS). This is when most of the GW events happen. [advc.910]

Fixed a rare K-Mod issue that had made the AI unable to choose a tech when Scientific Method had a negative tech utility value. [advc.001]

And adopted fixes for two rare BtS bugs from Kek-Mod; see this post by DarkLunaPhantom for details. [kekm.39]

For the complete change history since v1.02, see GitHub.
48-civ DLL (for those who need it)

Fixed a couple of bugs in the AI evaluation of war plans that were introduced in v1.00 (through my overhaul of the UWAI component). These bugs had made the AI too reluctant to start wars overall. Especially diplomatic penalties had been greatly overestimated, including the "you declared war on us" penalty when the target was useful as a trade partner. Another fixed bug had been in the mod since the beginning and had caused militarily powerful AI civs to overestimate the opportunity cost of further military build-up. This last bugfix seems to worsen problems with reckless AI wars in the late game that had already existed prior to v1.00. I'm still including the bugfix in this update because it'll be helpful for the early game and midgame. I'll try to improve the late-game behavior in the next update (by making the AI wary of possible third-party interventions).

Further AI changes:
• Made some tweaks to make AI cities prioritize war preparations more. Imminent war (enough units available), successful ongoing war and preparations (more units needed) had pretty much been treated the same way; now preparations have a somewhat stronger impact. Not a major change I think. [change ids advc.104s, advc.017, advc.131]
• Dialed down an old AdvCiv change that causes the AI to throttle its military production when being already more powerful than every potential enemy. The original change may have hampered military AI victory strategies too much. [change advc.017]
• The AI should now use the Spread Culture mission sometimes in sensible ways. I think only previously owned cities had been targeted before (possible K-Mod bug). [advc.120] Related post
• Increased the (expected) delay between consecutive AI proposals for Open Borders agreements by 10 turns. This only affects AI-to-human diplomacy. Should make unwanted Open Borders proposals a little less annoying. [advc.124] Related post (I haven't implemented the exponential backoff algorithm mentioned in that post)
• The AI may further reduce the trade value of techs that it doesn't have much of an immediate use for. And, during the early game, the AI is less lenient in tech trades with (technologically or militarily) weak civs than before. Both of these changes (which are tweaks to earlier AdvCiv changes) are intended to make bee-lining to unpopular techs like Aesthetics or Compass less rewarding for human players on the highest difficulty levels. Should e.g. no longer be possible to trade Aesthetics one-for-one for Alphabet or Mathematics – unless the recipient is actually keen on Aesthetics. [advc.550g, advc.550a]

Further bugfixes:
• Fixed an AdvCiv bug that had prevented Global Warming events from destroying improvements (mainly Farms and Cottages on tiles that have become Desert). [kekm.9]
• Fixed a rare crash to desktop that had occurred when the AI was considering to nuke a city or (sizable) stack and was unable to hit it without also hitting a friendly unit. This bug was introduced in v1.00. [advc.650]
Recommended city sites no longer give away cities in the fog of war (and the AI no longer cheats when it comes to city placement and tile ownership in the fog of war). Note that this change does not affect tiles that had never been revealed; those were already being treated correctly by the AI. [advc.001]

Minor balance changes:
• Slightly increase tech costs on Monarch, Emperor and Immortal difficulty, especially for midgame tech. And also a little bit on Prince and Deity. Because tech dates were getting well ahead of the real time line in my tests. [advc.910, advc.251]
Mercantilism allows trade routes between vassals of the same master. Mainly because this simplifies the help text: "no trade routes with rivals." [advc.124]

For the full change history, see GitHub.
This update fixes a couple of rather minor bugs and reduces the impact of ideology (religion, civics) on AI attitude. This
post sums of the rationale:
"Without a shared religion, the AI had always been too difficult to befriend" you say in the [v1.00] patch notes, [...] but with a shared religion, it's the opposite.
Plus some other tweaks, some of which are also inspired by that same post by @AllTheLand.

A 48-civ DLL is available here. A list of files modified by this update along with the Git commit history can be found here.

City maintenance
• Reduced the city maintenance modifiers of Ikhanda and Rathaus by 5 percentage points each. [change id: advc.exp.2] Related post (last spoiler box)
• Reduced the cap for the number of cities counted for number-of-cities maintenance. On Huge maps (where the cap tends to matter the most), it's now 25, was previously 42. [advc.exp.1] Related posts: 1 (spoiler box at the end) | 2 (penultimate spoiler box)

Revolts and religion
• Increased the impact of the cultural owner's techs on the revolt chance. Revolts in conquered cities will still become less of a concern over the course of a game, but should no longer be effortless to suppress once the conqueror has Riflemen (unless the cultural owner is far behind in tech). I've also adjusted the impact of high foreign culture in tiles surrounding a city – in a way that should make it easier to flip cities engulfed by foreign culture. [advc.101] Related post (last spoiler box)
• Reduced (further) the impact of city and state religion on the revolt chance from +/-50% to +/-33%. (Had been +100%/-50% in BtS.) [advc.101]
• Fixed Apostolic Palace (AP) members sometimes being treated as having defied a resolution (bug introduced by v1.00).
• Fixed a rare crash upon the AP being completed for a religion that is present in a Barbarian city (bug introduced by v1.00).
• The AP grants only 1 production to religious buildings, costs 350 production (instead of 400) and allows 2 Priest specialists (instead of 0). The Shrines also allow 2 Priest specialists each (instead of 3). [advc.179] Related post (2nd spoiler box)
• The failure chance of Missionaries is no longer based on the population size of the target city. (K-Mod had made Missionaries slightly more likely to fail in smaller cities.) [advc.173] Related post (spoiler box within the 1st spoiler box)

AI attitude
• Reduced the maximal relations modifier for sharing a religion or favorite civic by 1 for about half of the AI leaders. More specifically, I've reduced the time-based religion modifier for all leaders with an upper limit of 5 or greater and for about half of those with an upper limit of 4. And I've reduced the time-based civic modifier by 1 for almost all leaders with an upper limit of 4 or greater. Note that these limits do not include the +1 modifier (+2 with the Holy City) that all leaders apply immediately, i.e. regardless of how long ago a religion or civic has been adopted. [advc.148] Related post (1st spoiler box)
• Again revised the method by which ideological relations modifiers are reduced when an ideology is widely followed (or, in the case of the different-religion penalty, also: when the offending religion has very few adherents). The reduction is now based on the portion of known cities whose owner follows the ideology in question (i.e. city religions don't matter, only the state religion of the owner does). This change gives civs with few (known) cities less impact on global diplomacy. [advc.130n] Related post (1st spoiler box)
• To become a worst enemy at peacetime, the relations value needs to be -3 or worse, i.e. Annoyed attitude (-2 or worse) isn't necessarily low enough. [advc.148]
• Increased the relations penalty from "ruthless expansionism" slightly (by about 10%). [advc.130w] Related post (1st spoiler box)

Misc.
• Made the AI much more reluctant to liberate cities to vassals. Looks like I forgot to implement even a basic safeguard against letting capitulated vassals break free when I wrote the AI code for peacetime city trades. [advc.ctr]
• Fix the Foreign Advisor screen (Info tab) causing the fly-out scoreboard to be expanded. [advc.085]
48-civ DLL (for those who need it)

This is intended to be the last major update. It weakens the Philosophical and Creative trait as well as some early unique units, makes the AI easier to befriend, tweaks Barbarian placement, culture rates of buildings, the nuke damage formula and nuke AI behavior and adds enhanced city bar hover text as in the BULL mod. The specifics – and many less significant changes – are described below. It's not all terribly elegant; I guess there's a reason I've been kicking some of those cans down the road. Very minor changes are only covered by the Git commit history starting on 27 Mar (a few of the changes from spring were already included in v0.99b though).

Upfront, one rather major bugfix: Since v0.99, most espionage missions had been free, i.e. didn't deduce any espionage points upon being executed. Bug report

Misc. balance changes:
Spoiler :
• Reduce the GP birth rate modifier from Philosophical trait to 80% (from 100%). E.g. a city with a base birth rate of 11 will now gain 8 GP points (11 * 80 / 100 rounded down) – 19 in total – instead of another 11, i.e. 22 in total. [change id advc.908c]
• Production cost of Aqueduct, Baray – but not Hammam – reduced to 90 (from 100). Just a common-sense balance change to make this iconic building less underpowered, and also to match a cost decrease for Grocer in AdvCiv 0.99. [advc.911c]
• Weaken early unique units (note that Praetorian, a.k.a. Legionary, and Quechua have already gotten this treatment in earlier updates):
- Fast Worker has only 2 moves, ignores terrain movement costs. This is a big nerf, but ought to be closer to the proper power level than 3 moves. [advc.907c]
- Skirmisher only has 1 first strike chance, i.e. loses its guaranteed first strike. [advc.907d]
- War Chariot is not immune to first strikes. [advc.907e]
- Immortal is immune to first strikes, but has only +25% combat against Achery units, not +50%. [advc.907e]​
• Streamlined the K-Mod buff of Panzer: 2 guaranteed first strikes instead of 1 plus 1 first strike chance, and no free Flanking promotion. [advc.909b]
• When the commerce sliders result in a rounding error, the lost commerce gets added to the commerce rates that contribute most to the total rounding error. This change removes one incentive for using binary research in the early game (but other strong incentives remain). [advc.157]
• Research cost of Divine Right decreased to 700 (from 1200). I don't think this will turn Divine Right into an attractive tech, but it's a low-key change, and at least it'll make things more fair for AI leaders with favorite religion Islam. Related post (2nd paragraph) [advc.174]
• Tweaks to religion spread from Holy Cities: vaguely related post (2nd quote box)
- Spread probability increased in order to even out an earlier change to the calculation of the spread distance factor. I think that change has slowed down religion spread a bit overall and that hadn't been my intention. [advc.140]
- For civs that still have 0 cities with the Holy City religion, the spread probability gets adjusted based on the civ's city count. This should make the chance of a religion becoming available to a civ less dependent on its city count. (A separate spread dice roll is made for each city, so civs that have expanded fast generally have a much higher chance overall.) [advc.173]​
City defense modifiers don't apply when the city owner is a neutral third party. (Rationale: The neutral city is not being attacked.) [advc.183]
• The Internet project counts civs with a particular tech, not teams. Based on a Kek-Mod change. [kekm.38]

Culture tweaks:
Spoiler :
• The Creative trait provides only +1 culture, not +2. Cities of Creative leaders (including conquered cities once occupation ends) start at culture level Fledgling, i.e. with 10 free initial culture. Rationale: Culture is more powerful in the mod, and Creative is already a strong trait in BtS. Just halving the culture rate would weaken the trait too much however (considering also that the discount for Colosseum was already removed by update 0.99), so the free initial culture is intended as a middle ground. [advc.908b]
• The Incan Terrace also provides only +1 culture. (Don't want it to be more effective than the Creative trait.) [advc.908b]
• City culture from Great Works ("culture bomb") starts at 700 in the Ancient era and increases by 700 with each subsequent era. It had started at 0 in K-Mod, increasing then by 800 per era. While an Ancient Great Artist is impossible to obtain in K-Mod/ AdvCiv, starting at 0 is problematic for mod-mods, and the new progression also better accommodates Culture victory strategies that stop teching at the onset of the Industrial era. [advc.251]
• Reverted the K-Mod changes to Cathedrals, i.e. they have +50% culture rate again instead of +40% and cost 300 production again instead of 240. I've come to think that Culture victory was still being disadvantaged too much by K-Mod/ AdvCiv, especially strategies that don't reach the Modern tech era, and that the K-Mod changes weren't really accomplishing much in terms of making Culture victory less dependent on religions. [advc.201] Related post (after 5th quote box)
• Reverted K-Mod decreases of wonder culture rates – to reduce the number of stat changes that players new to AdvCiv and K-Mod need to get accustomed to: [advc.201]
- Pyramids, Hanging Gardens, Colossus, Chichen Itza: 5 → 6
- Great Library, Angkor Wat, Hagia Sophia, Spiral Minaret, University of Sankore, Shwedagon Paya 6 → 8
- Notre Dame, Taj Mahal: 8 → 10
- Creative Constructions (not a wonder): 2.5 → 3.0 per resource
- Stonehenge 4 → 6, Temple of Artemis 6 → 7 (not fully reverted; were both 8 in BtS)​
That is, I've left the K-Mod changes to the following wonders alone: Oracle, Great Lighthouse, Parthenon, Statue of Zeus, Mausoleum of Maussolos, Sistine Chapel. I believe those wonders would, through K-Mod's extended range of culture spread, indeed exert too much culture pressure too early in the game if the BtS rates were restored.
• National Park, Red Cross and all Corporate Headquarters set to 0 culture – for the sake of simplicity.
• Great Wall: 2 → 4 (doesn't need to have such an unusually low culture rate) [advc.310]
• Slightly increased the constant factor ("CITY_FREE_CULTURE_GROWTH_FACTOR") that gets added to each city's culture rate when calculating the amount of culture that gets spread to surrounding tiles. And increased the decay rate of tile culture from 1% per turn to 1.3% (more on "stolen" workable tiles). Both to somewhat even out the building culture rates restored by this and earlier updates. [advc.098]
• Culture can't spread to unowned tiles. That is, cities still spread culture beyond their ownership range as per the K-Mod rules, just not to unowned tiles. This makes the AdvCiv option for showing culture percentages on unowned tiles unnecessary (now always enabled, but only relevant after city razing), [advc.099f] and supersedes an AdvCiv special rule that had made cities immune to revolt for the first 10 turns after their foundation during the early game. [advc.099c]
• Cities don't spread culture to surrounding tiles during anarchy. Just seems a little more intuitive this way. [advc.098]
• Increased culture level thresholds on Quick speed. Update 0.99 had already increased the threshold for Legendary culture, but there's really no good reason why any of the thresholds should be lower (relative to the game length) than on the other game speed settings. [advc.251]

Difficulty level tweaks:
Spoiler :
• AI civs no longer start the game with the Agriculture tech on Immortal and Deity difficulty (except for those civs that start with Agriculture regardless of difficulty). This should -sometimes- hamper early AI expansion and thus make it less likely that the human player gets boxed in with just 3 decent cities or lacking strategic resources. [advc.250e] Related post
• Foreign culture strength (and thus revolt chance and the garrison strength needed for revolt suppression) gets adjusted to the city owner's difficulty level. Emperor difficulty uses the same strength multiplier as before, whereas e.g. on Noble difficulty, the multiplier is reduced to 83%. I.e. the impact of the difficulty level is fairly small. [advc.101]
• Small adjustments to difficulty-based city maintenance and unit cost modifiers (for human and AI civs alike): Increased costs on the low and medium difficulty levels, pretty much no change on Emperor and above. Also reduced the number of free wins against Barbarians. These changes are mainly aimed at game options like Rise & Fall or Always War that can be challenging already at a medium or low difficulty level. [advc.251]
Rise & Fall option (R&F): The AI civs play at Prince difficulty instead of Noble and the human difficulty level is set one higher than the game difficulty selected on the Custom Game screen. This change should not make it harder or easier to compete with the AI civs as the AI discounts are based on the game difficulty. (Barbarian activity, for that matter, is also based on the game difficulty.) The aim is to increase everyone's expenses to bring them closer (perhaps halfway) to what R&F players are used to from their non-R&F games and to make rapid expansion strategies a bit less effective. [advc.708]

Barbarians:
Spoiler :
• Fixed a bug in the AdvCiv tech checks for Barbarian Spearmen. They should now require the Barbarians to have Bronze Working – as I had intended all along. [advc.301] Related post
• Amended an ineffective AdvCiv fix for a BtS bug: The randomization of Barbarian city locations should finally work as intended (though it may not make a big difference). [advc.300]
• New mechanism for making Barbarian units less likely to appear on low-yield tiles. Should be more balanced and intuitive now (albeit more complicated under the hood). [advc.304] Related post
- The old approach was to re-roll tiles chosen (uniformly) at random up to two times when rolling a non-river, non-resource Tundra or Jungle. This had been easy to implement, but made Barbarians highly unlikely to appear on low-yield tiles so long as a fair number of higher-yield tiles were also available (i.e. unobserved by the civs). The new approach is to use a probability distribution that explicitly makes any low-yield tile 20% as likely to be chosen as a higher-yield tile.
- This still doesn't solve the problem of Barbarians appearing very frequently on low-yield tiles when (almost) no other tiles remain toward the end of the Classical era. I've addressed this, to an extent, through a chance of placing no Barbarian unit at all based on the number of available tiles and the maximal number of Barbarian units to be placed. This is also, more generally, supposed to prevent Barbarian placement from becoming highly frequent and predictable in a small region of valid tiles.
- Jungle and Tundra tiles are now also as low-yield tiles even when there is a river. So, apart from resources revealed to the Barbarians, all Jungle and Tundra are now treated alike (unless a map script allows something like Tundra Flood Plains). As before, Barbarian units can't be placed on tiles with 0 food yield at all.
- The per-tile unit creation probabilities are affected also by Barbarian units recently placed or destroyed in nearby tiles. This is another safety net against excessive Barbarian activity in a single place.
- Barbarian units on patrol are (probabilistically) affected by the same factors that affect unit placement: tile yields and recently created and destroyed Barbarian units. The choice of a target city to flock to is also affected by recently destroyed Barbarian units as well as garrison units remembered by the Barbarians.​
• Animals avoid non-native terrain harder than before. [advc.309]
• The defense modifier of Hills is disregarded when placing Barbarian cities – in order to make impregnable Barbarian cities less common. [advc.031]
• AI civs avoid using big stacks to harass ("choke") Barbarian cities that are too strongly defended for conquest. (Not sure if this fully solves the problem of AI stacks lingering near Barbarian cities.) [advc.300]
• Research cost reductions to compensate for the Raging Barbarians option had been broken by update v0.97; now fixed. [advc.308]

Map generator:
Spoiler :
• Slightly fewer strategic resources are added per player when the player count is high. (To rein in the overall abundance of strategic resources on crowded maps.) [advc.129]
• Fixed a somewhat consequential bug in the iterative evaluation of starting positions. Should now be (somewhat) better at avoiding crammed starts. [advc.027]
PerfectMongoose: Spread Hills out more; tweak river frequency on large maps. [advc.021b]
• Further increase Pangaea dimensions for Huge world size. (Pangaea allows for few coastal cities and hence has less room for expansion overall than maps with multiple continents.) [advc.165]
• Fix compatibility issues with 3rd-party maps:
- EarthEvolution3 (Historical Starts option had been ignored; related post) [advc.108b] and
- Laskaris's Accurate World Maps (unplayable because scenario parser was too strict; related post) [advc.001]​

Nukes: [change id advc.650]
Spoiler :
• Nuke damage to units is chosen through a single die roll (for each unit) instead of two dice. Without Bomb Shelters, this gives each unit a ca. 64% chance of surviving a single nuke and a 17% chance of surviving two nukes in a row (if I've done the math right), whereas, in BtS, the chance of surviving one nuke is 85% and the chance of surviving two is very small (difficult to compute on paper). This means, dropping a single nuke (as the AI likes to do) becomes more effective and dropping two in one place becomes less effective and is, in particular, unlikely to clear a city of all defenders.
SDI interception chance reduced from 75% to 60%, production cost increased from 1000 to 1500. To make this project (and Tactical Nuke vs. ICBM) less of a no-brainer.
• A summary of the effects of a nuke explosion (e.g. units killed) is announced on the main screen.
• Help text in Nuke Mode shows the interception chance (if the target has completed the SDI).
• The AI takes into account the interception chance when deciding whether to nuke an enemy.
• The AI counts intercepted nukes for its "You nuked us" memory, adding 1 to the memory count (whereas a nuked city normally adds 2). [advc.130q]
• The AI may target stacks outside of cities with ICBMs. (Tactical Nuke and ICBM largely use the same targeting logic now.)
• When deciding whether to nuke an enemy stack (in a city or elsewhere), the AI estimates the chance of destroying units outright and of destroying them through a follow-up attack with conventional units. (The latter part is very rudimentary.) Previously, the K-Mod AI code had summed up the production cost of the affected units, but hadn't considered whether they'd survive and heal.
• Reduced the utility value that the AI counts for hitting buildings with a nuke – based on the buildings' odds of withstanding the nuke. (City buildings seem to have been the dominant factor in most of the ICBM targeting decisions of the K-Mod AI code.)
• Cities with a high military production rate are preferred as nuke targets by the AI. (idea by @Inthegrave)
• Tweaked the AI logic for creating the Manhattan Project.
• Made the AI much more interested in producing at least a small nuclear arsenal once nukes become available.
• Increased impact of personality (espionage weight, no-war probability, Environmentalism as favorite cvic) on the eagerness of AI cities to produce nuke units.

Misc. AI:
Spoiler :
• Threshold for Friendly relations decreased from 10 to 9, threshold for Furious relations from -8 to -9, meaning that the AI becomes easier to befriend and more difficult to infuriate. Taking into account earlier changes to the first impressions modifier, the Friendly threshold is now, in effect, 2 points lower than in BtS, and the interval for Pleased relations is now shorter (+4 to +8) than the interval for Annoyed relations (-2 to -8). Without a shared religion, the AI had always been too difficult to befriend, especially in the mod because it makes various positive modifiers harder to attain. Various remedies have been considered, but I never got around to testing and implementing them. I think there was still a little room for tweaking the thresholds, so I've at least and at last done that. [advc.148] Related discussion 1 2 3
• Made the "supplied us with resources" relations modifier easier to get by increasing the utility value counted for imported resources by up to 50%. This change is tied to empire size and should mainly affect the midgame and late game. [advc.149]
• Made the "mutual struggle" relations modifier a bit easier to get by requiring some 20% fewer war successes/ losses to reach any particular modifier. [advc.130m]
• Based the "heathen religion" relations penalty on the populations of revealed cities with the offending religion. In previous versions of AdvCiv, the penalty had applied in full 8 turns after any one city with the offending religion had been revealed. The new behavior is smoother and hopefully more intuitive. [advc.130n]
• Tweaks to the cancellation of deals:
- When an AI civ cancels an Open Borders agreement or Defensive Pact, it'll refuse to reinstate the deal for an expected duration of 5 turns – instead of the expected 10-turn cooldown that still applies when the other side cancels the deal. [advc.130j]
- The AI may cancel gold-per-turn deals in order to enforce its per-player trade limit for gold-per-turn. This addresses the "gold subsidy" loophole. [advc.133]
- When the attitude level of an AI civ drops below the level required for upholding a deal, the grace period for cancellation now has an expected length of only 2.5 turns (instead of 5) when the trade partner has become the worst enemy of the AI civ. [advc.133]​
• Fixed an issue with AI civs occasionally trading away crucial strategic resources to other AI civs. This seems to have gone on unnoticed since AdvCiv 0.9 or so. [advc.036]
• Made AI cities quicker to expand their borders to the outer ring of workable tiles through culture buildings like Monument. Still too hesitant for my taste, but should at least no longer keep important strategic resources just out of reach for dozens of turns. [advc.192]
• On the highest difficulty levels, the AI places an extra garrison unit in each of its cities already around the start of the Medieval era (instead of Renaissance). [advc.107] Related post (see item #2)
UI:
Spoiler :
• Overhauled the city bar hover text by adopting everything from BULL except the "Base Values" and "Base Production" info (which I find too obscure). No options except one for the building list (icons/ names/ disabled). Endeavored to make the formatting more compact and more self-explanatory than in BULL. Minor innovations: Larger specialist icons; buildings sorted alphabetically; showing output of production processes (e.g. Wealth) and showing stored production (chopping, overflow). [advc.186]
• BUG options for moving revolt chance and air unit capacity from the tile hover text to the city bar hover text. (Any information about cities really belongs in the city bar hover text, but information that also pertains to units garrisoned in the city is convenient to have in the tile hover text, so that remains the default setting.) [advc.101, advc.187]
• Optional (disabled by default) fist icon above city bars where the revolt chance is positive. (The fist icon will still appear above cities under occupation in any case.) [advc.101]
• Show turns to starvation directly on the city bar on the main map. [advc.189]
Production decay warnings adopted from BULL, enabled by default. [advc.094] Related post (2nd quote box)
• "Zoom City Details" feature adopted from BULL, i.e. show the city bar hover text when hovering over a city name on the Domestic Advisor or over the City Details button on a choose-production popup. Optional in BULL, always enabled in AdvCiv. [advc.186b]
• "GP Rate Breakdown" feature adopted from BULL, i.e. the hover text for the Great Person bar on the city screen says how many GP points are generated by buildings and how many by specialists. [advc.078]
Combat modifiers are now formated in the same way (order, color, sign conventions) regardless of whether Advanced Combat Odds are enabled. I think this formatting is the best of both worlds. Also fixed an issue with the color and sign shown for the Disorganized promotion that Barbarian Galleys start with. [advc.048]
• Custom icon for the air bomb button (superimposing the bombard icon), to make it easier to distinguish from the air strike button. (This change was supposed to be in v0.99, but I don't think it was working at all as I had put the modified graphic in the wrong directory.) [advc.004c]
• The unit cycling order distinguishes air units from civilian units, i.e. should be less likely to cycle between air units and workers. [advc.004c] Related post (penultimate quote box; I don't really think I've addressed that issue though)
• Pathfinder: When breaking ties between paths of equal length, landing on a tile with a route (Road or Railroad) is now preferred (among other criteria) – even when that route does not shorten the current path – because it may well speed up subsequent movement. This change also benefits the AI civs. [advc.pf]
• "Internet Games" selection on the opening menu grayed out – because the GameSpy servers have long been disabled. Can still be clicked (this can't be helped). Inspired by a similar change in the Caveman2Cosmos mod. [advc.002g]
• Yields displayed for tiles owned by a rival no longer give away unrevealed resources. (But Mines on flat terrain will still give away unrevealed mineral resources.) [advc.182] Related post
• The Customizable Domestic Advisor can no longer show global city ranks (because information about unrevealed rival cities can be inferred from those) and XY-coordinates of cities can't be shown until the map has been centered. Based on similar changes in the "Close To Home" mod.
• Fixed display issues (introduced in AdvCiv 0.99) with peace treaties resulting from city trades or war trades. Should no longer end up with more than one peace treaty and peace treaties should again be listed under current deals on the diplomacy screen. [advc.ctr]

Stability:
Spoiler :
• Fixed two rare crashes to desktop that were introduced in v0.97:
- Out-of-bounds access during map generation. Took many dozen (re-)generated maps until I ran into this; was harmless when it didn't crash.
- Repeatable crash when an AI Paratrooper was considering to drop onto an unowned tile with a resource. (Rare because most land tiles are owned once Paratroopers become available.)​
• Crash to desktop when regenerating the map after founding a city.
• Autolog issues (Python crash, only when Autolog was recording):
- Upon the creation colonial vassals; bug report
- Potential divide by 0, adopted from the "More Naval AI" mod.​
• Fixed an issue that had sometimes made it impossible to place items on the trade table after assuming control of an AI civ (through Ctrl+Shift+L or the Rise & Fall option). Save-restart-reload had been the only workaround. [advc.127c]

Performance:
Spoiler :
• Introduced a list-like data structure ("ListEnumMap"), mainly for data that BtS stores at every tile about every civ. Scarcely makes a difference with an 18-civ limit, but seems to speed up AI turns by some 15% with a 31-civ limit (i.e. 32 players incl. the Barbarians). The performance penalty for allowing 31 civs while playing only with 18 should now be under 10%, so, for any mods based on AdvCiv, there should no longer be a strong reason against increasing the civ limit in the (GameCore) DLL. AdvCiv itself can't switch to a 31-civ limit because that would break compatibility with old savegames. [advc.enum]
• (A few other optimizations, but I don't think they're having a significant effect. Well, mods based on AdvCiv might benefit more, who knows.)

Software design (only relevant for modders):
Spoiler :
Far more extensive changes than would seem advisable for a supposed final update – but I did want to pay my remaining technical debt.
• Rewrite of the EnumMap class, originally from the "We the People" mod. Now integrated into a hierarchy of class templates that also cover the ListEnumMap mentioned above under "Performance," and similar classes optimized for two-dimensional data loaded from XML. The enum map classes are based on type traits defined for enum and integer types. [advc.enum, advc.003t]
• Revised all code in the UWAI component (AI war planning) to make it conform with the style that I use in the rest of the DLL. (Bugs discovered in this progress had already been fixed by v0.99.)
• Floating-point numbers – which the mod had originally used widely, especially in the UWAI component – have been replaced almost entirely with fixed-point numbers (ScaledNum type), the exception being a couple of uses of std::log and the (BtS/ Lead From Behind) combat odds calculations. I don't think floating-point math was ever going to be an issue for network synchronization, but, if I'm proved wrong about this, it won't take much effort now to switch fully to integer-based math. [advc.003g]
• Rewrite of the code for listing combat modifiers, so that modifiers with an unexpected sign (e.g. -25% city attack) are shown with the correct sign and in the correct color.[advc.048]
• Calls to synchronized instances of CvRandom (random number generator) no longer pass along a message for the RandLog; instead, the calls are wrapped in a macro that generates the message from the function name and line number at the call location. The macros also make conditions that "flip a coin" (Bernoulli trial) easier to read and less error-prone to write. [advc.007b]
• Added a bunch of functions for easier access to the ID of the "active" player, i.e. of the civ whose human player is assumed to be interacting with the UI.
• Removed most "inline" keywords (the bulk of which I had added myself). Based on a test, this has had no impact on performance, or almost none. One could argue that the keywords were benefitial as a means of documentation, i.e. to make the reader aware when a function is expected to be called very frequently, but I don't think that's worth the clutter. [advc.inl]

Additional credits:
• Thanks to @keldath for making me aware of a number of (potential) problems already during the development of this update.
• This update includes the last few revisions (r593 to r596) of the BBAI mod, which had not been included in K-Mod.
• A couple of very minor tweaks (1 | 2) from the "More Naval AI" mod by @lfgr have not been mentioned above.
A 48-civ DLL can be downloaded here.

• Fixed a bug that had often prevented the standard map generator from placing resources in (clustered) groups. Apart from spreading resources out more than intended, this bug (introduced in AdvCiv 0.98) had made some resources, e.g. Wine, much rarer than they're supposed to be. [change id advc.129]
• Further checks and balances for precious resources (now that they can appear in groups again): [advc.129]
- Gold and Gems: Resources need to be at least two tiles apart. This is implemented by spreading the group out over a wider range (21 tiles instead of 9 tiles). As in earlier versions (pre-0.98), groups of more than two Gold or Gems are very uncommon.
- Silver: Can no longer be placed in groups (i.e. no change really from v0.98 and v0.99). Because AdvCiv allows Silver to be placed on Grassland Forest Hills and groups of such Silver tiles are pretty powerful, especially near starting sites.​
• Fix Globe layer buttons disappearing when all units have been moved. This problem was introduced along with the unit cycling button added in v0.99. [advc.154]
• Serfdom help text fixed. Bug report by @DarkHorror
• Barbarian units created by the uprising random events are placed two tiles away from borders (instead of adjacent), and only 4 units are created in the Medieval era (was 5 in v0.99 and based on the map size in BtS). [advc.311] Related post
• The Sea Patrol mission is deactivated in network games regardless of the (AdvCiv-introduced) BUG option -- so that the game can't go out of sync due to differing Sea Patrol settings among human players. [advc.004k]
• PerfectMongoose map script overhauled: [advc.021b]
- The Old World Start option is now reasonably likely to succeed in splitting a Pangaea, no longer leads to unpredictable land-sea ratios and has a better awareness of habitability and (through an update to version 3.3 of @LunarMongoose's script) distances between continents. Regardless of the Old World Start option, starting sites get assigned by the AdvCiv algorithm. (Previously, Old World Start had used the starting position algorithm built into the PerfectMongoose script.)
- Option "Tectonic Plates" that enables the old PerfectWorld 2 landmass generator. Tweaked that generator to allow more massive continents. (That said, continents of Asian shape and proportions still don't really occur.)
- Addressed problems with hills and peaks being too common along coasts and near the poles; placement in more natural-looking patterns. (Though, especially with the Tectonic Plates option, straight, uninterrupted chains of peaks still occur.)
- Per-tile temperature values get adjusted to the tile's distance from the sea (from @Toffer90's C2C_World.py). For one thing, this leads to more varied terrain in the high latitudes.
- Rivers less concentrated in the tropics, better coverage with rivers for the temperate latitudes. (Implemented by running the PerfectMongoose river generator and the standard river generator in succession.)​

Plus a couple of very minor bugfixes covered by the commit history on GitHub. This link can also be helpful for a selective update (without replacing the whole AdvCiv folder): All .xml, .py and .dll files listed as "changed," 5 in total, need to be replaced.
This update adds a bunch of optional and non-optional UI tweaks that have been requested over the last year or so. That said, AdvCiv still doesn't support all features from the BULL mod; in fact, the larger part of the additions has nothing to do with BULL. There are also a few minor balance tweaks, and the update improves the efficiency of the pathfinding code, especially in the UWAI component. For example, in a test with 31 civs on a map with 160x100 tiles (ca. 50% more than a Huge map), the first 300 turns on AI Auto Play took my PC fewer than 30 minutes with AdvCiv 0.99 versus more than 50 minutes with K-Mod. (AdvCiv 0.98 would've been slower than K-Mod on this benchmark.) This won't make much of a difference on Standard-size (or even Large) maps, but should make AdvCiv viable as a basis for mods that require super-Huge maps. (On that note: here's the updated 48-civ DLL, for those who need it.)

Details:

User interface
Spoiler :
• So long as any unit is selected or needs orders, a unit cycling button is shown to the left of the big flag on the main screen. This can be disabled on the "General" tab of the BUG menu. There is also an option for showing a worker cycling button in addition. [change id: advc.154]
Related discussion | screenshot
• Unit cycling asks players to give orders to groups in which only some units are able to move. This should make it easier for players to avoid leaving moves unspent by accident, especially worker moves. [advc.153] Based on a proposal by @Leoreth
• Only one unit advances after killing the last defender in an adjacent tile, even if multiple units are selected by the attacking player (group attack). This applies regardless of whether the Stack Attack option is enabled. [advc.153] Proposed by Leoreth, see link above.
• Various usability improvements for bombard, air bomb and other air missions: [advc.004c]
Spoiler :

- When hovering to bombard or air bomb a city, help text says by how much the city's defense modifier will decrease. (This is not obvious for units like Cannon that ignore building defense.)
- Help text for air units shows their current air bomb rate (i.e. taking into account current hitpoints).
- When hovering to air bomb an enemy improvement, the mission's success probability is shown.
- When an air (or paradrop) mission can be intercepted, help text shows the best visible enemy interceptor and the interception probability.
- Groups of units now execute bombard and air bomb missions in a (semi-)intelligent order. (Based on ideas by Leoreth)
- Groups stop executing air missions when an interception occurs (unless Stack Attack is enabled).
- Custom icon for the air bomb button (superimposing the bombard icon), to make it easier to distinguish from the air strike button.
- Closed some fog-of-war information leaks caused by the air bomb mission.​

• When hovering over a tech button in the choose-tech popup or directly on the main screen, the help text points out undiscovered techs that would speed up the tech that is being moused over. (So far, AdvCiv help text had only covered the inverse direction, i.e. techs that the mouse-over tech will speed up.) [advc.910] Requested in this post (middle bullet):
• When a trade will result in a peace treaty, a peace treaty item is shown on the trade table. This had only been the case for AI demands and pleas in earlier versions of AdvCiv, now it also applies to all city and war trades. [advc.146, advc.ctr] Related post
• Made the Jungle textures a little brighter in order to make Jungle and Forest easier to distinguish in the fog of war. Probably only helps a little; Jungles are still quite a bit darker than in BtS. [advc.002h] Related post (6th quote box)
New options on the BUG menu, disabled by default – or behaving as in earlier versions (screenshot):
Spoiler :

- Wide city bars [advc.095]
- Clicking a tile outside the city radius exits the city screen. The XML setting CITY_SCREEN_CLICK_WILL_EXIT no longer has any effect. And double-clicking outside the city radius now exits the city screen regardless of the option. [advc.004t]
- Color of water tiles on the minimap; and whether to show unit blips on the minimap. Replacing the MINIMAP_WATER_MODE setting in XML. [advc.002a] Related post (5th quote box)
- Duration of nuke animations [advc.002m]
- Top-city icons above city bars: highest production, gold, research rate (these had been enabled by the "Detailed City Info" option in BtS and were completely disabled in earlier versions of AdvCiv) and -new- highest espionage rate (proposed by @crullerdonut), highest free XP. [advc.002f] Related posts: middle of this post | start of that post
- Icon above the city bar of the city with the next projected Great Person birth. [advc.002f]
- Specialist help text from BULL's Actual Effects component. This was previously only available by holding down the ALT key in AdvCiv. [advc.063] Related post (4th quote box)
- Show total culture output next to culture slider. [advc.004p] Requested here
(And removed one of the three menus for customizing the color of the gold rate in order to make room.) [advc.070]
- City alerts about positive pending changes (e.g. "city will become happy next turn"). In BUG, the "pending" options had covered both positive and negative changes; earlier version of AdvCiv had restricted those options to negative changes. [advc.106d] Requested here
- The Tribal Village Icons option can now be used alongside Unit Action Recommendations. [advc.004z]​

• A red food icon is shown above the city bars of cities whose governor is set to "Avoid Growth". Plus some smaller visual clues that make this setting less easy to forget. The city bar icon can be disabled on the "Map" tab of the BUG menu. [advc.002f]
• When the AI refuses to capitulate because there aren't enough enemy boots on the ground, hover text explains this as "It looks like your offensive has run its course ..." instead of "You'll have to take it from our cold, dead hands". [advc.112b] Related discussion
Civic hover text on the tech tree shows detailed information about the civic. [advc.mnai] Adopted from @lfgr (More Naval AI mod)
• An announcement is shown when a foreign capital moves. [advc.106]
• Disabled the misleadingly named "Auto Moves" shortcut of AI Auto Play because its key combination Ctrl+Shift+M is too similar to the savemap combination Alt+Shift+M. [advc.127]
• "Justinian I" renamed to simply "Justinian". [advc.005]
• No more Aqueduct 3D models crossing between continents. [advc.002p]

Starting positions:
• Fairer algorithm for the assignment of starting sites in team games. Specifically, the new algorithm tries to avoid letting one team outnumber another on any continent, and it tries to balance that goal with the goal of minimal starting distances between teammates. [advc.027]
Related discussion
• Starting site handicaps from the difficulty setting (StartingLocPercent) now also apply to team games if all teams have the same number of members. This is implemented by successively swapping all starting sites of one team with those of another team. [advc.108b]
• In scenarios that allow arbitrary civ leaders (e.g. Africa), the AdvCiv starting position algorithm now respects tiles marked as "StartingPlot" by the creator of the scenario. Additional starting sites are only computed when there are too few pre-marked sites. [advc.027]

Global Warming (not a comprehensive overhaul): [advc.055]
• More detailed announcements of Global Warming events. Screenshot
• The Global Warming sound is played at most once per turn. [advc.002l] Related post (2nd quote box)
• Per-turn probability for Global Warming events reduced to 3/5 of its value in K-Mod. This change does not affect any other aspect of Global Warming (although other aspects may need work as well). Implemented (and reversible) through GLOBAL_WARMING_INDEX_PER_CHANCE in Assets\XML\GlobalDefinesAlt.xml. Related discussions 1 | 2 (both starting in the second half of the linked post)
• Global Warming turns Tundra into Plains, not into Grassland. Plains adjacent to Snow or to multiple Tundra tiles can't turn into Desert.

Other balance tweaks:
Spoiler :

• Reduced the threshold for Legendary culture to 45000 (on Normal speed). The threshold still increases with each difficulty level beyond Prince, but it's a flatter progression than before. E.g. Emperor now requires 50000 culture (was 60000 in AdvCiv 0.98). [advc.251] Related discussion (after the 5th quote box)
• On Quick speed, the threshold for Legendary culture is now two thirds of the Normal-speed threshold (was one half). [advc.251]
• One Spy specialist slot moved from Jail to Courthouse so that an espionage-based economy is (again – despite earlier changes to the Great Wall) feasible before the midgame. Decreased the production cost of Market and Grocer from 150 to 130 – to avoid making Spies more easily available than Merchants. [advc.911] The Courthouse change was suggested by @crullerdonut
• The Creative trait no longer speeds up Colosseum. Theater and Colosseum swap their culture slider abilities so that Colosseum gets the more powerful version (1 happiness per 10% culture rate). As a Theater replacement, Hippodrome also gets its slider ability downgraded (from 2 to 1 happiness per 10% culture rate), but grants 2 Artist slots as in K-Mod (was 0 in BtS, 1 in earlier versions of AdvCiv). The main point of these changes is to weaken the Creative trait at least a little bit because it benefits from the K-Mod/AdvCiv changes to the culture system – and to not weaken Colosseum in the process. [advc.908b]
• Increased the per-turn probability of a nuclear meltdown from 0.5 to 0.7 permille. The chance is shown in help text. [advc.652] Related discussion
• When playing with the "No Slavery" option, Granary stores 50% food (as in BtS), not 40%. [advc.912d]
• Requirements for quests scale more reasonably with the map size. E.g. the Classic Literature quest requires 5 Libraries on Duel-size maps and 9 an Huge maps; instead of 2 to 11 in BtS and 2 to 16 in previous versions of AdvCiv. (The requirement had been tied to the map's default player count.) [advc.137] Related post (last quote box)
• Tech requirement for the Vedic Archers random event changed from Polytheism to Priesthood. (So long as no civ knows this tech, the event can't trigger for anyone.) This an old balance change from the BUFFY mod. [advc.311]

Misc. game rule changes:
Spoiler :

• Cities with at least one religion generate 1 culture per turn and cities with at least one holy city 5 culture, i.e. culture from multiple religions no longer adds up in absence of a state religion, and having a state religion no longer disables the culture output of non-state religions. This also means that the Religion Advisor no longer needs to show how a state religion change will affect culture rates. [advc.172]
• Sea and air units can enter rival forts through Open Borders. [advc.183] (In my opinion, this was an unnecessary exception to the basic rule that forts act as cities.)
Pillaging a friendly tile destroys roads before improvements. [advc.111] Inspired by these two posts
Diplo votes can reset the waiting period for canceling Open Borders and Defensive Pacts. (I had already implemented the same behavior for peace treaties at some earlier point.) [advc.032]
• Decreased the human handicap on building production costs on Emperor difficulty and above, and instead increased the AI building discounts on those difficulty levels. (However, the AI discounts on buildings remain smaller than in BtS – which doesn't handicap humans at all when it comes to production costs.) [advc.251] Rationale: I stand by the idea of handicapping human production costs, but it's problematic to do that for buildings because, unlike units, many buildings have a pretty limited potential for rewarding skillful play.

Bugfixes:
Spoiler :

• Fixed AI logic for deciding whether to bombard a city, attack or retreat. The AI had pretty much always attacked. This has been broken at least since v0.98. Related post (2nd paragraph)
• Fixed K-Mod code (likely bug) that seems to have made the AI less interested in Cottages when in Emancipation. [advc.001]
• In games that don't start on turn 0, the AI had been more willing than intended to start early wars against human players. This had in particular affected Immortal difficulty, which increases the start turn by 10. (The AI may still be too rabid on Immortal difficulty.) [UWAI component]
• Fixed some other minor or not so minor bloopers in the UWAI component. (A byproduct of having revised the UWAI code stylistically for the next AdvCiv update, i.e. version 1.0.)
3D models of buildings in the human player's cities had sometimes not been shown after loading a savegame. [advc.045]
• Finally fixed two minor issues with the highlighting of goody huts in the early game: [advc.004z]
- Blue circle on turn 0 even when Action Recommendations are disabled.
- Lingering indicator bubbles for huts entered by foreign units.​
• The relations modifier "This war spoils our relationship" was computed and displayed incorrectly in some situations. [advc.sha]
• Corrected Civilopedia links to corporations and Spy specialists that had been leading to the Spy unit and the HQ buildings respectively. [advc.001] Bug report (middle of the post)
• Combat ends when the attacker reaches its combat damage limit. The BtS/ Vanilla Civ 4 rules had required the combat limit to be exceeded, and this was inconsistent with the displayed combat odds, e.g. when a Cannon attacks another Cannon – because the combat limit (80) is then a multiple of the per-round damage (20). The Advanced Combat Odds mod ("Odds" tab of the BUG menu in AdvCiv) was already displaying the correct odds in such situations (and I've updated it to conform with the new rule). [advc.001l] Related post

AI:
Spoiler :

• AI civs that lack the technology for trading with another continent (Astronomy/ Sailing) are reluctant to sign Open Borders agreements with civs on that continent. [advc.124]
Rank hate diplo modifiers ("you're getting ahead of us") are reduced when both civs are in the lower half of the scoreboard. (But I haven't restored the positive modifiers that BULL explains as "developing nations need to work together".) [advc.130c]
• In tech trades, AI civs pay less for techs that they don't really need and pay extra for techs with a high utility (i.e. techs that they've been considering to research by themselves). However, tech cost continues to be the most important factor in the AI evaluation of tech trades. [advc.550g] Related post
• Increased the impact of possible tech trades on AI research choices. [advc.550h]
• Reduced the value assigned by the AI to strategic resources that enable numerous units (e.g. Iron) or buildings. This affects AI city placement and resource trades. [advc.036b]
• AI civs near a Domination victory become more willing to found cities. [advc.031]
• Tweaks to the UWAI component (AI war planning):
- Fixed some problems with AI capitulation decisions, specifically, the "not right now" response. When an AI civ is fighting multiple wars, the all-war-ending effect of a capitulation is now taken into account. Related post
- Made AI civs in hopeless wars more inclined to seek peace, especially when facing multiple overpowering enemies.​
• When at war with far weaker enemies, the AI mostly runs a peacetime economy. [advc.105]
• Made the AI more interested (not necessarily much more; hard to say) in targeting vulnerable enemy cities and less interested in conquering Shrines. [advc.104d]
• When comparing stacks wrt. their overall combat strength, the AI assumes that battles between large(-ish) stacks favor the defenders more than battles between small stacks or individual units. [advc.159]
Non-lethal AI units make opportunistic attacks only when there is a friendly lethal unit nearby that might finish the target off. [advc.298] Related post (2nd half)
• Groups of units now execute bombard and air bomb missions in a (semi-)intelligent order – as already mentioned under UI changes; this change also benefits the AI. [advc.004c]

Flavor:
I've restored a few (but not nearly all) whimsical AI diplo texts that the Actual Quotes mod had disabled. [advc.005h]

Performance:
Spoiler :

• The performance gains are mainly the result of adapting the K-Mod pathfinder for the computation of deployment distances in the UWAI (war planning) component. Those computations were the single biggest time sink in very large games with v0.98, and tests suggest that v0.99 eliminates 75% of that computing time. [advc.pf] (Post touching on my changes to the K-Mod pathfinder)
• I've also improved the efficiency of memory allocations in the K-Mod pathfinder a bit. [advc.pf]
• An adjacency list is now stored for each tile – to avoid checking for the map edges over and over in pathfinding and other AI code. [advc.003s]
• Plus some other (almost noteworthy) optimizations in the UWAI component and elsewhere. [advc.opt]

Relevant for modders (maybe):
Spoiler :

• Improved AI support for custom eras through Civ4EraInfos.xml; see comments in the respective schema file. Modders can e.g. indicate in which era (if any) oceangoing ships become available. [advc.erai] Inspired by Kek-Mod
• The Emancipation ability (improvement upgrade rate) should now work correctly for all modifiers greater than or equal to -100%. (Previously, only positive multiples of 100% had worked.) [advc.912f]
• Deleted copies of English game texts that had been used as placeholders for missing translations. K-Mod will use the English text when a translation is missing, so those copies were unnecessary. Also renamed some game text files (Actual Quotes mod, BUG corrections for random event texts) and deleted all texts that were just copies from the original game.
• Moved modified BtS map scripts from PrivateMaps to PublicMaps. My understanding is that this will allow BtS and other mods to remember those maps as the most recently played map (via CivilizationIV.ini). [advc.137]
• Removed some redundancies from code that calculates combat odds (BtS, Lead From Behind, Advanced Combat Odds) and added code for verifying that the calculation is (mostly) consistent with the combat resolution procedure. These changes should make it less daunting to modify the combat system.
• Removed redundant compiler flags from the makefile. [advc.make]
Macros FOR_EACH_UNIT_IN, FOR_EACH_TRADE_ITEM, FOR_EACH_ADJ_PLOT used throughout the C++ codebase. [advc.003s] Related post (last paragraph)

The above omits very minor changes. Complete Git commit history: GitHub.com/f1rpo/AdvCiv/commits/0.99?since=2020-10-7
(Note, however, that many commits, including nearly all bufixes, up to Dec 28 were already included in v0.98c.)
For a manual update from v0.98b, it suffices to update AdvCiv\Assets\CvGameCoreDLL.dll:
18 civs | 48 civs

This minor update addresses a few issues reported over the last two weeks:

• The Draft button on the city screen had caused the main map to black out. Bug report
• Several issues with city production getting interrupted for no good reason. Bug report
• Human starting sites in team games sometimes had a noticeable bias for small continents. Bug report
• City cycling via Num Pad didn't work. Bug report
• Civilopedia articles had shown active buffs of religious buildings (e.g. extra culture from Sistine Chapel). Those buffs are still shown in Civilopedia hover text – that's also the case in BtS I think. Bug report
• AI tweaks:
- Projection of military build-up (UWAI component) adjusted. To address problems with overambitious AI war plans in the midgame and late game. Related post
- Lookahead weight increased (a little) in the evaluation of tech paths. This should make the AI a bit more interested in researching techs that have little intrinsic value (e.g. Printing Press, Scientific Method). Related post

Plus some very minor changes covered by the Git commit history since v0.98b.

Thanks to @eXalted, @Lanstro, @crullerdonut and @Imp. Knoedel for reporting these issues and helping me resolve them. (The posts linked above mention some more complex changes; those require more testing and will be included in v0.99.)
Bugfixes:
• Crash at game start when playing a scenario with random starting locations (e.g. Africa scenario).
• Numeric overflow in AI capitulation check, sometimes resulting in a refusal to ever capitulate ("doing fine on our own"). Bug report

Plus a few very minor bugfixes and tweaks documented in the Git commit history since the v0.98 release one week ago.

To update manually from v0.98, it's enough to copy the DLL (18 civs | 48 civs) to \Mods\AdvCiv\Assets\.
First up:
48-civ DLL (for those who need it)
• Since July, AdvCiv has its own subforum. The old thread in the modpacks forum remains available for misc. posts.
• For players who have already read the tentative release notes here, I've listed the (few) additions since 13 Oct here.

Apart from fixing several annoying bugs, this update is mainly concerned with starting positions and the map generator. I've implemented a new algorithm for assigning starting locations that is supposed to partition the available land more evenly than the BtS algorithm. The new algorithm gets used for all scenarios with random starting locations and for the following map scripts:
Fractal, Pangaea (except team games), Continents, PerfectMongoose (except Old World Starts option), Mixed Continents, not too Big or Small, Big and Small, Medium and Small, Hemispheres, Balanced, Tilted Axis, Great Plains, Lakes, Ice Age, Fantasy Realm.​
Whether it is used for third-party map scripts depends on whether those scripts override one of the StartingPlot functions; see the manual (change id 027 in the appendix) for details. The new algorithm can be disabled for all map scripts by setting ENABLE_STARTING_POSITION_ITERATION to 0 in AdvCiv\Assets\XML\GlobalDefines_advc.xml.
I've posted some screenshots comparing AdvCiv 0.97 with 0.98 starting positions in this thread.

Tweaks to the "normalization" of starting sites, i.e. the conversion of terrain and placement of additional resources: [change id advc.108]
Spoiler :
• In addition to the found-city value, the available space for expansion is taken into account when deciding whether a starting site needs to be buffed.
• Far fewer extra forests are placed. (BtS basically places forests everywhere when a site is too weak.) To compensate, slightly more forests are placed during map generation (on average; the forest frequency varies a lot).
• When placing additional resources, resource types that already exist in the city radius are probabilistically avoided, especially in tiles adjacent to the existing resource and especially for resources that don't normally form groups.
• Gold can no longer be placed as an extra resource.
• Tiles for additional resources are now selected with a (probabilistic) preference for the inner city ring. This should give players more leeway to move their starting settler.
• The location for extra food is now properly randomized. (BtS places food east of the starting site when possible.)
• To avoid adding too much food:
- Food resources are avoided when a site already has enough food and just needs to be buffed.
- Coastal seafood resources are counted as "high-food" resources (i.e. as equivalent to most land food resources) when deciding whether a starting site has enough food.
- Some care is taken not to place too many Flood Plains.​
Other tweaks to the map generator: [advc.129]
Spoiler :
• Slightly increased map grid sizes: Back to the BtS dimensions for Small and Standard world size, still a little smaller than in BtS for the other world size settings. [advc.137] Related posts: 1 2
These changes apply mostly just to map scripts modified by the mod (PrivateMaps folder) because most of the original map scripts have their own mappings of world size to grid dimensions.
• Increased the density of resources a bit overall. A change early in the development of AdvCiv made resources somewhat scarcer on larger maps – this is still the case –, but also made them a little bit scarcer on Standard-size and smaller maps. Now the density should be pretty much as in BtS on Standard world size and a little denser on smaller sizes. (Which had been my intention all along I think.)
• Fixed a bug introduced in v0.97 that had caused the "unique range" of resources to be ignored. The most easily observable effect was that Fish resources had appeared next to each other. Bug report (sort of)
• River placement accounts for terrain on both banks equally. (BtS gives the tile at whose southeastern corner a river segment will arrive much higher weight than other surrounding tiles when generating rivers.)
• Slightly increased the attraction of rivers to water tiles; this should result in somewhat shorter rivers overall.
• Reduced the probability of clusters of Silver, Gems and Ivory. (Had already done the same for Gold at an earlier point.)
• Relaxed the latitude requirement of Crab; reduced the frequency of Fish a bit to offset the higher number of Crabs. Related post
• Water resources are no longer placed on tiles that are made unreachable by a Peak. [advc.129d]
• When selecting a continent for a resource that is supposed to occur exclusively on one continent, continents with a high number of suitable tiles are preferred (e.g. tiles with a lot of flat Jungle in the case of Banana).
• World-size adjustment for the minimal distance between Tribal Villages. [advc.314]
When choosing random civs at game start, civs with multiple leaders have a slightly greater probability (except when playing with the Unrestricted Leaders option). Specifics:
Spoiler :
A civ with 2 leaders (e.g. Rome) is 1.2 times more likely to be chosen than a civ with 1 leader (e.g. Mali), and a civ with 3 leaders (e.g. America) is 1.4 times more likely to be chosen than a civ with 1 leader. This bias can be adjusted or disabled through PER_EXTRA_LEADER_CIV_SELECTION_WEIGHT in AdvCiv\XML\GlobalDefines_advc.xml. [advc.191]
The Settings tab (Victory screen) says whether civs and leaders were chosen at random. (However, that information is not available in games loaded from pre-0.98 saves.) [advc.190c]
Barbarians:
Spoiler :
• Decreased the proportion of owned tiles that causes Barbarian activity to reach its peak; i.e. Barbarian activity should pick up and peak earlier than in previous versions (but still later than in BtS, especially with Raging Barbarians). [advc.300]
• Decreased the attraction of Barbarian cities to strategic resources. [advc.304] Screenshot of a badly placed Barbarian city
• Barbarian Galleys have only 2 moves. More specifically, they get -1 move through the "Disorganized" promotion (introduced by K-Mod), which, so far, had already given Barbarian Galleys -10% strength. [advc.905a]
• Made it more difficult to flip Barbarian cities through culture: [advc.101]
- Barbarian units count as culture garrisons. (Curiously, they didn't in BtS.)
- Barbarian cities can't revolt in the first 8 turns after having been founded or conquered. This grace period gets adjusted to the game speed setting.
- Revolts in Barbarian cities no longer outright kill the garrison. (This rule had made sense in BtS because Barbarian cities always flipped on the first revolt, but AdvCiv requires one extra revolt to flip any city.)​
Music should no longer be inaudible when playing at a flat angle and a high field-of-view value. If it's still not quite right, then it should help to adjust the default camera distance on the "Map" tab of the BUG menu (new option; screenshot). [advc.004m] Bug reports 1 2(?)

Other bugfixes
: (mostly bugs introduced in AdvCiv 0.97; though I'm unsure in some cases)
Spoiler :
• It seems that the Random Personalities option didn't have any effect. [advc.003q]
• Possible crash at launch after having played a mod with a custom menu background. Bug report 1 2
• Updating minimized popups [advc.004x] had caused them to re-play their interface sounds. Bug report
• Restored the proper color of the place-sign cursor (Alt+S). Now green again; was gray. Bug report (under "Interface")
• Report random events only to players who have met all civs involved in the event. Related post (last paragraph)
• The visibility effect of Recon missions had lingered sometimes.
• Hover text for the Imperialistic trait again lists the settler discount. Bug report
• AI resource trade values had not been updated properly in multiplayer games. (Bug introduced in v0.96 or 0.95 I think.) [advc.036]
• Auto-saving at the start of the active player's turn lead to some issues in HotSeat and in networked multiplayer with simultaneous turns. Now happens (as in BtS) at the start of the game turn when playing in those multiplayer modes. [advc.044]
• Cities had been able to culture-flip regardless of foreign culture range. Cities outside of that range are only supposed to revolt, not flip. Looks like I had implemented this incorrectly from the beginning. [advc.099c]
• The AI had been faster to forget diplo actions (e.g. "You gave us help") on slower game speed settings. It's supposed to do the opposite. This bug has existed in the mod for a long time.[advc.130r]
• The AI had sometimes razed major cities without due consideration. [advc.ctr] And some smaller bugfixes in AdvCiv AI code for razing cities (maintenance calculation, mixup of current and previous owner). [advc.116, advc.ctr, advc.300]
• Proposing Open Borders and Defensive Pact resolutions had been possible even when all pairs of full members had already made such agreements.
• Late-game crash that occurred sometimes when a capitulated vassal broke free. Probably introduced in AdvCiv 0.96. [advc.064d] Bug report
• When starting a new game after having returned to the main menu from a game where civs had signed vassal agreements, some civs in the new game had been able to contact each other from the beginning.
• The tile defense hover text for Forest and Jungle no longer gives away foreign borders in the fog of war. Bug report
• Occasional Python crash while hovering in Go-To mode. (Was only noticeable with Python exception popups enabled in CivilizationIV.ini.) Bug report
Minor balance changes:
Spoiler :
• Versailles generates Great Spy points instead of Great Merchant points; to make up, at least symbolically, for the Great Wall generating Great Merchant rather than Great Spy points. [advc.310]
• Civilized Jewelers no longer requires Mass Media, i.e. requires only Corporation as in K-Mod. [advc.200] Discussion
• Reduced the tech cost of Metal Casting by 17% and increased the cost of Optics by 10% because I don't want Optics to become that much easier to reach. Also increased the cost of Machinery a tiny bit. [advc.306] Discussion (I don't intend to move Trireme or Metal Casting in the foreseeable future; Slavery may yet move.)
• Academy, Military Academy and Scotland Yard are immune to nukes (just as settled Great People are immune). [advc.650] Idea from the "Dawn of Civilization" mod.
Minor changes concerning ice-locked coastal cities:
Spoiler :
• Can produce Work Boats only when there is a reachable water resource; other than that, all ships and Dry Dock can be produced in ice-locked cities, and no ships and no buildings in (freshwater) lakeside cities. As in previous versions, ice-locked cities need to have access to at least 10 passable water tiles to construct coastal buildings other than Dry Dock. [advc.041] Hover text for water tiles now shows "ice-locked" when this threshold isn't reached. [advc.030] Screenshot
• A friendly Fort no longer requires a route in order to connect two adjacent water tiles. (But, for any land connections, a route is still required.) [advc.124] Screenshot showing a city that will receive a trade route through this rule change
Tweaks to AI diplomacy:
Spoiler :
• Made the Open Borders relations boost a bit easier to get by increasing the impact of trade profit by 30%. [advc.130i]
• Made colonial vassals less willing to break free. They had been breaking free far too readily. (In BtS, they never break free.) [advc.112].
• Made the AI more reluctant to liberate cities to small civs (because goodwill from a much smaller civ isn't worth much). [advc.ctr]
• Made Gandhi less willing to declare war at Cautious and lower attitude. [advc.005a] Related discussion
• Adjusted AI-to-human contact delays to game speed based on the Golden Age modifier (e.g. 200% delay on Marathon). [advc.130r] Related post
• Civic trade value: Spiritual AI leaders should no longer be willing to change civics for just 5 gold. [advc.132]
Adopted some more tweaks by @Tholal from the "More Naval AI" (MNAI) mod; mostly in the AI code for units and city management. [advc.mnai]
Fully merged or mostly (Git commits at NotABug.org): 1 2 3 4 5 6
Partly merged: 1 2 3 4

UI tweaks:
Spoiler :
• Nuke animation shortened to a brief camera rumble when playing without Particle Effects and on enemy turns. In those cases, the full animation hadn't been shown correctly anyway. I might implement a separate option for shortening the animation (i.e. without having to disable Particle Effects) at a later time. Related discussion (starting at the end of the post)
• The score graph of a civ (Info screen) is now visible if that civ's demographics have ever been visible, i.e. they don't need to be currently visible. New option "Partial Score Graphs" on the "Advisors" tab of the BUG menu (disabled by default): If a civ's demographics were never visible but the civ has been known for at least 5 turns, then the score graph shows the score history since the turn on which the civ was met. (When loading a pre-0.98 savegame, as far as the score graph is concerned, civs are assumed to have just met and not to have had espionage visibility on earlier turns.) [advc.091] Idea (5th bullet from last)
• Assigning multiple promotions at once; Stack Attack; and deals canceled upon declaring war should no longer result in a loud sound. [advc.002l] (The loud war-horns sound was already addressed in some earlier update.)
• The same music track can no longer get played twice in a row. [advc.002o]
• Made sure that player colors can't clash when multiple players play the same civ. [advc.002i] Related post
Renamed leaders:
• "Pacal II" to "Pacal" [advc.005] Rationale (Wikipedia)
• "Asoka" spelled as "Ashoka" Discussion (middle of the post)

Some improvements for the "Aggressive AI (Legacy)" option:
Spoiler :
• Fixed a crash to desktop.
• Brought back the "fist" scoreboard indicator that shows which AI civs have "enough on their hands" despite not being at war with anyone. To enable the indicator, the letter 'M' needs to be added to the Column Order string on the Scores tab of the BUG menu. This has no effect when playing with the UWAI component (i.e. without the Aggressive AI option). [advc.104]
• When Aggressive AI is enabled, the War Trades alert reports status changes of the first indicator. [advc.210a]
Changes only relevant for mod-mods:
Spoiler :
• Made a few more AdvCiv, K-Mod XML tags optional. This should make it easier to merge other mods into AdvCiv.
• Added an XML tag for disabling the dynamic abilities of the Great Wall – so that mod-mods can stop the DLL from disabling some of the abilities depending on the Barbarian game options. [advc.310]
• Fixed a times-100 error that had rendered the DEMAND_BETTER_PROTECTION option (GlobalDefines_advc.xml) useless. Bug report
• Tweaked the DEMAND_BETTER_PROTECTION option as outlined here. That thread also reports a crash that may or may not be fixed now; I haven't been able to reproduce it. [advc.500b]
• Perhaps relevant for DLL modders: Made the compiler more strict by increasing the warning level from /W3 to /W4. (Though with a few level-4 warnings explicitly disabled through pragmas.) [advc.make]
Misc. code refactoring: Some, but not nearly as much as in v0.97. So, hopefully, not as many new bugs either. Also no major performance optimizations; just a couple of tweaks. (v0.99 will do more on those two fronts.)

As usually, these release notes omit a bunch of very minor changes. The Git commit history since 23 May covers everything. Note, however, that, apart from changes to starting positions, most of the significant changes up to 9 July were already included in AdvCiv 0.97c.

Thanks to @crullerdonut (although many of his suggestions are yet to be implemented), @keldath, @Lanstro, @xyx, @Leoreth, @Cruiser76, @Elkad, @Zacar and @DarkHorror for bug reports, recommendations and other feedback.
  • Like
Reactions: cobbaut
Fixes three important bugs introduced with v0.97 and graciously reported by @crullerdonut and @Lanstro:
• Space victory did not actually require Cockpit, Life Support, Stasis Chamber and Docking Bay. It was still possible to finish those components and I imagine human players have done so out of habit, but I don't think the AI has been as sporting. Bug report
• The game had crashed when an AI player tried to demand a tech in tribute from a human player who didn't have any tech to give. Bug report
• Crash when a team with a dead member became a vassal. Bug report
• (The bug preventing units from being gifted to teammates is now actually fixed; I had accidentally omitted it from v0.97b.)

Only the GameCore DLL has been modified, so, to update from v0.97b, it's enough to replace AdvCiv/Assets/CvGameCoreDLL.dll: (standard | 48 civs)

Git commit history
  • Like
Reactions: crullerdonut
For an update from version 0.97a (or 0.97), it's enough to overwrite the GameCore DLL (standard | 48 civs), Python/Screens/CvInfoScreen.py and XML/Buildings/CIV4BuildingInfos.xml – though only the DLL is important. Overwriting the whole AdvCiv folder or first deleting the old folder is also fine.

One major bug fixed in the computation of Great Person birth probabilities. Hopefully, it's the same bug – far too many Great Prophets being born – that has been reported by several players, e.g. in this post.

Plus some minor bug fixes (thanks to @Cruiser76, @dreamyeyed, @keldath, @Lanstro and @xyx):
• The mod no longer crashes at startup when all the computer's audio devices are disabled.
• Naval blockades are lifted upon player defeat. Bug report
• Reverted a K-Mod 1.37 change to AI tech trade values in team games; hadn't been correctly implemented. Bug report
Units can be gifted to teammates again. Bug report
Edit: This bugfix isn't actually included. It'll be in the next version. Or this DLL can be used, which includes the bugfix.

And a few very rare issues not quite worth mentioning here.

Minor tweaks to the selection of starting sites (Git commits 1 2 3 4).
(More significant changes in that area will be in v0.98.)

A tweak to the way that freshwater sources are added after selection of starting sites: [change id advc.108]
Sites without freshwater no longer receive an extra river or lake if there is already freshwater access on some tile adjacent to the site. Conversely, if there is no freshwater nearby and a lake is added, then the lake is placed adjacent to the site if possible. (K-Mod had often placed the extra lake two tiles away.)

Fix for a minor issue with the AI sometimes producing its second settler when no unit is available yet for escorting the settler. [advc.052] Details

Slightly increase the AI trade value of technologies from (typically) something like 0.6 gold per research point to 0.7. [advc.551]

Only relevant for mod-mods:
• Improved AI handling of per-instance unit cost modifiers in the UWAI (war planning) component. Discussion
• Better AI handling of (land) units that can't enter all terrain, especially settlers and escorts for settlers. [advc.057] Discussion
• It seems that, due to an AdvCiv bug (now fixed), Open Borders had not affected the rate of BBAI tech diffusion. (Normally entirely disabled through TechDiffusion_GlobalDefines.xml.)

Full commit history:
https://github.com/f1rpo/AdvCiv/commits/0.97b
  • Like
Reactions: Cruiser76
Bug report (thanks @dreamyeyed)

48-civ DLL (for those who need it)

Please see the 0.97 update (which I uploaded just before noticing the bug report) for the 0.97 release notes.
The only major novelty is an overhaul of city trades. Please refer to the manual (p.9) for a summary. Short summary: The AI is willing to trade with and for cities also at peacetime, still won't pay for liberation, may refuse to give up cities for various reasons, and civs need to have sufficient tile culture in order to receive a city.

The rest – lots of tweaks. Fully covered by the commit history from now (mid-May 2020) back to late July 2019; the notes below omit the very minor ones.

The 48-civ DLL can now load scenarios created by an 18-civ DLL. More generally, scenarios should work so long as all civ ids in the WorldBuilder save are less than MAX_CIV_PLAYERS in the current DLL. [change id: advc.056]
The two DLLs still aren't savegame-compatible. (And won't be; but if I ever break backward compatibility, I might increase the maximal player count of the standard DLL to some number around 30 and stop providing multiple DLLs.)

Game rules
Spoiler :
Revert the K-Mod changes to German Assembly Plant (+2 production), French Musketeer (15% withdrawal chance), Celtic Dunn (+1 XP for melee units), Mining Inc. corporation (120% maintenance). I had overlooked these when I reverted other low-impact balance changes from K-Mod. Not worth deviating from BtS for I think, at least not until a full balance overhaul is implemented. [advc.200]

Culture and revolts: [advc.101]
• The culture garrison strength of a unit, i.e. its strength against revolts, is now equal to its combat strength with the following modifiers:
- Defensive modifiers (Archery units, Garrison promotions)
- Generic strength modifiers (Combat promotions)
- Minus 50% for non-lethal units (i.e. Siege except Machine Gun).​
Previously, culture garrison strength was determined by the iCultureGarrison values set in Civ4UnitInfos.xml. Those values (now obsolete) weren't shown anywhere in the game, so this change should make the impact of garrison units on revolt probabilitiy more transparent. The nationality bar shows how much garrison strength is needed for zero revolt chance; see under UI changes.
• Adjusted the foreign culture strength formula (the other factor that determines the revolt probability) to balance out the change to culture garrison strength, and to make revolts a bit easier to suppress in the midgame and a bit harder in the late game than in AdvCiv 0.96. Added two XML parameters for fine-tuning this: FOREIGN_CULTURE_STRENGTH_FACTOR and FOREIGN_CULTURE_STRENGTH_EXPONENT (AdvCiv\Assets\XML\GlobalDefines_advc.xml)
• Decreased the impact of hurry and draft anger on foreign culture strength. Details (Git commits 1 2), discussion
• Decreased the impact of game speed on revolt probability. Since culture spread isn't speed-adjusted, I think revolt probabilities should only be partially speed-adjusted. (K-Mod introduced the speed adjustment.)
• Reduced the culture spread range of cities onto other landmasses. This tweak to the K-Mod culture spread rules avoids puzzling border shapes when cities on two different landmasses spread culture onto a third landmass. [advc.098]
• Partisans event (bugfix?): The number of partisans is now equal to the culture level of the razed city's cultural owner, starting with 1 partisan unit at Fledgling culture. Razing a size-1 city never creates partisans (this part is definitely a bugfix). Adopted from @SmokeyTheBear (thread)

Maintenance, research costs:
• Lowered the number-of-cities maintenance modifier on Huge maps a little bit and added a crowdedness modifier to account for the initial player count and sea level. [advc.140]
• The city count in the formula for number-of-cities maintenance is now capped at ca. 40 cities. (This should only be relevant for Huge maps.) The cap can be adjusted through MAX_CITY_COUNT_FOR_MAINTENANCE (AdvCiv\Assets\XML\GlobalDefines_advc.xml). [advc.exp.1] Discussion
• Lowered Ancient-era tech costs by 5% if Tribal Villages are disabled. [advc.910]
• Increased tech costs in Always-Peace games by 5% after the Ancient era. [advc.910]
• Progress toward a tech makes that tech cheaper to steal through espionage. [advc.120i] Idea from the VIP mod

AI civs start with only one free Scout on Immortal. (Basically, I don't think additional exploration units are a good way to ramp up the difficulty. Earlier versions of AdvCiv have already taken away the second free Scout on Emperor, one of the free Archers on Immortal and Deity – and the free Settler on Deity.) [advc.250e]

Terrain features:
• Global Warming (GW) can no longer remove vegetation from Grassland, meaning that only vegetation on Plains can be removed by GW. (Though successive GW events can still remove e.g. a Tundra Forest by first turning the Tundra into Grassland and the Grassland into Plains.) The Grassland protection can be disabled through PROTECT_FEATURE_ON_NON_DRY_TERRAIN (AdvCiv\Assets\XML\GlobalDefinesAlt.xml). An earlier approach was to let Forest Preserve protect vegetation; that's also still possible; see under optional changes. [advc.055] Discussion
• A city can receive (positive) health or happiness from a terrain feature or improvement only if the city owner is able to peacefully enter the tile with the feature or improvement. Meaning that Forest Preserve no longer grants happiness and health to rival cities unless there is an Open Borders agreement. [advc.901]

Barbarians can appear on Plains Hill and Tundra Hill again. The criterion is, as before, a positive food yield, but the -1 food from hills is no longer counted. I think this captures the notion of habitable land better. [advc.300] And the Great Wall graphic is now placed in a way that avoids creating "Gaza strips" wedged between the Great Wall and some other obstacle. [advc.310]

Reverted a change that had prohibited cities with insufficient air capacity from producing air units. However, when a newly completed air unit gets force-moved due to exceeded air capacity, it now has to skip one turn. If a (legal) rally point is set, the unit gets moved there rather than to the nearest legal tile. [advc.001b] Discussion


Standard map generator: These changes affect most of the official map scripts. They don't apply if a map script overrides the respective part of the map generation process.
Spoiler :
Terrain: [advc.129c]
• Slightly increased the overall frequency of plains.
• Plains tend to clump together a bit more.
• Plains can occur in the +/-10 latitude region around the equator (typically covered by Jungle).
• Deserts have a tendency to appear next to plains.
• Increased the frequency of hills a tiny bit.
These changes should make the terrain slightly more Earth-like (tropical soils aren't well suited for food production) and varied without altering gameplay much. They can be disabled by setting bEarthlike to False at the start of AdvCiv\Assets\Python\CvMapGeneratorUtil.py.

Resources: [advc.129]
• Gold, Silver, Gems and Fur are no longer restricted to appear on only one landmass.
• Decreased the probability of Gold resources getting placed in a cluster.
• Resources that are (in principle) restricted to a single landmass can also get placed on multiple small landmasses (think of the Spice Islands).

Starting site optimization ("normalization"): [advc.108]
* The "Balanced resources" map option now causes more aggressive normalization of starting locations, essentially according to the BtS rules. In particular, unrevealed resources are taken into account when deciding how much work a site needs.
* Extra resources placed near starting sites are now considered in a random order instead of the order in Civ4BonusInfos.xml.
* Decreased probability of lake starts. (Should still be more likely than in BtS but not as likely as in K-Mod.)


savemap script by @xyx and @tywiggins for exporting the map of an ongoing game as a map script. More detailed description here. AdvCiv integration:
Spoiler :
• Shortcut: Alt+Shift+M (can be disabled on the BUG menu)
• The file name gets generated from the name of the original map, its dimensions and player count.
• An on-screen message says whether and where the new file was created.
• Tries saving to AdvCiv\PrivateMaps first. If that location can't be written to, My Games\Beyond the Sword\PublicMaps is used. AdvCiv will not be able to load from the latter location unless NoCustomAssets is set to 0 in AdvCiv\AdvCiv.ini. Regardless of the location, Civ 4 needs to be restarted before an exported script can be loaded.


AI:
Spoiler :
Peace negotiation: There were problems with the UWAI component refusing to make peace or unreasonably insisting on reparations. (Some reports in that vein: 1 2 3)
• When multiple AI civs are at war with the same civ, each of them (usually) assumes that it will be the primary target of the shared enemy. (Previously, AI civs often assumed that a stronger enemy posed no immediate danger because it would go after a different target first.)
• The AI may make a small payment for peace to a stronger war enemy that probably poses no immediate danger but could be very dangerous in the medium term. (Offering a token of goodwill might help and can't really hurt.)
• The AI may pay a human player for peace even if it thinks that both sides want peace. (It's not a reasonable position to insist on a square peace treaty when continuing the war is disastrous for one side and merely inconvenient for the other.)
• Made the AI a bit more generous when paying for peace in situations when the war is going badly but not extremely badly. (For extremely bad wars, the AI still assumes that peace is unlikely to last and therefore not worth very much.)

City safety calculation (evacuation): [advc.139] Discussion 1 2 3
• The AI updates the safety status of its cities in response to moves of human war enemies. This way, the UWAI component is always up to date about city safety when asked for a peace proposal.
• The safety calculation now accounts for unassigned promotions of the city defenders and for units in production that will appear at the end of the turn.
• Made the AI less likely to leave behind more than a couple of defensive units when evacuating a city.

In the city safety calculation and most other AI code that evaluates the strength of unit stacks: [advc.159]
Per-unit strength values are taken to the power of 1.25 before getting summed up. For war planning (UWAI component), such an adjustment had long been in place, but, for tactical decisions, the implicit assumption was still that e.g. two Swordsmen are an even match for one Cuirassier.

Increase the impact of NoWarAttitude (Civ4LeaderHeadInfos.xml) probabilities that are near 50%. (UWAI doesn't treat those as probabilities; they get factored into the war utility value as part of an "affection" cost.) This should make about a third of the AI leaders noticeably more reluctant to start wars when Cautious, approximating their BtS personalities more closely. Previously, Cautious vs. Annoyed attitude rarely made a significant difference in AdvCiv apart from worst enemies.

Only AI civs in the upper third of the scoreboard consider stage 2 of the "Domination" victory strategy (was upper half). [advc.115]

Diplo memory decay:
• Simplified and corrected the decay formula for multiple remembered diplo actions. For example, two declarations of war (in short succession) are now fully forgotten by the target after an expected duration of 150+75 turns on Normal speed. Three declarations after 150+75+50 turns, etc. (geometric progression). [advc.130r]
• Memory about tech trades ("you're becoming too advanced", "you shared your discoveries") are exempt from the above, i.e. they decay as in BtS with a per-turn probability that doesn't depend on the memory count. [advc.553]
• "You shared your discoveries" is now easier to get (increased relations modifier per tech) but more difficult to sustain (faster memory decay). [advc.553]
• "You gave us help" now decays faster, i.e. with a (base) probability of 1/150 instead of 1/200. [advc.144]

AI civs contact human players more frequently with offers for resource trades. Several players had reported (mainly here) that the AI made such offers only (very) rarely. I've tweaked the heuristic for deciding whether one side needs a resource (much) more than the other (and more than other potential recipients). [advc.036]

Tribute demands: [advc.104m]
• A tribute demand may consist of multiple resources, and they don't have to be surplus resources.
• The AI takes into account its war utility value when deciding how much tribute it should at least demand.
• The order in which the AI goes through the different types of tribute demands is now properly randomized. This may lead to more demands for gold per turn – I'm not sure that these ever occurred in AdvCiv 0.96.

Air recon: Fixed a BBAI bug that had caused the recon target to be chosen randomly with a bias only for maximal distance from the airbase. And made several tweaks (Git commits 1 2). The modified code isn't used much by the AI, it's mainly for automated human units, so this is really more a UI than an AI change. [advc.650]

City placement:
• Exploration units now prioritize the surroundings of (tentative) city sites. Previously, early AI cities were often founded without exploring the full city radius, which had lead to cities that clearly weren't locally optimal. This change should also make human exploration more rewarding as AI scouts won't reach the human player as quickly and will be slower to find Tribal Villages. [advc.031d]
• AI cities cancel settler production when all city sites are taken. This should lead to fewer AI cities in poor locations that the AI normally doesn't bother to produce settlers for. [advc.031b]
• Numerous tweaks to the evaluation of city sites (Git commits 1 2) [advc.031]

Tech evaluation: slightly higher value for early-game resource yields – to account for the fact that, in the early game, owned resources are almost always workable. Prompted by this post. (More remains to be done on that front.)

Improved the evaluation of the Pyramids ability (was still as in Vanilla Civ 4). The AI will build them much sooner now than in K-Mod. Actually, I had to make the AI underrate them again quite a bit to keep them viable for human players. May still go as early as 1000 BC; seems to vary a lot. [advc.131]

Removed or tweaked various conditions under which workers build roads and railroads while moving toward a target tile – so that improvements (and railroads on Mines, Lumbermills, Quarries) get built earlier. And other tweaks for railroad construction following (some) suggestions by Elkad. [advc.121] Discussion

Placed a limit on the number of units that the AI may delete per turn in response to financial trouble. The AI tries to avoid deleting units that are headed for enemy territory. [advc.110] Discussion

Revised the AI estimate of units needed for revolt suppression. Hopeless cases are disregarded. [advc.099c]

Damaged AI units consider tile defense when deciding whether to heal. Inspired by similar changes by @Tholal in the "More Naval AI" (MNAI) mod. I've also adopted a few other tweaks (AI and other) from that mod, by Tholal and @lfgr: Git commits 1 2
I've only gone through a small portion of the MNAI commit history; there's probably a good deal more that AdvCiv could adopt.


UI:
Spoiler :
The game auto-saves at the start of a human player turn, not at the start of the game turn. This makes a difference when a human player isn't first in the turn order, e.g. in scenarios. [advc.044]

Improved UI support for revolts: [advc.101]
• Added hover text on the main map and city screen (nationality bar) showing how much more garrison strength is needed to reduce a city's revolt chance to 0, or how much garrison strength can be safely removed. Idea by @Elkad
• "Grievances" that increase foreign culture strength, i.e. hurry anger, draft anger and foreign religion (if not countered by the owner's state religion), are stated in the hover text of the nationality bar.

Happiness and health effect in tile hover text: [advc.059]
• Happiness is shown when hovering over a Forest Preserve in the radius of a city owned by the active (human) player or over a tile owned by the active player in the radius of any revealed city. (BtS never shows the happiness effect of Forest Preserve in tile hover text.)
• When hovering over a Worker build button, the change in happiness (Forest Preserve) and health (chopping) that the build will cause is shown. (BULL has a similar feature.)

Sieges:
• When a city owned by the active (human) player gets bombarded, an interface message gets shown immediately (previously: not until the start of the human turn) and (idea from the MNAI mod) the name of the bombarding unit is included. [advc.004g]
• Help text for Walls and Castle says that defense is "raised to" 50% and 100% respectively. (This is implemented through a new XML tag DefenseRaise that replaces the cumulative DefenseModifier tag. Mod-mods can keep using the old tag.) [advc.004c]
• When hovering for combat odds and the only (otherwise) valid defenders are maximally damaged, the combat help text says so and states the attacker's damage limit. [advc.089]
• The number of collateral damage targets (iCollateralDamageMaxUnits in Civ4UnitInfos.xml) gets shown in unit help text. [advc.004]

The pathfinder should no longer propose paths that pass through more tiles than necessary. [advc.pf] Discussion

When hovering for movement into terrain that one of the selected units (e.g. Workboat) cannot enter, help text says which technology, if any, (e.g. Astronomy) would allow the move or if being the owner of the tile would help. [advc.057]

Darkened the color of the Great Person bar; was 100% yellow. [advc.002i]

The Settings tab (Victory screen) and the first replay message both list those custom map options that differ from the default. For example, if "Cylindrical" is the default world-wrap, then "Cylindrical" wouldn't be listed, but "Toroidal" would be listed. [advc.004, advc.106h]

Field-of-view slider: [advc.090]
• Made the bar slightly longer, which makes it a bit easier to set the slider to a particular value. (However, I haven't been able to fix the bug that can make the slider slip away when the mouse button is released.)
• When increased above 75%, the slider becomes more sensitive. This should allow Huge maps to be fully displayed without switching to Globe view (e.g. for AI Auto Play or a screenshot).

When the active player is defeated during AI Auto Play, the player with the next highest id automatically becomes the active player; AI Auto Play continues uninterrupted. [advc.127]

Option for Sea Patrol mission button added to the BUG menu. The button was previously disabled through the DLL; it's still disabled by default. [advc.004k]


Bugfixes: [advc.001]
In pre-AdvCiv code:
Spoiler :
(Vanilla) The Taj Mahal no longer grants an extra Golden Age turn when completed during a Golden Age. Moreover, a Golden Age started by the Taj Mahal doesn't start until the beginning of the owner's next turn. (Previously, it started during the end-of-turn sequence, already affecting the :hammers: and :gp: generated at the end of the turn.) [advc.001x]
(Vanila/ AdvCiv) Great Person birth modifiers from buildings (e.g. National Epic) had not affected birth probabilities. As a result, the birth probabilities displayed by AdvCiv were sometimes way off. [advc.001c] Discussion
(BtS) When deciding whether to monopolize a tech ("don't want to trade just yet"), code that was supposed to check for a war plan against the recipient of the tech had instead checked for a war plan against anyone.
(K-Mod) Erroneous uses of AI strategy bitmasks had lead to (minor?) errors in the AI evaluation of Cottages and commerce yields in general.
(K-Mod 1.44) The AI had used the "Big Espionage" strategy (far) too often because of a feedback loop between that strategy and the espionage commerce weight. I've also made some tweaks that further lower the AI espionage commerce weight. [advc.120]
(K-Mod 1.45) Angry citizens had consumed food even during the production of a worker or settler. (Not how it's supposed to work.)

In older AdvCiv code:
Spoiler :
• AI cities hadn't taken the Apostolic Palace's production bonus into account when evaluating Temples and Monasteries.
• The tech cost adjustment for the "No Tech Trading" option had had no effect. [advc.550d]
• Potential for out-of-sync errors resulting from AI city safety data not being stored in savegames. [advc.139]
• When forming a Permanent Alliance, the allies had lost their vassals.
• One aspect of the war utility computation, "fidelity", had been ignored by UWAI. It's supposed to stop the AI from making peace shortly after bringing in a war ally.
• UWAI had sometimes overestimated the offensive power of an AI civ when units originally produced for offensive purposes were in fact filling in as city defenders.
• Several more or less rare issues with city production getting interrupted upon border expansion, connecting a resource, declaring war or receiving a tech through trade. [advc.064d]
• Issues with the fly-out scoreboard: [advc.085]
- Drop in frame rate and lag in animations while the scoreboard was expanded. (This problem is not 100% fixed. Moving the cursor around in a particular pattern still seems to cause the frame rate to drop.)
- If the scoreboard gets expanded during diplomacy, instead of flickering, it now stays expanded until the diplo screen has been closed. (More a workaround than a bugfix.)​
• Various mixups of player and team ids. Those had some negative effect in team games, but I'm not sure how much trouble they had caused.
• Coastal roads had sometimes established a trade connection with adjacent coastal water. That's only supposed to happen in the special case of tiles workable by a city on a different landmass. [advc.124]
• The AI was able to ask humans for a free technology prior to Alphabet.
• AI units guarding a city site were sometimes (rarely?) moving back and forth between two tiles. [advc.300]
• Possible crash upon force-war votes (Apostolic Palace) affecting dead players.
• The Top Civs popup (e.g. "the most advanced civilizations") should no longer start appearing once half of the civs have been eliminated.


Many thanks to the players and fellow modders who have pointed out these and other issues and offered advice, in particular:
@Elkad, @SuperXANA, @carp, @VDNKh, @keldath, @xyx, @Pepo, @Cruiser76, @devolution, @Nightinggale, @Leoreth, @PieceOfMind

Optional changes (disabled or unused by default):
Spoiler :
Penalty on "ground-breaking" research as a rubber band/ catch-up mechanism. Based loosely upon @Leoreth's getSpreadResearchModifier function (Dawn of Civilization mod). See comments in TechDiffusion_GlobalDefines.xml for most of the specifics. [advc.groundbr] Discussion (on and off over several pages)

Tags added to Civ4ImprovementInfos.xml:
• Terrain improvements can grant health through the HealthPercent tag. (I plan to use this for Forest Preserve eventually.) [advc.901]
• Terrain improvements can protect vegetation from Global Warming through the GWFeatureProtection tag. Based on a suggestion from @Cruiser76. If this is used, then PROTECT_FEATURE_ON_NON_DRY_TERRAIN (GlobalDefinesAlt.xml) should probably be disabled. [advc.055]

The TerrainImpassables and FeatureImpassables tags don't apply to owned tiles even for land units. (Not relevant in BtS/AdvCiv because only sea units have impassable terrain (Ocean). [advc.057] Discussion

Minimap in replay:
REPLAY_TEXTURE_ERA in GlobalDefines_advc.xml allows storing a terrain texture for the replay file before the game is over so that the replay minimap doesn't reflect e.g. terrain changes from global warming. [advc.106n] Discussion
• Added a comment to GlobalDefines_advc.xml about increasing the resolution of the minimap through MINIMAP_RENDER_SIZE. [advc.106m]

Civ4LeaderHeadInfos.xml now contains a special LeaderHeadInfo element "LEADER_DEFAULTS" that sets default values for all non-mandatory elements. The LEADER_DEFAULTS element isn't required; mod-mods with custom leaders shouldn't have to change anything. [advc.xmldefault]


Performance optimizations: Turn times have been reduced to about 2/3 of AdvCiv 0.96 in tests with 18 civs. (But scalability problems of the UWAI component with far more than 18 civs still haven't been addressed.) The saved time is mostly due to low-level optimizations:
Spoiler :
• Function inlining [advc.inl],
• caching, avoiding unnecessary branching, reordering of conditions [advc.opt]
• memory use – collapsing zeroed arrays to avoid CPU cache misses. [advc.003t]
Regarding the last point, I've adopted a couple of ideas by @billw2015 from Caveman2Cosmos, but, more importantly, I've added @Nightinggale's EnumMap from the "We the People" mod, replacing some of the naked arrays in BtS code. It's a major improvement in readability and safety and a notable improvement in performance – despite being used only in a few AdvCiv classes so far.


Refactoring - an overview (maybe) for other modders; not relevant for players. To make the CvGameCore code easier to maintain and extend.
Spoiler :
Much of the code for "info enums" (enum types used for ids of objects storing data loaded from XML) is now generated by the preprocessor. This was helpful for integrating the EnumMap class mentioned under optimizations.
Expanded the use of enum types for ids a bit more, and added a macro for (somewhat) type-safe bitmasks. Through operator overloading, the linker now detects (suspicious) comparisons between certain enum types, in particular between player and team ids. [advc.enum]

The code for caching GlobalDefines (including Python callback guards) also gets generated by the preprocessor. This makes it much easier to cache additional defines. I've tried the same approach for implementing new XML tags on the DLL side. That's currently limited to simple integer and boolean XML elements and not as convenient as I'd like, but still avoids a lot of boilerplate code. I've been using it for the tags added in AdvCiv 0.97. [advc.tag]

Class ScaledInt (yet to be renamed to "ScaledNum") for fixed-point arithmetic, which is safe wrt. network synchronization. (There's not much of a point in that for AdvCiv so long as the mod still uses floating-point math extensively in the UWAI component.) I use ScaledInt in many of the AI calculations that I've added or modified this spring, and I'm quite happy with it in terms of usability and performance.

Most of the frequently needed types of loops can now be written more safely and concisely through
FOR_EACH macros (cities, units, selection groups, areas, deals, enum values) [advc.003s, advc.enum]
• or iterators (players, teams, plots). [advc.agent, advc.plotr]
In some cases, i've updated the entire code base to use the new syntax, in others, the process is ongoing. The FOR_EACH_ENUM macro is mostly @Nightinggale's work.

Made all base class declarations of virtual AI functions private, moved them to the bottom of their header files and created wrapper functions that make it easier and safer to modify the AI functions. Added some getter functions for obtaining references to AI objects in order to get by without the base class declarations. [advc.003u]
Untangled some header dependencies, especially dependencies on AI headers. [advc.003u]

Identified 5 more (total now 7) classes that get allocated by the EXE and therefore must retain their BtS memory layout. Added static assertions as a protection against memory corruptions (which are very difficult to track down). [advc.003k]

Split up CvInfos.h/.cpp into 17 + 17 separate header and implementation files. [advc.003x]

Moved the AI code for city site evaluation out of the CvPlayerAI class. In terms of splitting up large files, especially CvPlayerAI.cpp, a lot more could be done.

Moved bulky, repetitive code that sets up Python calls into a helper class. [advc.py]

Added plenty of const qualifiers and moved toward using references instead of pointers when appropriate.

Local improvements: Removal of duplicate code, removal of unused code, renamed identifiers.


Build system (no major changes) and debugging – both only relevant for developers:
Spoiler :
Build: [advc.make]
• Moved profiler settings to Makefile.project.
• Profiling code based on the Time Stamp Counter adopted from "We the People" (@Nightinggale). [advc.003o]
• Configuration debug-opt (debug symbols + compiler optimizations) added for inspecting optimized disassembly.
• Parallel debug builds (following @billw2015's suggestion)
• Some inlining allowed in debug builds (Ob1 compiler option), making them ca. 30% faster.

Debugging:
• Added code for testing whether an AI Auto Play sequence is reproducible. Mainly for finding uses of uninitialized memory or other non-deterministic code. [advc.repro]
GameFont Display by @Nightinggale added. No immediate use, but might become helpful in the future.
• Can log some basic statistics (land/ sea ratio, terrain, elevation and resource frequencies, resources per player) after map generation. [advc.mapstat]
• Can log a breakdown of the AI evaluation of city sites. [advc.031c]
• The manual includes a crib sheet about the various log files introduced by mods and from the original game (under id "007" in the changelog portion of the manual).
• Some tweaks to assertion popups: [advc.006]
- Include the function name in the error message. From Caveman2Cosmos (@billw2015)
- On a failed assertion while debugging, re-evaluate the condition, so that the user can immediately step through the evaluation. [advc.006h]
- Warn about empty int/bool/float XML elements. (from MNAI) [advc.006d]
- Don't show a spurious "current XML file" in assertion popups when XML loading has already finished. In part from MNAI [advc.006e], in part from @rheinig's mod. I've also adopted some tweaks to modular XML loading from the latter.​

Top Bottom