UGO
Civilization Fanatics' Center  

Welcome to Civilization Fanatics' Center.

You are currently viewing our site as a guest which gives you limited access to our site features. By joining our free community, you will be able to participate in the discussions, search the forum, send private messages, vote in polls, upload your own screenshots to the gallery, and access many other special features. Registration is fast, simple and absolutely free, so sign up today! If you have any problems with the registration process or your account login, please contact support.

Go Back   Civilization Fanatics' Forums > CIVILIZATION IV > Civ4 - Creation & Customization > Civ4 - Project & Mod Development > Civ4 - Better AI

Notices

Reply
 
Thread Tools
Old Aug 09, 2009, 06:27 PM   #1
jdog5000
Revolutionary
 
Join Date: Nov 2003
Location: California
Posts: 2,277
Version 0.80 discussion thread

(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.)


This release feels like a big milestone in this project Between fixes in the UP and this version of BBAI, the AI's tech research rate is much improved, particularly in the late game. There undoubtedly more which can and will be done, but I think most of you will notice the change

Beyond the economy fixes, here are a few other highlights:

- AI now switches to Nationhood when facing a difficult enemy, and uses drafting both for defense and occasionally for an offensive rush
- Capitulation was tweaked from both sides, outright conquest is now a bit more common
- Began adding victory strategies to the AI (have little effect so far)

Next, there are two aspects of research rate I want to talk about more at length. The short version is that research rates have been rebalanced since the AI is now teching faster. The details are in spoiler tags below because they describe the inner workings of somewhat hidden research rate modifiers which exist in Civ4 and have been adjusted in this mod.
Spoiler:

Known prerequisite adjustment

In Civ4 you get a 20% research rate bonus (ie, an extra beaker for every 5 you produce) for every OR prerequisite tech you know. Most of the techs in the tree have 1 OR prerequisite, some have 2, and there are only a few with none (starting techs, Astronomy, Flight).

As an example, the two OR prereqs for Civil Service are Code of Laws and Feudalism. You have to know one of these two to be able to research Civil Service. If you only know Code of Laws, you get 20% bonus for researching Civil Service. If you only know Feudalism, again you get a 20% bonus. If you know both, then you get a 40% bonus.

Now, the bonus for knowing both Feudalism and Code of Laws makes sense ... it should be easier to make the leap to Civil Service with both of those concepts already understood. However, the bonus for knowing only one of the OR prereqs is a little weirder, why should you get a +20% bonus just for having unlocked the tech? This means that after the starting techs, you're getting at least a 20% bonus all the time, except on Astronomy and Flight. It's like some kind of bizarre "SALE: 20% off Tech-Tree Wide!!!" that no one ever told you about.

Anyway, this known OR prereq bonus was how I decided to scale down tech rates. In BBAI 0.80, you get a 10% bonus for knowing one OR prereq and then +20% for each additional prereq you know. In effect, almost all techs are 10% more expensive.

Several XML variables have been exposed to control tech rate:

TECH_COST_FIRST_KNOWN_PREREQ_MODIFIER - Bonus for first known OR prereq, currently 10%.

TECH_COST_KNOWN_PREREQ_MODIFIER - Bonus for subsequent known OR prereqs, remains at 20%.

TECH_COST_MODIFIER - Allows scaling of research rate modifier for all techs, so -5 would slow everything down by 5%. Set to 0.

In the test I've run, this seems to produce about the same tech rate as vanilla BTS (with tech trading on) ... it's still maybe 5% faster than I'd personally want most of the time, but about in line with what most expect I think.


Spoiler:

Tech diffusion

In Civ4, you receive a 30%/n bonus to research rate for every civ you've met which already knows the tech you're researching, where n is the number of civs alive in the game.

In BBAI 0.80, the formula is more complex, but here are the important points:
- Diplomatic status matters, so open borders make tech diffuse much more quickly.
- There is no longer a normalization by number of civs alive in the game, instead the added bonus for each additional civ who already knows the tech gets smaller and smaller.
This second change was made for two reasons: 1) Tech now diffuses the same early on a 2-player island on a big map as it does on a Duel map. 2) If one player pulls ahead of the pack, there's a stronger bonus to pull along the other players.

In addition, a tech welfare program was added to help out civs who fall far behind. Civs who are behind by several techs in the mid game or later now get a percentage boost based on how far behind they are. This was added to help keep smaller civs and others which can't keep up in research at least technologically relevant, so your tanks should see fewer archers and longbowman now

Several variables for controlling these features have been added to GlobalDefinesAlt.xml.

Last edited by jdog5000; Sep 20, 2009 at 07:41 PM.
jdog5000 is offline   Reply With Quote
Old Aug 09, 2009, 06:51 PM   #2
Roland Johansen
Deity
 
Roland Johansen's Avatar
 
Join Date: Apr 2003
Location: the Netherlands
Posts: 4,161
Quote:
Originally Posted by jdog5000 View Post
- AI cities now more likely to build gold instead of research, since generally get more research from pushing up research slider
Is this based on the quotient of the average research bonus/average gold bonus (measured civilisation wide)?

About research cost.

With the improved tile management and improved city management, I would expect the AI to research at about the same speed in the ancient and classical era. But once the benefits of this better management become apparent in the later ages, the AI will start to research faster compared to the vanilla BTS AI. So if the same balance is sought, then I would expect that the later techs need an increase in cost while the starting technologies can remain at a similar cost.

I've never viewed the research bonuses due to known technologies as a problem. I guess, the developers experimented with the technology values until the research speed was about right for most players and the AI with the hidden 20% bonus. If the bonus hadn't been there, then the research values would have ended up lower (for vanilla civ4). The bonus is a bit hidden and this makes guessing the right values a bit harder for a modder and makes the game a bit harder to understand for a starting player. So there are some negative consequences to such a game design.

Manipulating these values can help set up a better research speed for the improved AI, but I think that a more manual adjustment to middle to late game technologies would work better.

Related to this discussion is the scaling of research speeds across map sizes. In my opinion, this balance was not created well. The game just has a flat multiplier for tech cost for larger maps. This causes a very different research experience for larger maps. At the start of the game, you can't really research any faster on a huge map than a standard map since in both situations there's just a capital or a capital plus a few cities. There is a slightly lower city maintenance on larger maps and you can continue to build cities once the normal map size map is filled, but this takes a while to make a research difference. Late in the game, civilisations on a huge map will have a lot more well developed cities resulting in maybe 3 times as much research power than a normal map (for the average civilisation). Because the research multiplier for map sizes is a flat value, this means that research on a huge map will be slower at the start of the game, the same in the middle of the game and lightning fast at the end of the game (for the average civilisation).
__________________
If in other sciences we should arrive at certainty without doubt and truth without error, it behooves us to place the foundations of knowledge in mathematics.

Last edited by Roland Johansen; Aug 09, 2009 at 06:59 PM.
Roland Johansen is offline   Reply With Quote
Old Aug 09, 2009, 07:23 PM   #3
Cybah
King
 
Cybah's Avatar
 
Join Date: Jun 2007
Posts: 944
Quote:
- Diplomatic status matters, so open borders make tech diffuse much more quickly.
poor tokugawa
__________________
I'm a tsentom1 fan.
Cybah is offline   Reply With Quote
Old Aug 10, 2009, 07:35 AM   #4
Lone Wolf
Moony
 
Lone Wolf's Avatar
 
Join Date: Dec 2006
Location: Ekaterinburg, Russia
Posts: 4,879
Quote:
Tech diffusion

In Civ4, you receive a 30%/n bonus to research rate for every civ you've met which already knows the tech you're researching, where n is the number of civs alive in the game.

In BBAI 0.80, the formula is more complex, but here are the important points:

In addition, a tech welfare program was added to help out civs who fall far behind.
I don't like all that much, to be honest. That sounds like a gameplay change.
__________________
The only people whom I dislike more then the Communists are the Anti-Communists. - S. Dovlatov
I'm not a misogynist, my mother is a woman! - unknown
Evil is not something superhuman, it's something less than human. - A. Christie

Economic Left/Right: -4.38 Social Libertarian/Authoritarian: -3.74
Lone Wolf is offline   Reply With Quote
Old Aug 10, 2009, 08:34 AM   #5
MaxCiv
Chieftain
 
MaxCiv's Avatar
 
Join Date: Apr 2006
Location: Ottawa - Canada
Posts: 39
Nice changes, I like them. I think this will make the mid-late game more balanced and interesting. Good job Jdogg

Any eta on the possible fix for "Root of all AI improvment cycling evil"
MaxCiv is offline   Reply With Quote
Old Aug 10, 2009, 10:13 PM   #6
BobTheTerrible
Just Another Bob
 
Join Date: Jan 2003
Location: Middle of Nowhere
Posts: 882
Quote:
Originally Posted by MaxCiv View Post
Any eta on the possible fix for "Root of all AI improvment cycling evil"
That's in this release.

As others have said, this looks to be an epic release for BBAI. Can't wait until Revolutions gets updated and this trickles down into all the big mods. BBAI is definitely keeping the game interesting for a huge amount of the civvers.
BobTheTerrible is offline   Reply With Quote
Old Aug 11, 2009, 06:33 AM   #7
MaxCiv
Chieftain
 
MaxCiv's Avatar
 
Join Date: Apr 2006
Location: Ottawa - Canada
Posts: 39
Quote:
Originally Posted by BobTheTerrible View Post
That's in this release.

As others have said, this looks to be an epic release for BBAI. Can't wait until Revolutions gets updated and this trickles down into all the big mods. BBAI is definitely keeping the game interesting for a huge amount of the civvers.
Is it? Can you quote the release notes referring to it?
MaxCiv is offline   Reply With Quote
Old Aug 11, 2009, 06:43 AM   #8
Ninja2
Great Engineer
 
Ninja2's Avatar
 
Join Date: Nov 2005
Location: Denmarkia
Posts: 1,034
Quote:
- Fixed major cause of cycling between cottages and workshops in CvCityAI::AI_bestPlotBuild. AI now consistently values cottages as average between cottage and town, removing asymmetry that led to cycling.
From here
__________________
Merged Mod: A combination of Wolfshanze's 1850-1920 mod, Dales Combat mod, Influence Driven War and GIR's Partisan mod, all built on top of the Better AI! Download

"The memory of spectacular failure eclipses that of enduring success."
Ninja2 is offline   Reply With Quote
Old Aug 11, 2009, 07:38 AM   #9
MaxCiv
Chieftain
 
MaxCiv's Avatar
 
Join Date: Apr 2006
Location: Ottawa - Canada
Posts: 39
Quote:
Originally Posted by Ninja2 View Post
From here
Great! I didn't see that . Thanks.

P.S.
Wow, after reading the entire changelog this release is REALLY impressive! hats off to you Jdogg

Last edited by MaxCiv; Aug 11, 2009 at 07:45 AM.
MaxCiv is offline   Reply With Quote
Old Aug 11, 2009, 05:21 PM   #10
Pep
Warlord
 
Join Date: May 2002
Location: Spain
Posts: 223
Only one question: is the fix for the mass upgrade bug included in this version? The file CvMessageData.cpp is not in Better BTS AI sources for v0.80.
Pep is offline   Reply With Quote
Old Aug 12, 2009, 06:09 AM   #11
ecc
Warlord
 
ecc's Avatar
 
Join Date: Dec 2003
Posts: 129
Quote:
Originally Posted by MaxCiv View Post
Great! I didn't see that . Thanks.

P.S.
Wow, after reading the entire changelog this release is REALLY impressive! hats off to you Jdogg
I second that emotion.
__________________
Hooyah!
ecc is offline   Reply With Quote
Old Aug 12, 2009, 12:13 PM   #12
PieceOfMind
Drill IV Defender
 
PieceOfMind's Avatar
 
Join Date: Jan 2006
Posts: 4,786
Quote:
Originally Posted by Lone Wolf View Post
I don't like all that much, to be honest. That sounds like a gameplay change.
I'm not 100% certain but it sounds like he included XML options to completely disable the features. I've taken a similar approach with PIG mod, introducing some new gameplay features but actually leaving most of them disabled by default. I leave it to the player to decide if he/she wants to turn them on or off.

Still, gameplay changes might make merging more time consuming, but that's a fairly minor niggle.

Overall, I think this is a great Better AI release, but then every Better AI release is good in my books!
PieceOfMind is offline   Reply With Quote
Old Aug 12, 2009, 12:22 PM   #13
Yakk
Cheftan
 
Join Date: Mar 2006
Posts: 1,084
Quote:
Originally Posted by Lone Wolf View Post
I don't like all that much, to be honest. That sounds like a gameplay change.
The AI should play without knowing how many civilizations are out there, for role-playing reasons.
Yakk is offline   Reply With Quote
Old Aug 12, 2009, 07:28 PM   #14
Cyberviking
Chieftain
 
Cyberviking's Avatar
 
Join Date: Mar 2007
Location: Norway, Telemark
Posts: 18
I've tried to merge the BTS 1000ad scenario with the better AI + 48 civs, but when I test it, I always get the defeat message when I enter the game. I have checked a hundred times that I have 48 team and player slots, and that the barbarian cities and units are owned by number 48. To eliminate possible typos, I've done the XML editing twice, really boring I must say.

Could need some help here!

Last edited by Cyberviking; Aug 12, 2009 at 07:37 PM.
Cyberviking is offline   Reply With Quote
Old Aug 14, 2009, 10:14 PM   #15
TopDog
Prince
 
Join Date: Aug 2005
Location: Auckland, New Zealand
Posts: 383
Quote:
TECH_COST_MODIFIER - Allows scaling of research rate modifier for all techs, so -5 would slow everything down by 5%. Set to 0.
So essentially we can change the tech cost to our needs?
Would 10 increase the cost by 10% all through?
If so, that is a really great addition, as marathon games (1500 turns) should be more than long enough for me, except I usually finish the tech tree by 1000-1100 or so, and so want to increase tech costs.
__________________
Some people are like slinkies; not really good for anything, but you can't help laughing when you push them down stairs
TopDog is offline   Reply With Quote
Old Aug 14, 2009, 10:57 PM   #16
vodlaian
Warlord
 
Join Date: May 2007
Posts: 142
Are there any plans to further reduce some of the handicaps (noble) as the AI get's better?
vodlaian is offline   Reply With Quote
Old Aug 16, 2009, 09:43 AM   #17
gavagai
Chieftain
 
Join Date: Feb 2005
Posts: 20
Sale 10% off

Quote:
Originally Posted by jdog5000 View Post
However, the bonus for knowing only one of the OR prereqs is a little weirder, why should you get a +20% bonus just for having unlocked the tech? This means that after the starting techs, you're getting at least a 20% bonus all the time, except on Astronomy and Flight. It's like some kind of bizarre "SALE: 20% off Tech-Tree Wide!!!" that no one ever told you about.

Anyway, this known OR prereq bonus was how I decided to scale down tech rates. In BBAI 0.80, you get a 10% bonus for knowing one OR prereq and then +20% for each additional prereq you know. In effect, almost all techs are 10% more expensive.
I totally buy your arguments for taking away the 20% bonus. But, why do you reduce it to 10%, instead of taking it away completely? It still is weird and makes no sense.
gavagai is offline   Reply With Quote
Old Aug 17, 2009, 11:59 AM   #18
Maniac
Apolyton Sage
 
Maniac's Avatar
 
Join Date: Nov 2004
Location: Gent, Belgium
Posts: 4,557
Images: 4
Under CvPlayerAI::AI_getSpaceVictoryStage(), you ask yourself if there is a better way to determine if a spaceship victory is valid. How about checking if the victory requires you to build a project or buildingclass?
__________________
Contraria sunt Complementa. -- Niels Bohr
Mods: SMAniaC (SMAC) | Planetfall (Civ4) - now at version 13
Maniac is offline   Reply With Quote
Old Aug 18, 2009, 11:46 PM   #19
jdog5000
Revolutionary
 
Join Date: Nov 2003
Location: California
Posts: 2,277
Quote:
Originally Posted by vodlaian View Post
Are there any plans to further reduce some of the handicaps (noble) as the AI get's better?
That will be done by popular demand ... if people feel it's needed, it'll happen.

Quote:
Originally Posted by gavagai View Post
I totally buy your arguments for taking away the 20% bonus. But, why do you reduce it to 10%, instead of taking it away completely? It still is weird and makes no sense.
Well, the problem is that the general rate of research was set up to have a certain pace. The AI is faster at tech now, but not 20% faster. As Roland pointed out earlier, it's also not a flat rate ... the AI's tech rate is improved mainly from the Renaissance on. Going down to 10% put space victories at about the right time on average in my tests, so that's why it's there.

I'm thinking of changing this mechanic so tech costs scale by era ... +0% for Ancient, +3% for Classic, +6% for Medieval, ... +15% for modern. Something like that.

Quote:
Originally Posted by Maniac View Post
Under CvPlayerAI::AI_getSpaceVictoryStage(), you ask yourself if there is a better way to determine if a spaceship victory is valid. How about checking if the victory requires you to build a project or buildingclass?
Yeah, but with the way things are setup that requires a loop over projects as the victory doesn't know what projects it requires ... this isn't bad, but delay turns alone works at least for the default victory types and most of the mod ones I've heard of (religion, mastery, etc).
jdog5000 is offline   Reply With Quote
Old Aug 19, 2009, 11:08 AM   #20
Roland Johansen
Deity
 
Roland Johansen's Avatar
 
Join Date: Apr 2003
Location: the Netherlands
Posts: 4,161
Quote:
Originally Posted by jdog5000 View Post
I'm thinking of changing this mechanic so tech costs scale by era ... +0% for Ancient, +3% for Classic, +6% for Medieval, ... +15% for modern. Something like that.
That sounds interesting. As the AI city management has improved in a few ways, this will probably scale early to late game research speeds the right way. If these values are accessible in the XML-files, then I can also change the tech rate of the huge maps the way I like without changing the tech cost of every single technology.
__________________
If in other sciences we should arrive at certainty without doubt and truth without error, it behooves us to place the foundations of knowledge in mathematics.
Roland Johansen is offline   Reply With Quote
Reply

Bookmarks

Go Back Civilization Fanatics' Forums > CIVILIZATION IV > Civ4 - Creation & Customization > Civ4 - Project & Mod Development > Civ4 - Better AI > Version 0.80 discussion thread

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[BTS] Version 0.76 Discussion Thread jdog5000 Civ4 - Better AI 7 Jun 08, 2009 01:05 PM
[BTS] Version 0.75 Discussion Thread jdog5000 Civ4 - Better AI 17 Jun 05, 2009 12:55 AM
Version 0.36 Discussion Thread jdog5000 Civ4 - Better AI 22 Oct 12, 2008 10:24 PM
Version 0.37 Discussion Thread jdog5000 Civ4 - Better AI 31 Oct 11, 2008 07:07 PM
Version 0.3 discussion thread jdog5000 Civ4 - Better AI 22 Aug 01, 2008 02:13 PM



All times are GMT -6. The time now is 10:43 AM.


Powered by vBulletin®
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
This site is copyright © 2000 - 2009, Civilization Fanatics' Center.
Support CFC: Amazon.com | EB Games | Amazon UK | Amazon DE | Amazon CA | Amazon FR