Advertisement
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 Jul 03, 2008, 05:38 PM   #1
jdog5000
Revolutionary
 
jdog5000's Avatar
 
Join Date: Nov 2003
Location: California
Posts: 2,596
[BTS] v0.21 Discussion thread

Discussion thread for all things related to v 0.21 (which you can get here, at least until the next release).

The most important changes over 0.2 are to ship and plane retreat from threatened cities/forts. The idea is that if the fort/city is lost, the ships and planes are destroyed without a fight so they should get out of the city when there's any real threat. The biggest outstanding question is whether the threat level is right ... losing the units for nothing is bad, but if ships leave to easily they might be hunted down at sea.

Quote:
Better BTS AI v0.21 Changelog
_________

Bugfix
- Fixed bug in player closeness calculations causing the AI to be blind to its actual proximity to other players
- Fixed bug with needed defenders where the AI would choose to defend a recently captured holy city less than a normal city

War strategy AI
- Modified how closeness is used for determining who to attack, different settings for regular and Aggressive AI

Naval AI
- Modified bombard behavior. Priority remains on supporting player's ground troops, if none then consider supporting other troops with common enemy and spreading out stacks to increase reach of blockade.
- Modified and expanded Solver's changes to retreat from city/fort AI to be more specialized for various unit AI types, only move if there's a real threat

Air AI
- Modified and expanded Solver's changes to retreat from city/fort AI to be more specialized for various unit AI types, only move if there's a real threat

Barbarian AI
- Barb ships will now often blockade cities for a few turns before moving on if they have no nearby targets
- Barb ships trapped by ice or around 1-tile islands are now removed so more can spawn

General AI
- Modified city closeness calculations to use population from both cities, not just pop of the other city
- Created functions for determining when cities share the same water area (lake, ocean)
- Partial implementation of a new A* solver for determining closeness, does not yet affect calculations

Debug
- Added AIAutoPlay mod
- Modified debug mode output to show relevant information for these developments

Better BTS AI also includes Solver's unofficial 3.17 patch version 0.19.
jdog5000 is offline   Reply With Quote
Old Jul 06, 2008, 10:08 PM   #2
Duuk
Right Wing Liberal
 
Duuk's Avatar
 
Join Date: Dec 2005
Location: Detroit, Michigan, USA
Posts: 956
All I have to say is: It's VERY cool seeing the AI dominate its own borders and expand at the expense of weak neighbors.

..until you find out that Mali somehow managed to rid itself of an entire continent worth of enemies and is now gigantic and has nukes while your longbowmen and galleons are still exploring.
Duuk is offline   Reply With Quote
Old Jul 07, 2008, 09:04 AM   #3
Ninja2
Great Engineer
 
Ninja2's Avatar
 
Join Date: Nov 2005
Location: Denmarkia
Posts: 1,142
Why would there be any reason at all for healthy ships (non-transports) to remain at port? Shouldn't it be so the AI never docks its ships, unless they're damaged?
__________________
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 Jul 07, 2008, 11:46 AM   #4
jdog5000
Revolutionary
 
jdog5000's Avatar
 
Join Date: Nov 2003
Location: California
Posts: 2,596
Ships at sea are much more vulnerable to attacks out of the blue than ships in port, both attacks from other ships plus air attacks. Transports also need to be based in ports to pick up troops and launch naval invasions as the AI is currently written ... the escorts assigned to the transports will stay with them in ports as well. This accounts for most of the naval units the AI has sitting in ports during war.
jdog5000 is offline   Reply With Quote
Old Jul 14, 2008, 07:01 AM   #5
scu98rkr
Prince
 
scu98rkr's Avatar
 
Join Date: Nov 2004
Posts: 463
Hi I've played almost a complete game using the 0.21 Better AI up to 1990.

I used the earth map from techtonics and mixed Leaders/Civ.

I started in North America with 3 civs and 1 other Civ in S.America.

Basically Suielman of the Mongolians has almost vasselised every one in the old world.

I particularly like the fact that he has repeatedly declared war on Targets he has a chance of defeating (ie people near by) rather than anyone in the new world even if his relations with us are worse. He even declared war on the germans 3/4 times. Often they capitulate then breakfree, but he'd soon be back to he's now completely taken their land.

I managed to get a toe hold in the old word in China and vasselise Julius Ceasar. After Suileman + vassels defeated the last Civ inbetween us, he has now declared war on me and my vassels, although he has a massive army I now have nukes so it will be interesting to see how it goes.

I could post a save if needed.

The main thing is that the AI didnt bother wasting its time with long range over the sea wars it couldnt win.

PS it was on Monarch
scu98rkr is offline   Reply With Quote
Old Jul 14, 2008, 07:30 AM   #6
DanF5771
Emperor
 
DanF5771's Avatar
 
Join Date: Feb 2008
Posts: 1,179
Hi guys. I don't know whether this is the right place, but Roland Johansen recommended in his post in this thread to inform you about these 2 rather dubious issues/bugs regarding AI-AI and AI-human relations during certain trades.

Interesting work you are doing here. BTW, since you are attempting to improve navy intelligence, what do you think about the Sea Patrol function (we have a huge debate in the BTS forum).
DanF5771 is offline   Reply With Quote
Old Jul 17, 2008, 03:05 AM   #7
scu98rkr
Prince
 
scu98rkr's Avatar
 
Join Date: Nov 2004
Posts: 463
Hey Guys,

I've continued playing the game I mentioned above. Im not too sure if the AI is using its planes at all havent noticed them bombing me.

Could be to do with the new plane retreat code ?

Also the AI could do with priortising fission a bit more because I've had nukes for about 50 years and no one else has. I think if they get nuked the AI should beeline straight for fission if possible.
scu98rkr is offline   Reply With Quote
Old Jul 17, 2008, 05:35 AM   #8
Ace of Spades
GEM Fanboy
 
Ace of Spades's Avatar
 
Join Date: Feb 2003
Location: Munich, Germany
Posts: 210
Since I have been using this mod, I sometimes get a message "Unit Cnt True" displayed in the message window. Is this intentional? I cannot duplicate the event though, seems to happen randomly (not very often).

Best Regards,
Martin / Ace
Ace of Spades is offline   Reply With Quote
Old Jul 17, 2008, 05:11 PM   #9
jdog5000
Revolutionary
 
jdog5000's Avatar
 
Join Date: Nov 2003
Location: California
Posts: 2,596
Quote:
Originally Posted by DanF5771 View Post
Hi guys. I don't know whether this is the right place, but Roland Johansen recommended in his post in this thread to inform you about these 2 rather dubious issues/bugs regarding AI-AI and AI-human relations during certain trades.

Interesting work you are doing here. BTW, since you are attempting to improve navy intelligence, what do you think about the Sea Patrol function (we have a huge debate in the BTS forum).
Thanks for bringing the trade bug to our attention, that definitely needs to be addressed immediately.

I don't know much about the sea patrol function, I'll read some more.
Quote:
Originally Posted by scu98rkr View Post
Hey Guys,

I've continued playing the game I mentioned above. Im not too sure if the AI is using its planes at all havent noticed them bombing me.

Could be to do with the new plane retreat code ?

Also the AI could do with priortising fission a bit more because I've had nukes for about 50 years and no one else has. I think if they get nuked the AI should beeline straight for fission if possible.
The retreat code only applies when there's some danger of the AI losing the cities the planes are based in, so that's not the culprit ... there's still more to figure out in terms of how the rest of the air AI works though.
Quote:
Originally Posted by Ace of Spades View Post
Since I have been using this mod, I sometimes get a message "Unit Cnt True" displayed in the message window. Is this intentional? I cannot duplicate the event though, seems to happen randomly (not very often).

Best Regards,
Martin / Ace
Haven't seen that yet, but I'll keep my eyes open.
jdog5000 is offline   Reply With Quote
Old Jul 19, 2008, 01:31 PM   #10
Yakk
Cheftan
 
Join Date: Mar 2006
Posts: 1,288
http://forums.civfanatics.com/showpo...6&postcount=14

Bwahahahaha! This so has to be fixed ASAP. (the bug is a const-correctness slash enum-turning-into-int override and bad-overuse of a name bug, that results in the attitude of the AI being ignored when trading resources!)
Yakk is offline   Reply With Quote
Old Jul 20, 2008, 12:58 AM   #11
jdog5000
Revolutionary
 
jdog5000's Avatar
 
Join Date: Nov 2003
Location: California
Posts: 2,596
Yeah ... that's a pretty remarkable bug. I'll have a new version up with fixes for that (plus a couple other tricks) in a couple of days.
jdog5000 is offline   Reply With Quote
Old Jul 20, 2008, 04:09 PM   #12
jdog5000
Revolutionary
 
jdog5000's Avatar
 
Join Date: Nov 2003
Location: California
Posts: 2,596
(For those of you wondering what we're talking about, in the BTS SDK there are two functions called AI_getAttitude in CvPlayerAI, one which gets the attitude type towards another player and one which gets the attitude type that corresponds to the integer attitude value. However, for some somewhat complicated reasons, there are circumstances where the programmer thinks there calling one but actually calling the other. In this circumstance, calling AI_getAttitude for player 0 (the human in single player) instead always returns CAUTIOUS since it interprets the 0 as the attitude value. Everything compiles just fine and seems to work unless you're very attentive ... major props to DanF5771 for having the perseverance to locate the problem!)

So I renamed the static AttitudeTypes AI_getAttitude(int iAttitudeVal) function to AI_getAttitudeTypeForVal and found only a couple places which needed to use this new function. There were then 3 places which complained about no longer having access to AI_getAttitude ...

CvPlayerAI::AI_bonusTrade
CvPlayerAI::AI_civicTrade
CvPlayerAI::AI_religionTrade

In all three circumstances it really affected trading, both with the human player (who the AI was in effect always CAUTIOUS towards) and in AI-AI trades ... in large games, player 10 and later would have a very easy time trading since others would effectively always be FRIENDLY towards them in terms of trading these three things.

For those of you keeping score at home, I fixed the compiler complaints by using:

Code:
GET_PLAYER(getID()).AI_getAttitude(ePlayer)
instead of just AI_getAttitude(ePlayer) ... this bypasses the issue of having the this CvPlayerAI pointer being const and looking up the non-const AI_getAttitude by getting a new non-const reference to CvPlayerAI. Fun fun fun ...
jdog5000 is offline   Reply With Quote
Old Jul 21, 2008, 04:31 AM   #13
Roland Johansen
Deity
 
Roland Johansen's Avatar
 
Join Date: Apr 2003
Location: the Netherlands
Posts: 4,281
I'm glad to hear that you're seriously squashing this bug.

This means that now after the game has been on the market for years, we're finally getting the diplomacy to work as it should have from the start. How weird is that! Think of all the AI-AI deals that have never been realized in all those millions of games because of this bug.
__________________
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; Jul 21, 2008 at 04:35 AM.
Roland Johansen is offline   Reply With Quote
Old Jul 21, 2008, 06:14 AM   #14
Ri-Hatz
Chieftain
 
Join Date: Jun 2008
Posts: 93
Great Project here! Im looking forward for the upcoming version.
It's actually UNBELIEVABLE that the trade bug hasn't been fixed before.

Are You going to include the unofficial patch by solver?
Please don't if the drill2-makes-units-immune-to-coll.damage-bug isn't fixed.
It makes the game unplayable in my opinion.
Ri-Hatz is offline   Reply With Quote
Old Jul 22, 2008, 11:27 PM   #15
SevenSpirits
Immortal?
 
SevenSpirits's Avatar
 
Join Date: Jul 2007
Posts: 488
I want to help work on this.

Do we have a repository yet?
SevenSpirits is offline   Reply With Quote
Old Jul 23, 2008, 12:29 AM   #16
jdog5000
Revolutionary
 
jdog5000's Avatar
 
Join Date: Nov 2003
Location: California
Posts: 2,596
Yes and no ... I'm now an administrator for the Better AI sourceforge repository but TortoiseSVN has been causing my computer to bluescreen. Haven't been able to figure out WTF is going on with that yet ... I hope to figure that out over the next week when I finally get some real free time.
jdog5000 is offline   Reply With Quote
Old Jul 24, 2008, 03:13 AM   #17
icemanjsg
Warlord
 
icemanjsg's Avatar
 
Join Date: Feb 2006
Location: London
Posts: 228
Sorry for the airhead question, but if I download this better AI from the link provided at the top has it been updated yet to include the trade bug fix?

Many thanks
icemanjsg is offline   Reply With Quote
Old Jul 24, 2008, 03:56 AM   #18
scu98rkr
Prince
 
scu98rkr's Avatar
 
Join Date: Nov 2004
Posts: 463
v0.3 ++++++++
scu98rkr is offline   Reply With Quote
Old Jul 24, 2008, 01:21 PM   #19
jdog5000
Revolutionary
 
jdog5000's Avatar
 
Join Date: Nov 2003
Location: California
Posts: 2,596
Quote:
Originally Posted by icemanjsg View Post
Sorry for the airhead question, but if I download this better AI from the link provided at the top has it been updated yet to include the trade bug fix?

Many thanks
Yeah, the link is for the latest version of BBAI which is now 0.3 and includes the trade bug fix.
jdog5000 is offline   Reply With Quote
Reply

Bookmarks

Go Back Civilization Fanatics' Forums > CIVILIZATION IV > Civ4 - Creation & Customization > Civ4 - Project & Mod Development > Civ4 - Better AI > [BTS] v0.21 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


Similar Threads
Thread Thread Starter Forum Replies Last Post
[BTS] v0.2 Discussion thread jdog5000 Civ4 - Better AI 1 Jun 30, 2008 08:54 PM
[BTS] v0.11 Discussion thread jdog5000 Civ4 - Better AI 8 Jun 25, 2008 05:02 PM
Warring States Scenario for FFH2 v0.21 fannarh Civ4 - Scenarios 2 Sep 15, 2007 10:01 AM
Turnchat Instruction Thread - Wednesday 21 December, 21:00 GMT Furiey Civ3 - Game of Democracy VII 7 Dec 21, 2005 06:37 PM
The Clone Wars (v0.21) - Preview Pleb Civ3 - Creation & Customization 52 Nov 28, 2003 09:33 AM


Advertisement

All times are GMT -6. The time now is 06:00 PM.


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