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 Nov 05, 2009, 05:43 AM   #461
Guest01
Chieftain
 
Join Date: Mar 2006
Posts: 59
r_rolo1
Quote:
To resume, I'm not saying to tell the AI players to not go burn something to stop a enemy win ... I'm just saying that it might be hard to pull a mechanism that works better than the current "do nothing" aproach, atleast in terms of increasing the odds of a certain AI player winning the game by using that mechanism.
It's really hard to rebut your case. But I try to do it in one point: let's suppose that "going mad" plan applied not to situations of "increasing the odds of a certain AI player winning the game" but only to subset of situations (little probably) when there is already nothing to lose because game actually lost for the AI. In that case doing something instead of doing nothing if not increasing chances of victory would at least make winner little busy. Little of "Hitler in the bunker" I mean

Last edited by Guest01; Nov 05, 2009 at 06:06 AM.
Guest01 is offline   Reply With Quote
Old Nov 05, 2009, 06:40 AM   #462
r_rolo1
King of myself

 
r_rolo1's Avatar
 
Join Date: May 2006
Location: Lisbon, Portugal
Posts: 13,818
The issue is that, technically , you can win the game with one city and being a capitulated vassal So, technically, the game is only lost when you have no military units or settlers ( to include the require complete kills option ) , in spite of the way to recover and win might be pretty much impossible to follow So, because of that, going to suicidal berserk mode will probably not be, unless in very fringe cases, equal or better than simply continue business as usual...
__________________
" I'm the Lord of the lords, not the servant of the serfs" - D. Joćo II of Portugal

My Civ lema: Qui vincit non est victor nisi victus fatetur

Lonely Hearts Club Bullpen / You , Yourself and your shadow : Some lessons on isolated starts
r_rolo1 is offline   Reply With Quote
Old Nov 05, 2009, 07:03 AM   #463
Guest01
Chieftain
 
Join Date: Mar 2006
Posts: 59
Quote:
So, because of that, going to suicidal berserk mode will probably not be, unless in very fringe cases, equal or better than simply continue business as usual...
OK, let's go back to "spaceship launched" situation. If calculations shows that AI can't overtake player in diplomacy or culture or far from conquer the world what should it do? Wait its own doom?
Guest01 is offline   Reply With Quote
Old Nov 05, 2009, 07:47 AM   #464
r_rolo1
King of myself

 
r_rolo1's Avatar
 
Join Date: May 2006
Location: Lisbon, Portugal
Posts: 13,818
Quote:
Originally Posted by Guest01 View Post
OK, let's go back to "spaceship launched" situation. If calculations shows that AI can't overtake player in diplomacy or culture or far from conquer the world what should it do? Wait its own doom?
Depends My point in the long post I made was exactly that one: there is no point for a AI player to gimp another player ( human or not ) win if they don't increase their own chances of winning with that ( that, in the example you made above are close of being null ) ... seen in that way, mounting a expedition to torch a city to stop is only worthwhile to a AI player if it doesn't put them on peril of losing in other way, and that can prove to be somewhat hard to do when mounting a hastily assembled military expedition that most likely will be a kamikaze one, with the consequent loss of power and probably the destruction of the diplo network it had before that ( note that a lot of that could be avoided if the AI player in question was smart enough to bribe a third player dumb enough/ pissed enough to do the dirty job for them or even bribe the target player to a war, but that is probably another issue to be discussed separately ). If the AI player can pull it out and still have a fighting chance*, yes, it should think on that option, but if it can't , going there or not will yeild the same result

*this implies that we can teach the AI to calculate their possibilities of winning a game. Given that even the majority of the human players are pretty bad doing that ( one of the things you hear more in response of players that post games seeking advice is " you are in a far better position than you think" ), teaching this to the the AI might be troublesome, to say the least
__________________
" I'm the Lord of the lords, not the servant of the serfs" - D. Joćo II of Portugal

My Civ lema: Qui vincit non est victor nisi victus fatetur

Lonely Hearts Club Bullpen / You , Yourself and your shadow : Some lessons on isolated starts
r_rolo1 is offline   Reply With Quote
Old Nov 05, 2009, 08:09 AM   #465
Guest01
Chieftain
 
Join Date: Mar 2006
Posts: 59
r_rolo1
Quote:
If the AI player can pull it out and still have a fighting chance*, yes, it should think on that option, but if it can't , going there or not will yeild the same result
The same result except one thing: AI won't lose game so passively. What human player do if faced with imminent defeat? Usually he simply start a new game without waiting several more turns before game end. CIV AI can't capitulate like chess simulator no matter how bad situation is.
Guest01 is offline   Reply With Quote
Old Nov 05, 2009, 08:21 AM   #466
r_rolo1
King of myself

 
r_rolo1's Avatar
 
Join Date: May 2006
Location: Lisbon, Portugal
Posts: 13,818
Well, true enough ... but putting the AI giving a show by making a viking funeral just because it can't stop a enemy win is probably out of the scope of a mod that has the propose of making the AI to play better ( well, you can argue it could be in as well .... probably saying that it is unrelated fits better. This is, in essence, a roleplay issue .... )
__________________
" I'm the Lord of the lords, not the servant of the serfs" - D. Joćo II of Portugal

My Civ lema: Qui vincit non est victor nisi victus fatetur

Lonely Hearts Club Bullpen / You , Yourself and your shadow : Some lessons on isolated starts
r_rolo1 is offline   Reply With Quote
Old Nov 05, 2009, 09:04 AM   #467
Yakk
Cheftan
 
Join Date: Mar 2006
Posts: 1,288
See, rather than 'gang up on the player who is going to win' (which reduces every victory condition to "do you have enough military to take on the world"), what if the AI simply approximated how long it was until the game ended.

And if the game is ending soon, it was 'more aggressive' in some sense.

So as you approach cultural victory, people who don't like each other will go to war with each other. Civilisations will chain-whip and mass-draft armies into being, because military unit now > population that could do something later. Nuclear bombs may start flying. Nations at war will strip defenders and turn them into attack stack. Technology will be ignored in order to pay for mass-unit-upgrades.

Another civilisation that is going for space race will bend every ounce towards it; neglecting their military in order to get those last components built.

Ie, the AI's strategy will be 'exagerrated' as they detect the end of game approaching, and long-term will be neglected for short-term.
Yakk is offline   Reply With Quote
Old Nov 05, 2009, 09:28 AM   #468
r_rolo1
King of myself

 
r_rolo1's Avatar
 
Join Date: May 2006
Location: Lisbon, Portugal
Posts: 13,818
^^That could give another twist to the end game, that is for sure ( in spite of not being exactly a improvement on the the AI... to say the truth I see this more as a option ), but it stumbles in something that I mentioned some posts ago: the AI needs to have a good idea of how close it is from winning via all the possible VC paths to be able to choose in what to focus, a thing that will be somewhat hard to code in a way that produces consistently decent results ( due to the fact that Civ IV VC are non-gradual in essence ). It also implies that we have inbuilt strategies for all the VC, a thing that we only have for culture so far ....
__________________
" I'm the Lord of the lords, not the servant of the serfs" - D. Joćo II of Portugal

My Civ lema: Qui vincit non est victor nisi victus fatetur

Lonely Hearts Club Bullpen / You , Yourself and your shadow : Some lessons on isolated starts
r_rolo1 is offline   Reply With Quote
Old Nov 05, 2009, 09:43 AM   #469
MartinHarper
Warlord
 
Join Date: Feb 2009
Posts: 132
I think that AIs should play to win first, and to achieve a higher score second. If an AI gets to a situation where they cannot win, they can still try to maximise their score. This provides motivation for their actions, and allows us to decide whether the actions of the AI are better or worse. If AIs play only to win, then we cannot judge whether the actions of an AI in a hopeless situation are good or bad.

Quote:
Originally Posted by Yakk View Post
'gang up on the player who is going to win' (which reduces every victory condition to "do you have enough military to take on the world")
Conquest = "do you have enough military to conquer the world?"
Domination = "do you have enough military to conquer most of the world's population and territory?"
Diplomatic = "do you have enough military to conquer most of the world's population, taking at least one vassal?"
Cultural = "do you have enough military to defend three cities for X turns?"
Space = "do you have enough military to defend your capital for X turns?

Those are different victory conditions.
MartinHarper is offline   Reply With Quote
Old Nov 05, 2009, 09:53 AM   #470
PieceOfMind
Drill IV Defender
 
PieceOfMind's Avatar
 
Join Date: Jan 2006
Location: Australia
Posts: 9,143
Quote:
Originally Posted by r_rolo1 View Post
^^That could give another twist to the end game, that is for sure ( in spite of not being exactly a improvement on the the AI... to say the truth I see this more as a option ), but it stumbles in something that I mentioned some posts ago: the AI needs to have a good idea of how close it is from winning via all the possible VC paths to be able to choose in what to focus, a thing that will be somewhat hard to code in a way that produces consistently decent results ( due to the fact that Civ IV VC are non-gradual in essence ). It also implies that we have inbuilt strategies for all the VC, a thing that we only have for culture so far ....
Although I agree it's hard to estimate it in general (that is, how close the end of the game is) because of the "non-gradual" VCs, for the other AIs it's probably a lot more predictable than it is for the human player.

The human player might be able to trick the AI into not knowing it's near a victory, but that human player would probably have to know in advance how the AI was programmed. Raising 3 legendary cities in one turn, you have to admit, is a pretty extreme example.

Most of the victory conditions I think a reasonable approximation can usually be made for how close a player (human or AI) is to victory.
Spaceship: Not just how many parts are built but also how advanced the player is. If they're not very good on tech, what's their GNP?
Culture: How far is the third strongest culture city from legendary? Take into account a couple of possible great artist great works. It should be possible for an AI to see how quickly that third city is producing culture even if it only does a rough difference check between two turns.
Domination: Player is getting a lot of population and land. Rarely would this VC happen in a couple of turns, but certainly a high power rating for someone over everyone else should point to them possibly heading towards domination faster.
Conquest: Similar to above..
Diplo: Hard to say, but usually a vic from AP is pretty unlikely so don't really need to take that vic into account. For the UN though, the check should be similar to someone getting near a domination win. Or maybe just check for how many AIs are friendly with the player, how many pop those voters have, and make a rough approximation from there.
Time: Well, how many turns til the end? This should be the easiest one of the lot.
__________________
Tip: Forcing Steam's Offline Mode
Civ4 Mods: Advanced Combat Odds, PIG Mod(discontinued), HEX Mod(discontinued)
Suggestion: Try karadoc's K-Mod: Far Beyond the Sword
Read if bored: Zoom-To-Cursor, Good advice from Kaell for DX11 users, Nvidia beats AMD in Civ V
PieceOfMind is offline   Reply With Quote
Old Nov 05, 2009, 10:17 AM   #471
jdog5000
Revolutionary
 
jdog5000's Avatar
 
Join Date: Nov 2003
Location: California
Posts: 2,596
Quote:
Originally Posted by Mattygerst View Post
I'm sure this has been talked about before, but I have only started using & watching Automated Workers with the 0.81 patch release.

But (and I THINK I have a save game available, but I'm not positive). The scenario: I have a capital, and inside my cultural borders but outside my BFC are horses - my ONLY horse resource. The resource is in such a position that I can't really put another city where the horse is inside a BFC. Now, I create the required pasture for the horse. Then a few turns later I automate my workers. And as I'm war building - catapults, sword, horse archer...my worker starts and completes building a farm over the horse - even though it is my only horse resource and the farm is not a useable tile. Then, after that, I watch them rebuild the pasture. Then...some time goes by, and they rebuild the farm.

This is "normal" activity right now? Seems like that could be pretty bad in terms of war building for the AI...
No, that is not normal ... I have never seen the AI do that. If you have a save from when this was happening (old version of BBAI is fine), that would be very helpful.
jdog5000 is offline   Reply With Quote
Old Nov 05, 2009, 11:08 AM   #472
Mattygerst
Prince
 
Join Date: Jan 2008
Location: St. Louis, Missouri, USA
Posts: 443
Damn...I thought I had it, but I don't. I know for a fact though that is not the first time I've seen this...and I've seen it a few times before. I should note...the game I saw it in was using your RevDCM mod - but that uses BBAI 0.81M, so I imagine that is fine to use in the future to show here? Anyway, I will watch for it and provide a save for you when I see it next - as I said, it is common so it shouldn't be too many games in...
Mattygerst is offline   Reply With Quote
Old Nov 05, 2009, 01:33 PM   #473
MartinHarper
Warlord
 
Join Date: Feb 2009
Posts: 132
Incidentally, when an AI goes for a culture victory, does it stockpile Great Artists? This seems like the most flexible option...
MartinHarper is offline   Reply With Quote
Old Nov 05, 2009, 03:28 PM   #474
MadmanAtW
Knight
 
MadmanAtW's Avatar
 
Join Date: Apr 2008
Location: San Leandro, CA
Posts: 579
The thing about having the AIs dogpile the player who is on his way to victory is that it removes part of the game. I don't just mean that there will be less point to shooting for space/culture victories because you'll need an army anyway, but rather- part of the skill that allows you to win is managing the AI diplomacy so that they won't attack you when you make your shot towards winning. What's the point of going through the long and deliberate process of making an AI Friendly with you if it isn't going to matter in the endgame?

If being on the verge of winning increased the odds of a DoW multiplicatively I would say that's probably a cool idea. But I don't think it should add ways for Friendly/nice Pleased Civs to DoW- I feel like RPwise the better model for them is "We're pleased our friends are doing so well." No, it's not what a human would do, no, it's not what might win it for that one Civ. But it is also almost never the case that accepting a tech in order to DoW on some second AI is actually more to the benefit of the attacker than the briber- should we make AIs always refuse to do that because it doesn't help them win? Of course not. Nor should we make all AIs always abstain from diplo victory votes. For single player games winning is manipulating the AIs, and we should leave ways that the AIs can be manipulated into allowing a victory.
MadmanAtW is offline   Reply With Quote
Old Nov 06, 2009, 05:58 AM   #475
Elkad
King
 
Elkad's Avatar
 
Join Date: Mar 2007
Posts: 918
When the AI launches, it really needs to consider a capital move (to the city deepest in it's culture or otherwise safest). Even better would be pre-building a palace or 3 so it can jingle-jangle them. It also needs to be aware that once the ship is launched, trading cities for time is a winning strategy, especially on really big maps. Just keep retreating if you can't win the battle, and make the enemy slog through your culture.

Not getting suckered into defending a city that isn't one of your legendary 3 is the same concept. Once you are within 10-20turns of victory, just defend that victory condition.

Will the AI switch civics just to garner the last few votes from another AI for a diplo win?
Elkad is offline   Reply With Quote
Old Nov 06, 2009, 08:23 AM   #476
r_rolo1
King of myself

 
r_rolo1's Avatar
 
Join Date: May 2006
Location: Lisbon, Portugal
Posts: 13,818
Quote:
Originally Posted by PieceOfMind View Post
Although I agree it's hard to estimate it in general (that is, how close the end of the game is) because of the "non-gradual" VCs, for the other AIs it's probably a lot more predictable than it is for the human player.

The human player might be able to trick the AI into not knowing it's near a victory, but that human player would probably have to know in advance how the AI was programmed. Raising 3 legendary cities in one turn, you have to admit, is a pretty extreme example.
The AI is probably more predictable because it is coded in a way that makes it predictable The only VC that has actual strategies coded in the dll is the culture one, and , once you read them in detail, you can see that most of the code is pretty much what certain strategy guides from Vanilla/Warlords teach as a recipe for a cultural win: build wonders, build sistine, run artists, shut down the slider .... all pretty gradual aproaches, to say the truth ( and better not talk of the non-strategies that apply to the other VC ). This has a reason, OFC : non-gradual aproaches to a win require a thing that the current AI has in short supply: memory. You can't plan to finish all the SS parts in 1 turn if you don't have memory, you can't stockpile a lot of Great artists to use all in the same turn if you don't have memory, you can't make plans to tweak the diplo in a dramatic fashion close of the critical vote if you don't have memory ... well, you got the point....

And about the player needing code knowledge to detect the turning points of a AI that jumps on the winner: just see the similar discussion about GalCiv II that is happening in General discussions forum ( oh wait, you even posted there ) . People that don't know the code were fast to discover that the Ai had that mechanism and I'm pretty sure that with some dozens of games in top of them they could pretty much empirically determine where were the tipping points and act accordingly... why would be diferent in Civ IV?
Quote:
Originally Posted by PieceOfMind View Post
Most of the victory conditions I think a reasonable approximation can usually be made for how close a player (human or AI) is to victory.
Spaceship: Not just how many parts are built but also how advanced the player is. If they're not very good on tech, what's their GNP?
Culture: How far is the third strongest culture city from legendary? Take into account a couple of possible great artist great works. It should be possible for an AI to see how quickly that third city is producing culture even if it only does a rough difference check between two turns.
Domination: Player is getting a lot of population and land. Rarely would this VC happen in a couple of turns, but certainly a high power rating for someone over everyone else should point to them possibly heading towards domination faster.
Conquest: Similar to above..
Diplo: Hard to say, but usually a vic from AP is pretty unlikely so don't really need to take that vic into account. For the UN though, the check should be similar to someone getting near a domination win. Or maybe just check for how many AIs are friendly with the player, how many pop those voters have, and make a rough approximation from there.
Time: Well, how many turns til the end? This should be the easiest one of the lot.
This is probably a good place to start for making a mechanism that gives the AI a idea of how close is from winning and how close of winning are their oponents Obviously would need a good deal of refinenement ( I could point a strategy to counter all of the solutions above, and I would not need to push extreme examples : for a quick example, your SS solution does not take in account the internet or risky SS ), but for starters is not bad
__________________
" I'm the Lord of the lords, not the servant of the serfs" - D. Joćo II of Portugal

My Civ lema: Qui vincit non est victor nisi victus fatetur

Lonely Hearts Club Bullpen / You , Yourself and your shadow : Some lessons on isolated starts
r_rolo1 is offline   Reply With Quote
Old Nov 06, 2009, 09:41 AM   #477
PieceOfMind
Drill IV Defender
 
PieceOfMind's Avatar
 
Join Date: Jan 2006
Location: Australia
Posts: 9,143
Refining is not my specialty.

Quote:
People that don't know the code were fast to discover that the Ai had that mechanism and I'm pretty sure that with some dozens of games in top of them they could pretty much empirically determine where were the tipping points and act accordingly... why would be diferent in Civ IV?
I say this because if the AI is coded well these "tipping points" shouldn't be too obvious.

Anyway, even if you can find a clever way to avoid putting the AIs over their tipping point, it's not any worse than it was before. My suggestion would be that if an AI has determined another player to be getting close to spaceship victory, it doesn't rapidly change direction and start attacking, but it should become more and more likely, to the point where once the ship is launched it becomes extremely likely. Of course, this probability of going to war should be severely reduced (possibly even to zero) if the AI is friendly with the player.

By the way, the description I gave in my previous post was mainly of a function that would estimate time to the end of the game. By itself a function like that shouldn't make an AI extremely predictable near the end of the game. It shouldn't take too much imagination to see you can program its response to that function to be unpredictable or varied.

One could take the view that most of these changes are not going to have any large effect because the human player will just learn how the AI behaves and adapt accordingly. But, remember this is all really to just make that last run for victory a bit more interesting. The last turns of a game become extremely anti-climatic if the AIs just plod along business as usual. The human player is anticipating the end of the game - the hope is that the AI begins to anticipate this end to the game to some extent as well.

Remember a lot of the changes in Better AI do not necessarily, or at least don't do so in an obvious way, increase the AI's chances of winning the game. Sometimes better AI might mean making the game a bit more interesting - not just a click-the-end-turn button fest.
__________________
Tip: Forcing Steam's Offline Mode
Civ4 Mods: Advanced Combat Odds, PIG Mod(discontinued), HEX Mod(discontinued)
Suggestion: Try karadoc's K-Mod: Far Beyond the Sword
Read if bored: Zoom-To-Cursor, Good advice from Kaell for DX11 users, Nvidia beats AMD in Civ V
PieceOfMind is offline   Reply With Quote
Old Nov 06, 2009, 03:21 PM   #478
jdog5000
Revolutionary
 
jdog5000's Avatar
 
Join Date: Nov 2003
Location: California
Posts: 2,596
Quote:
Originally Posted by PieceOfMind View Post
Remember a lot of the changes in Better AI do not necessarily, or at least don't do so in an obvious way, increase the AI's chances of winning the game. Sometimes better AI might mean making the game a bit more interesting - not just a click-the-end-turn button fest.
Well said ... as this is a game, the goal is to make it more fun for the human player. There's plenty of overlap in my mind between having the AI play the game well/try to win and making it fun for the player, but it's an important distinction to keep in mind.
jdog5000 is offline   Reply With Quote
Old Nov 08, 2009, 05:00 PM   #479
MartinHarper
Warlord
 
Join Date: Feb 2009
Posts: 132
Quote:
Originally Posted by r_rolo1 View Post
You can't plan to finish all the SS parts in 1 turn if you don't have memory, you can't stockpile a lot of Great artists to use all in the same turn if you don't have memory...
To "remember" whether you've been stockpiling Great Artists, look to see if you have 2+ Great Artists in play. To "remember" whether you've been prebuilding SS parts, look to see if you have several cities with pre-built SS parts. Easier said than done, though.
MartinHarper is offline   Reply With Quote
Old Nov 11, 2009, 02:16 PM   #480
Zeiter
Prince
 
Join Date: Nov 2008
Posts: 319
Quote:
Originally Posted by MartinHarper View Post
To "remember" whether you've been stockpiling Great Artists, look to see if you have 2+ Great Artists in play. To "remember" whether you've been prebuilding SS parts, look to see if you have several cities with pre-built SS parts. Easier said than done, though.
Unfortunately, as far as I understand, the AI doesn't think like that. It will see that it has 2 Great Artists, and it will think, "Yeehaw, now which border city needs a culture bomb?" or "Yeehaw, I can start a golden age!" etc. The AI is like a small child. It doesn't have a memory from turn to turn of what it had been planning to do with those 2 Great Artists. I looks at each turn anew as if it had never seen the game before (aside from a few aspects like diplomacy).

Likewise, with pre-built SS parts, come the next turn the AI would see no reason to not just finish those SS parts, as it doesn't remember that its strategy had been to pre-build them so as to catch the human off-guard.
__________________
The History of the Decline and Fall of the Roman Empire
http://forums.civfanatics.com/showth...71#post8211171
Zeiter is offline   Reply With Quote
Reply

Bookmarks

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

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
Questionable Ads BCalchet Site Feedback 13 Apr 25, 2008 12:04 PM
A Really Questionable Thread pxpdoo Civ4 - General Discussions 6 Jan 14, 2008 04:49 AM


Advertisement

All times are GMT -6. The time now is 06:57 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