Version 1.00 discussion thread

jdog5000

Revolutionary
Joined
Nov 25, 2003
Messages
2,601
Location
California
(You can always get the latest stable release from the download thread or sourceforge. Development versions and updated source code can also be checked out from sourceforge.)

[party]Version 1.00[party]

This is version 1.00 because it has a compilation of several big new systems that I've been working on for a while, and a giant leap forward for the BTS AI. Here's just a couple of highlights:
  1. New victory strategy system, so AI actually goes for conquest and space victories
  2. Major overhaul of AI city attack stack logic and ability to defend itself
  3. AI now weighs having stacks walk or sail in transports
  4. Lead from Behind 1.2 added to help AI preserve key units
  5. And a lot more ...
BBAI 1.00 is significantly faster than any previous BBAI release. It plays turns on a Huge Earth scenario with 18 civs in the year 1980 in just under 30 seconds, a 15% improvement over version 0.8x and a hair faster than the UP and plain BTS. Finally, there are also a couple key bug fixes, plus UP 1.5 of course.

I'm not sure if work on the AI could every really be finished, and certainly there are some big things I'd still like to do (centralized wonder selection, nuke decision making, tech selection system). However, usually when I package up a release I immediately start thinking about the next important piece. This release has come far enough that I think I'll pause and play through a couple whole games myself ... that was very hard to do when all I would see were AI weaknesses and deficiencies, but the project really has made immense progress and I think I might actually be able to play through a whole game or two. :)

Since this is a big milestone, I'd also like to thank and acknowledge a few fellow modders who helped make this a reality one way or another. Much credit goes to Blake and Iustus who really pioneered fan-developed AI, Blake's work made a huge impact on the Civ4 AI leading up to BTS and his example was one inspiration for this project. Also special thanks to Yakk and glider1 for batting around ideas to fix the original closeness bug which really got this all started. I would also like to thank the others who one way or another helped me get into modding, taught me some useful tricks, or otherwise helped make the last four years of Civ modding such a great experience: Kael, Solver, TheLopez, DrElmerGiggles, Dom Pedro II, EmperorFool, glider1, phungus420. And, of course, this mod would not be where it is today without the great community here on the forum and everyone who has posted bugs, ideas, and engaged in our discussions. Thank you!

Enjoy!

New in Better BTS AI 1.00
Spoiler :

Merged in Unoffical Patch 1.50
Added the Lead From Behind mod 1.2 by UncutDragon (improves selection of order for attack for both human and AI stacks, preserving GG, medics, experienced units)
Added CIV4LeaderHeadInfos.xml and CIV4CivilizationsSchema.xml to mod files for new victory strategy system

Bugfix
- Fixed divide by 0 issue with debug text which could cause crashes in debug logging when loading world builder scenarios using a non-Final_Release DLL
- Fixed bug (introduced) where giving pillage orders to a stack or multi-move unit would pillage multiple times
- Fixed bug (introduced) allowing ships to move diagonally over isthmuses under some circumstances
- Fixed bug (introduced) slowing AI expansion, especially on Archipelago maps
- Fixed bug where AI units could sleep indefinitely when using debug tools like ChangePlayer and AIAutoPlay
- Fixed issues with rounding off small commerce amounts leading to AI or governor working suboptimal tiles/specialists in some circumstances (reported by Caboose)
- Fixed bug in calculation of city closeness where city would consider its closeness to itself, so cities can now properly tell when they are close to other cities in their owner's empire (should now see more AI city razing)

Victory Strategy AI
- Switched all cultural victory logic to new victory strategy framework
- AIs gunning for cultural victory now much less likely to declare war the closer they get, biggest reduction for TOTAL war, smaller reduction for DOGPILE
- AIs in late stages of cultural victory more willing to agree to peace
- Updated close to cultural victory detection so that AIs who haven't been trying but get reasonably close will pursue it, and so that they can detect when human player is pursuing this strategy
- First complete implementation of AI victory strategy framework for Conquest, Domination, Space, and Diplomacy
- Levels 3 & 4 of each victory strategy are now based on observables, not hidden AI leader tendencies. So, other AIs can now understand when other AIs are going for a particular victory, and it also serves as an estimate of what the human player is doing.
- AIs going for CONQUEST and DOMINATION victories willing to spend more gold on units
- Improved existing system for AI going for DOMINATION to build health buildings to help boost pop
- AIs going for culture/space now put defensive spies in important cities

War strategy AI
- AI now detects when other players are close to victory and greatly boosts start war value against them (still plays within leader's attitude no war probabilities, so won't declare on friendly)
- If enemy is (still) running higher levels of CULTURE or SPACE victory, AI will not accept capitulation until it ruins the enemies chance of winning
- AIs running highest levels of CONQUEST and DOMINATION strategies may ignore leader's attitude no war probabilities and attack highest value target
- AI calculations of the state of their wars now work better with minor civs (for mods)
- Smoothed AI valuation of how much bombard strength it needs to build for its attack stacks, upped desired bombard strength in era of walls and castles. AI should now produce considerably more siege, especially the bigger AIs.
- Reduced AI valuation of interception probability as criteria for UNITAI_COUNTER units, to reduce drive to switch infantry to SAM
- AI now won't start air blitz build logic until it can build bombers (previously started with fighters)
- Added AI_STRATEGY_ALERT1 and AI_STRATEGY_ALERT2, AI will now analyze if it might be attacked in the near future and take pre-emptive action
- AI now generates extra defence in its high culture cities a bit earlier when going for cultural victory
- Removed some of the reductions to defender builds when AI is running AI_STRATEGY_GET_BETTER_UNITS (should help AI defend itself early in game)
- Added AI_STRATEGY_TURTLE implementation, if AI is badly outgunned and either recently attacked or losing badly, it will use any offensive stacks it has for defense and go into a defensive survival shell
- AI now plans ahead to counter units of enemies it is preparing for war against based on what it can see
- Added function so AI can calculate the air power of its rivals
- Corrected AI valuation on interception abilities for UNITAI_COUNTER units so that it doesn't switch Infantry to SAM until rivals have air units
- Adjusted Dagger and Crush strategy thresholds so if AI has started them it is more likely to keep them up
- AI will not do Crush if also doing ALERT2
- AI will now better defends its first few cities after invading a rivals continent
- Reduced effect of having vassals on AI aggressiveness (victory strategies replace this)
- AIs at war and looking for second front now adjusts it's power down for current enemies, and prefers weaker opponents
- AI will now always start last stand strategy after it launches space ship, even if other players haven't launched yet
- AI now much more willing to start final war strategy if enemy launches spaceship, if either Aggressive AI is on or AI is close to winning itself
- Vastly sped up AI war planning/declaration process in end of game situations, particularly enemy spaceship launch
- AI now targets cultural victory cities, capital if enemy is going for space

War tactics AI
- Tweaked AI_finalOddsThreshold to reduce suicide attacks in stack v stack combat, especially at sea
- Reworked AI logic for when to raze cities it conquers
- Rewrote logic in AI_attackCityMove so AI stacks behave more intelligently around enemy cities, will pillage if not strong enough to attack or choke from defensive terrain if outgunned
- AI carriers will now move to support/air defend ground troops, support invasions
- AI now values active wonders a little more in deciding cities to target
- Fixed bug where AI would over value holy cities of religions other than its state religion
- Upped threat cities feel when they are next to much more powerful rivals
- The strategy FAST_MOVERS no longer limits the AI from forming main stacks of mixed fast and slow units, but it will still form small fast attack groups
- Augmented the strategy LAND_BLITZ, a more restrictive case of FAST_MOVERS, so that main stacks will be made of multi-move units when possible in the modern era
- Fixed bug blocking under many circumstances AI from using logic to attack without bombarding when bombarding will take a long time
- Fixed bugs in AI calculations of how many turns they need to bombard defenses
- AI will now pillage with healthy, fast, non-bombard units in stack first
- AI will now pillage plot it is on before bombarding city (since need to bombard means there's a chance it won't take city)
- AI_choke now works better for multiple units if head unit is no defensive bonus, won't accidentally attack enemy units
- Added function for AI attack stacks to pillage around target city to buy time if not strong enough to attack. Favors pillaging defensive terrain
- AI attack stacks load in transports if land path is too long
- Added option to AI_anyAttack to block attacking cities
- Attack city stacks will now considering taking transports if overland path is long
- Tactical nukes retreat better from cities when threatened
- AI now moves missles safely
- Fixed issues causing AI to rebase missles into empty forts
- AI attack stacks now do not head out for conquest unless they have some non-seige units which can capture cities
- AI attack stacks will wait for unit upgrades before heading out for conquest (helps most when AI has just been surprise attacked)
- AI attack units will now more readily band together in threatened cities and go after enemy units applying a choke

Unit AI
- Greatly improved speed and turn efficiency for loading of large stacks onto many transports
- AI pillage units now value healing in enemy territory more
- AI should now promote a few more units to medics

Naval AI
- Assault transports no longer set off to join transport groups already mounting assaults
- When assault transports head out for invasion, other transport groups which were going to join them will now pick a new mission
- Improved handling for when multiple transports are moving to pickup a stack of stranded units, the closest set of transports will now get the task
- Loaded transports with no escorts now try to join a local flotilla first
- Loaded transports with no escorts will now wait if there are waiting escorts on the same plot (catches case where transport just got troops loaded last turn, takes off before escorts can react)

Pirate AI
- Reduced suicide of pirateers starting from inside their own borders

Worker AI
- Fixed several issues and improved efficiency of CvUnitAI::AI_nextCityToImprove

City AI
- When at war, AI now is less zealotful in building production buildings. They have to be able to be completed faster, and it will only start them probabilistically so not all cities will be building them at once
- Improved AI city build decisions when empire is under seige, especially for small empires
- Added calculations of actual health/happy effects of buildings from BUG mod (thanks EmperorFool)
- Fixed logic bugs in AI valuation of when happy or healthy from buildings was extra important
- AI now actually considers health effects of power, dirty power, coal, and oil
- Reworked AI valuation of buildings with health effects so all effects are considered
- Buildings with negative health effects are now strongly avoided if city has health problems
- AI now better evaluates when building bAreaCleanPower building is useful
- Reworked AI valuation of buildings with happiness effects so all effects are considered
- Buildings with negative happiness effects are now strongly avoided if city has happiness problems
- AI now values buildings which reduce war weariness, previously only avoided buildings which increased it
- AI now values religious buildings for AP religion more than other relgious buildings based on boosted yield
- AI now values religious buildings for state religion more than other religious buildings based on yield boosts from wonders
- Tweaks to help AI build mobile defense/counter attack force when outgunned
- Lowered max build turn limit for high priority production buildings when AI is in a tough war
- AI will now probably only build one workboat using very early capital logic as originally intended (speeds expansion in water resource heavy starts)
- Resolved issues where AI early game build logic would get confused because Warriors cannot be built as UNITAI_CITY_DEFENSE
- Improved AI logic for when to conscript defenders, AI now conscripts less unless it is in dire situation. Tied in with TURTLE strategy
- AI now will build more attack units to break a choke
- Fixed issue where AI cities with lots of food available would not avoid growth when angry under some circumstances

Tech AI
- Separated out building and unit valuation into own function for debugging and future efforts
- Adjusted valuation of tech based on units enabled, boost to defensive units under ALERT and TURTLE and offensive when going for conquest victory
- AIs going for DOMINATION victory will aim for Galleons earlier
- AIs going for SPACE emphasize getting Apollo earlier
- AIs with Apollo now better emphasize getting techs for parts
- AIs with high odds of starting a total war now value units as if always at war

Civic AI
- If AI is leader of AP, it now values state religion civics more
- AI now values benefits it receives from wonders for state religion buildings when computing value for state religion civics
- AIs with high odds of starting a total war now stay in militaristic civics during short peace intervals
- AIs will now more often stay with peaceful civics when engaged in wars they're not really committed to, not losing

Diplomacy AI
- All AIs will check more frequently for tech trades when well behind in tech race, biggest benefit for those who typically wait longest

Gold AI
- Improved AI budgeting for unit upgrades in scenarios, advanced start

Missionary AI
- Fixed issues and improved logic in AI usage of MISSIONARY strategy (religious full-court press)

Great People AI
- AI Great Generals will no longer lead units which can't kill enemy units such as catapults
- Great Generals are always willing to lead units whose class has MaxGlobalInstances set regardless of UNITAI (for mods)

Barbarian AI
- No barb stacks sitting on goody huts, only single units
- If barbs have upper hand in an area (like new world), then they'll group stacks more actively

General AI
- Changed player consistent random method for picking strategies from being based on capital city location to a stored rand, so AI player tendencies will be consistent even if capital moves
- Changed how building defense is handled when unit is estimating its defensive strength against unknown attacker (CvUnit::maxCombatStr(pPlot,NULL)). Firaxis took conservative approach and always ignored defense in this case (so defensive strength could be considerably higher in castled low culture city). This lead to AIs suiciding stacks on city walls in early/mid game. New method is to use ignoreBuildingDefense flag of defender which should have fewer fatal side effects.

Player Interface
- Added automate explore option for spies

Efficiency
- Several efficiency improvements were added with Lead From Behind
- Improved efficiency of several unit motion selection loops, reducing number of calls to generatePath

Customization
- Split GlobalDefinesAlt.xml into a few separate files by type
- Improved handling of default values for new BBAI variables in case xml files are accidentally missing or something
- Tweaked variables for AI stack attacks of cities to reduce suicides
- Added BBAI_TURTLE_ENEMY_POWER_RATIO to BBAI_AI_Variables
- Added BBAI_VICTORY_STRATEGY_CONQUEST, etc to BBAI_Game_Options so that you can turn off any parts of the new AI playing to win logic that you wish. The code already checks for whether the victories are enabled or blocked by other things like the always peace option, so this is really just for if you don't like how it plays for some reason.
- Changed BBAI_ALLIANCE_OPTION to BBAI_DEFENSIVE_PACT_BEHAVIOR, now has three options

CvUnitInfos.xml
- Returned UNITAI_CITY_DEFENSE to Roman Praetorians
- Returned work boats to original tags of military support (exploit) and military production (faster with drydock) (thanks Fuyu)

CIV4LeaderHeadInfos.xml
- Added new AI weights for five victory strategies
 
Yes, I know how you feel. Daryn and I have yet to get past the middle of the tech tree in a game now for a very long time, because new versions of BBAI kept getting released and because I kept wanting to make major upgrades to my full mod on top of that. Believe it or not, MongooseMod 3.5... which I'm going to release soon, I swear... feels very much the same: not yet finished, but getting there; all major weaknesses in Civ4 as a whole, modding-standpoint-wise, finally tackled. Obviously without BBAI I wouldn't have stuck with this nearly as long as I have (and even then I got completely dragged away by other games the last 3 months heh), so... thank you as well dood.

Now the moment I've been dreading... I have the daunting task of merging my codebase with yours once again, a process which takes 4 hours when you've posted a relatively SMALL update... *gulp*
 
Wow. That is one huge list, jdog!! Congrats for finally finishing 1.00. You deserve a couple of games, that's for sure! :p

Now onto the great task of merging this in with current mods... *dons gloves and wielding helmet*
 
Do I need to make some changes to my makefile that are needed for this version?

EDIT: Compiling but got error about CvTeam::declareWar. In CvTeam.h it is defined like this:
Code:
	DllExport void declareWar(TeamTypes eTeam, bool bNewDiplo, WarPlanTypes eWarPlan);
But in CvTeam.cpp the function looks like this:
Code:
void CvTeam::declareWar(TeamTypes eTeam, bool bNewDiplo, WarPlanTypes eWarPlan, [B]bool bCancelPacts[/B])
bool bCancelPacts isn't defined in the header file. :nono:
 
Great job Jdog! Thanks to you an everybody who helped you creating this.
 
Does it say 1.00e? Then that change should be there. Unless jdog forgot to pack the latest code into that zip, in which case you'll have to get the sources from svn.
Anyway..
Thank you, jdog, and keep up the good work. But playing is good too, I haven't done much of that myself either lately -_-
Now onto the great task of merging this in with current mods... *dons gloves and wielding helmet*
The obvious merge is already done:
 
Interesting, because I downloaded mine from our database. It says it's version 1.00 and and in team.h bCancelPacts is missing.

Yep, I got mine from CivFanatics and my header was missing the 4th argument as well, however all but one of the many places that call the function only pass 3 args anyway so I just removed the extra one and used the value used in the one place that does call it with 4 args. Hopefully nothing else about the files was non-current.

Two other notes... JDog you snarfed my getNumActiveWorldWonders() function in CvCity (changing iValue to iCount lol), and my multi-Holy functionality in CvPlayerAI but without the function. Minor rewrite to code an extra bonus for a state-religion-holy-city, but otherwise that's exactly my AITargetCityValueFix component. C'mon, don't be a llama. :p

Secondly, you have a BBAI ToDo comment, not sure how new it is but my first time seeing it I think, expressing confusion about the vanilla civic upkeep code in CvPlayer::getSingleCivicUpkeep(). If you read the description for my CivicUpkeepMod component, that explains what the vanilla code is doing... it is pretty stupid imo, but for what it's trying to do the code is correct heh.
 
I compared the zip with the SVN and it looks like CvTeam.h is the only non-current file, with this one line being the only difference. I WAS going to do exactly what it does to try and fix it, but I couldn't remember how to define an optional function argument... I feel very stupid right now. At least what I did will still work lol, but talk about doing it the hard way.
 
I compared the zip with the SVN and it looks like CvTeam.h is the only non-current file, with this one line being the only difference. I WAS going to do exactly what it does to try and fix it, but I couldn't remember how to define an optional function argument... I feel very stupid right now. At least what I did will still work lol, but talk about doing it the hard way.

Well that's good to know. Thanks for checking it.
By looking at the SVN it seems that jdog meant the bCancelPacts to be true in most cases. So if you want to add the 4th argument without adding it to all other calls, you can set a value to it in CvTeam.h where you define it:
Code:
	DllExport void declareWar(TeamTypes eTeam, bool bNewDiplo, WarPlanTypes eWarPlan, [B]bool bCancelPacts = true[/B]);
 
(...) that's exactly my AITargetCityValueFix component. C'mon, don't be a llama. :p
Yes that's the component. Why is he llama now, your fixes have had the destiny to become part of the Unofficial Patch since the beginning of time (as long as they don't break savegames - otherwise your GPP fix would be included too by now).
This time, I was to one to suggest them but I'm confident they would have found their way into the UP without me just as well. So, when are you releasing 3.5 ? ;)
 
Do I need to make some changes to my makefile that are needed for this version?

EDIT: Compiling but got error about CvTeam::declareWar. In CvTeam.h it is defined like this:
Code:
	DllExport void declareWar(TeamTypes eTeam, bool bNewDiplo, WarPlanTypes eWarPlan);
But in CvTeam.cpp the function looks like this:
Code:
void CvTeam::declareWar(TeamTypes eTeam, bool bNewDiplo, WarPlanTypes eWarPlan, [B]bool bCancelPacts[/B])
bool bCancelPacts isn't defined in the header file. :nono:

Sorry, that one file slipped through when I zipped the source code. Fixed.

Two other notes... JDog you snarfed my getNumActiveWorldWonders() function in CvCity (changing iValue to iCount lol), and my multi-Holy functionality in CvPlayerAI but without the function. Minor rewrite to code an extra bonus for a state-religion-holy-city, but otherwise that's exactly my AITargetCityValueFix component. C'mon, don't be a llama. :p

Secondly, you have a BBAI ToDo comment, not sure how new it is but my first time seeing it I think, expressing confusion about the vanilla civic upkeep code in CvPlayer::getSingleCivicUpkeep(). If you read the description for my CivicUpkeepMod component, that explains what the vanilla code is doing... it is pretty stupid imo, but for what it's trying to do the code is correct heh.

Sorry, should have given you credit for those. FWIW, I think I wrote myself a note to handle that in the UP, then when it came time to implement didn't remember that you'd already done it and I then reinvented the wheel. I just added the appropriate comments.

Thanks for the heads up about CvPlayer::getSingleCivicUpkeep, that code looks truly bizarre ... I'm glad you figured out that it's working properly, might have to take another look at that later.
 
Impressive changelog!

I'm not sure if work on the AI could every really be finished, and certainly there are some big things I'd still like to do (centralized wonder selection, nuke decision making, tech selection system). However, usually when I package up a release I immediately start thinking about the next important piece. This release has come far enough that I think I'll pause and play through a couple whole games myself ... that was very hard to do when all I would see were AI weaknesses and deficiencies, but the project really has made immense progress and I think I might actually be able to play through a whole game or two. :)

Suggestion for the future: :mischief:

- AttackSea have pretty low attack odds threshold ... how to coordinate buildup of naval strength to take out strong enemy units?
 
Wow, this is huge jdog. Have some fun with your reinvented game. :goodjob:
 
Yes that's the component. Why is he llama now, your fixes have had the destiny to become part of the Unofficial Patch since the beginning of time (as long as they don't break savegames - otherwise your GPP fix would be included too by now).

He was a llama cuz he didn't give me any credit for it like he usually does. Which he now has. So now he's a giant flaming demon llama! ... That's a good thing, means he can go out and conquer the universe. *ahem* Nevermind.

So, when are you releasing 3.5 ? ;)

Ooh, didn't know anyone cared enough to post about it. :) Well I'm still working on it, have been for about the last two weeks, I'm hoping to be finished enough to be able to start a new game with Daryn either late tonight or tomorrow sometime, then I have a few days of work to do on things I can do post-start without harming anything, then I'll need a day or two to make a public version (gotta strip out all the copyrighted music I'm using in the era soundtracks in my private version for example) and finish writing the descriptions in my thread... And it wouldn't hurt to test everything for a while in this new game we're starting; BBAI 1.0 + all my code was no simple merge, it went pretty smoothly overall but not perfectly (and did take around 6 hours, as I feared lol). So yeah, hopefully within 2-3 weeks, we'll see.

Sorry, should have given you credit for those. FWIW, I think I wrote myself a note to handle that in the UP, then when it came time to implement didn't remember that you'd already done it and I then reinvented the wheel. I just added the appropriate comments.

Yeah I figured it was something like that... or else that someone else had snarfed it in their mod and you took it directly from there without knowing. Thanks dood! I wuv yew. *hugzors*

Thanks for the heads up about CvPlayer::getSingleCivicUpkeep, that code looks truly bizarre ... I'm glad you figured out that it's working properly, might have to take another look at that later.

I found that mess a number of months ago (with much the same reaction lol), and if you analyze their code you can eventually figure out what it's doing... Basically it makes it so the further left in the Civics Advisor a civic column is, the more expensive all civics in that column are relative to other further-right categories. So that Government civics, even the Low Upkeep ones, probably cost more than High Upkeep Religion ones, for example. That's the main effect, it may be doing something else too I forget. But yeah my little component just took all that out basically, and made X Upkeep cost the same regardless of which civic type it was in, b/c playing with it the vanilla way was driving me nuts. It also made balancing the vanilla civics, and my mod's additional civics, a big pain because I would've had to balance their effects against gold costs that varied over a much wider range than the differences in the relative power of the civics do.

Edit: Lemme add another example cuz I wanna be extremely clear about this. I would describe the actual cost variance across columns with the vanilla code as "moderate", however assume for a moment that it was a more extreme difference. Every civic and thus group of civics has a range of gold costs for its upkeep levels that could be considered appropriate for the effects those civics have on your empire. Say you balance a far-right column first, giving it approximately-right gold costs to make players consider whether to use them or not depending on their situation. Now, if you do that, with the more extreme variance the far-left columns would instantly become prohibitively-expensive, and no one would ever use them even if they wanted to b/c they just couldn't afford it. Alternatively, say you balance a far-left category first... now the far-right ones are nearly free to use, everyone will use them automatically in every game, and people may even rush to them in the tech tree just so they can get their free empire boosts sooner. The effect isn't this drastic with vanilla's moderate variation in cost but it IS the same effect, which is bad. QED.
 
I found that mess a number of months ago (with much the same reaction lol), and if you analyze their code you can eventually figure out what it's doing... Basically it makes it so the further left in the Civics Advisor a civic column is, the more expensive all civics in that column are relative to other further-right categories. So that Government civics, even the Low Upkeep ones, probably cost more than High Upkeep Religion ones, for example. That's the main effect, it may be doing something else too I forget. But yeah my little component just took all that out basically, and made X Upkeep cost the same regardless of which civic type it was in, b/c playing with it the vanilla way was driving me nuts. It also made balancing the vanilla civics, and my mod's additional civics, a big pain because I would've had to balance their effects against gold costs that varied over a much wider range than the differences in the relative power of the civics do.

Edit: Lemme add another example cuz I wanna be extremely clear about this. I would describe the actual cost variance across columns with the vanilla code as "moderate", however assume for a moment that it was a more extreme difference. Every civic and thus group of civics has a range of gold costs for its upkeep levels that could be considered appropriate for the effects those civics have on your empire. Say you balance a far-right column first, giving it approximately-right gold costs to make players consider whether to use them or not depending on their situation. Now, if you do that, with the more extreme variance the far-left columns would instantly become prohibitively-expensive, and no one would ever use them even if they wanted to b/c they just couldn't afford it. Alternatively, say you balance a far-left category first... now the far-right ones are nearly free to use, everyone will use them automatically in every game, and people may even rush to them in the tech tree just so they can get their free empire boosts sooner. The effect isn't this drastic with vanilla's moderate variation in cost but it IS the same effect, which is bad. QED.

I wrote an article on civic upkeep costs a long time ago (see War Academy, Civic Upkeep Explained) when civ4 was on the market just a short while and the SDK wasn't available yet, so the formulas were found by experimentation in the game.

It could be that the formulas have some small errors in them since they aren't derived from the code, but there is a reason that there are small differences between the various cost formulas in the various civic categories. If each of the formulas would be exactly the same, then costs could go up in each category at the same time once one of your cities grows a single population point or you create a single extra city. This would thus result in big jumps in costs as your empire grows followed by long periods of stable costs. That's not something you'd want as a game designer. It's not a good thing when an empire of a single city of size 4 has 0 civic upkeep and an empire of a single city of size 5 has 5 civic upkeep (using the exact same civics) because each civic category increases in cost 1 at the same time (values are just a theoretical example to explain the idea).

More elegant formulas could have been designed by relying less on integer math (using a single decimal in the cost per civic category would have been enough to avoid this problem).
 
Very interesting. I just assumed it was based on the fact that Goverment is the left-most category, and that government would be the most expensive institution an empire could run, seeing as how it's, well... government lol. Guess not. :)

Your point is well taken Roland, however I'd still much prefer that one annoyance over the problems I described with the vanilla system. And it really is just an annoyance, I mean, I experience big jumps or falls in my empire income on a turn-by-turn basis all the time for a variety of reasons: a thunderstorm appeared and made my Pearl Nets temporarily unworkable, a huge major city just got blockaded by an enemy ship, a trade deal giving or receiving a lot of gold-per-turn just got established or terminated, etc... You have to deal with those spikes all the time, and it's just a matter of adjusting the empire spending levels a notch or two, so having civics suddenly add a bit of cost when a city somewhere grows doesn't really bother me. But yes, it's still inelegant. Probably pretty easy to fix, even with integer math, when I have time.
 
Thank you for making Better AI. Jdog!:king: I can't play without it!:clap:
You deserve to be able to play with your project.:D
 
Back
Top Bottom