View Full Version : Better than BTS
Yakk May 09, 2008, 03:53 PM BTS AI kicks ass. I think we can make it better.
First, making the AI smarter.
We need a better power graph. As it stands, the power graph more closely reflects "total number of shields of units" more than "total power of units".
Second, there are AI tweaks that can make the game better, without making the AI better, if you get my drift.
Proposal: When the AI passes the following thresholds, it should make an offer to you:
1> I'm willing to call this war off if you will call this war off.
2> I'm willing to give up a city to call this war off.
3> I'm willing to capitulate and become a vassal state to call this war off.
Having to check each turn if your victim will capitulate is rather annoying, and if you fail to check each turn the AI is likely to surrender to some other AI.
jkp1187 May 18, 2008, 11:00 AM BTS AI kicks ass. I think we can make it better.
First, making the AI smarter.
We need a better power graph. As it stands, the power graph more closely reflects "total number of shields of units" more than "total power of units".
Second, there are AI tweaks that can make the game better, without making the AI better, if you get my drift.
Proposal: When the AI passes the following thresholds, it should make an offer to you:
1> I'm willing to call this war off if you will call this war off.
2> I'm willing to give up a city to call this war off.
3> I'm willing to capitulate and become a vassal state to call this war off.
Having to check each turn if your victim will capitulate is rather annoying, and if you fail to check each turn the AI is likely to surrender to some other AI.
I'm definitely in favor of improving whatever can be improved. But can't the last problem you mentioned be fixed simply by a pop-up box or other indicator that the other civ is ready to surrender? (E.g., "Mansa Musa announces that he is willing to negotiate an end to the war." if the civ just wants a cease-fire in place, or "Catherine announces that she is willing to discuss surrender terms." if the civ is ready to capitulate.)
Yakk May 18, 2008, 12:02 PM Sure, that is why it isn't really an AI improvement, but it is an improvement in the interface between the player and the AI.
I figure the AI offering surrender (starting negotiations) when it becomes willing to surrender to the player whose turn is active would work.
jdog5000 Jun 17, 2008, 12:15 PM Note: The following are a continuation of the discussion on pages 111 - 112 of the Unofficial Patch thread (http://forums.civfanatics.com/showthread.php?t=246057&page=111).
jdog5000 Jun 17, 2008, 12:36 PM I just realized there's another bit of quirky behavior in the closeness code which we could remedy. Here are two situations, X and Y are cities and 0 is land and * is water:
Two cities on opposite sides of a large bay
00000Y
00****
0*****
00****
00000X
Like before but one city is on a separate island
*****Y
******
0*****
00****
00000X
In scenario 1, since the cities are in the same area (ie connected by land tiles) CvCityAI::AI_playerCloseness will do a second check of proximity using the path length between the cities (GC.getMap().calculatePathDistance(plot(), pLoopCity->plot())). The path is 10 tiles long, so they will not be considered close.
In scenario 2, because the cities are in different areas so the "as the crow flies" distance between them is divided by 2 and they will be considered quite close.
There are other related scenarios which also could be potentially improved. Right now a city will consider itself close to a city 10 tiles away on another island but not to a city 10 tiles away up the coast.
This kind of quirky behavior would really affect AI decisions when playing a Inland Sea map, on a map of the Mediterranean (ha, I actually spelled that right on the first try!), or on similar situations in other maps.
I haven't figured out exactly what I would propose in this regard but basically if both cities are coastal we could add some kind of check for the path length through water. Alternatively, if the cities are both coastal we could check if they're on the same body of water by comparing area ids for water plots around them and if they are then divide the stepDistance by 2 as in the different areas case.
Balderstrom Jun 17, 2008, 12:41 PM Note, you can ask one of the Mods to split the posts from the unnoficial patch to here. I recently requested as such for a thread that went completely offtopic into a new mod/design idea.
glider1 Jun 17, 2008, 05:29 PM I thought we'd remove the / 4 when adding closeness for everyone.
Comments I have are on testing this build:
OptionA, Option C and CvTeamAI :: startWarVal iClosenessValue != 0: iValue += iClosenessValue/1
I think this build is another improvement again with one possible exception. The upside is that on standard settings the regional war declarations do not crowd out other types of war declarations which is excellent, and it seems more dynamic, real and good with more warfare commensurate with the context.
On the downside, I think I have observed one "tactical" potential issue that is not serious but might be enough to trigger a stressed AI developer to get overly cautious especially if an AI dows on a human.
Neighbour 1 DOWS on Neighbour 2. The power graph says it's fine to do so and the overall defenses of 2 across all cities are warranting an attack. However 1 does not give complete heed to the defenses of the specific border city it is going to attack in some cases *I think*. This can result in a "small degree" to the attacker loosing a border war more often than it should *perhaps*. However it's difficult because there is more to a border attack than just capturing a city....
So in summary:
startWarVal iCloseness != 0 at : iValue += iClosenessValue/4 (very conservative)
or
startWarVal iClosenessValue != 0 at : iValue += iClosenessValue/2 (still conservative or correct)
or
startWarVal iClosenessValue != 0 at: iValue += iClosenessValue/1 (possibly detrimental)
Here are some questions:
1) startWarVal iClosenessValue == 0: that /4 should be left alone in all cases yes?
2) what algorithm is the attacker using to judge the defense of his neighbouring opponent?
Cheers
glider1 Jun 17, 2008, 06:20 PM These comments are an "aside" to the short term improvements *I think* that have already been made. I'm thinking the quality of war declarations not quantity at the moment:
1) Examine the inter-relationship between iValue += iClosenessValue / 1 in startWarVal and the closeness equation in cvcityAI. Reason why I say this is the possibility that the closeness equation redistributes city defenders away or towards border cities and thus has a bearing tactically on increased neighbour wars with closeness/1 in startWarVal. Am I deluded thinking this? Could this be a genuine "quality" aspect. The question to me is how option C (->getPopulation + getPopulation) effects this. The whole question of defense distribution is interesting.
2) Boost the default closeness range - If this improves the quality of border war declarations then it's interesting. I'm always lagging in thought time between Yakk and Jdog but to clarify for me -> default closeness has an effect on the cvcityai closeness array values because of the call to calculatePathDistance. Is this the bottom line of this idea? But the quality of border war declarations is actually totally dependent on the quality of the calculation in the function calculatePathDistance? So that if a city is 6 away from another city but it's path distance is 7, it's closeness should be rejected? I need clarification before I can pursue this angle.
Cheers.
jdog5000 Jun 17, 2008, 08:19 PM I have contacted the admin of the BetterAI sourceforge project about getting access to that as a repository for our developments. If that doesn't pan out we can apply for a new project.
glider1 Jun 17, 2008, 09:22 PM I have contacted the admin of the BetterAI sourceforge project about getting access to that as a repository for our developments. If that doesn't pan out we can apply for a new project.
Yeah for the first time in a long time, I have packed away the magnificent "Revolutions" mod for a while because even at this early stage of the project, the game is much more *dynamic* even without adding a revolution. That said, the Revolution mod is probably going to benefit from improved localised warfare which is possibly a reason why you began this journey to begin with :D
After all is said and done, what we want is this yes?
To be totally beaten into submission by a super AI time and time again on totally equal terms as happens if you play an AI in chess.
Ooooh yeah :)
Cheers.
jdog5000 Jun 17, 2008, 09:48 PM Yeah, it's going to be awesome. I got started with AI war decisions first for the StartAsMinors feature, in the next version of Revolution AIs will choose to keep some wars active when someone switches from minor to full. This is also now integrated with BarbarianCiv war decisions too ... makes for a very different (and more turbulent) first half of the game now as grudges from the minor civ period are held for a long time.
glider1 Jun 17, 2008, 10:03 PM My goal for a BTS better AI project is simply this:
Python popup after a turn is complete with the AI declaration:
"You will loose to a domination victory in 121 turns. Would you like to resign now?" :)
Cheers.
glider1 Jun 17, 2008, 11:58 PM Would you humour me for a moment and not to rain on my own cloud for a little while even if I am "delusional"? The most beautiful logical constructed turn based games I think humans have ever come up with are these:
1) The game "Go" without question
followed closely by:
2) Chess
followed closely by:
3) Civ + Revolutions
followed a fair way behind by:
4) Backgammon
followed so far behind it's not funny:
5) Poker, monopoly
Now forget 4 and 5 for a moment. The most capable turn based AI in the world without question is "Backgammon". After 15 years of exhaustive computing the game has been completely "solved" after the first move. Backgammon is a draw and the AI cannot be beaten. That is a fact.
The next best AI on the planet is chess. This AI is beating the very best minds in the world consistently without question even though the game is far from "solved". That AI can still be beaten occasionally especially now that the chess variant "Chess960" is gaining more and more support as being the "generalised" version of chess and which the AI cannot utilise it's database to win.
The next best AI is the Go AI. But this is still a huge order of magnitude behind the first two and remains one of the biggest challenges in computer science and will be for some time. Thankfully humans still have the upper hand on the "game of all games".
The next best AI is the civ AI. But that is *possibly* only as evolved as the Go engine. In reality, it is quite possible that a civ AI is possibly even more complex an artificial intelligence exercise than the Go AI is......
So if it takes until 2027 to finally crack the BTS civ AI when they say the "AI singularity" is due, there is still a bit of time so go for it!!!
My approach will be to type randomly on the computer keyboard until then, and hope that something dawns on me. I hope you will use a more sophisticated approach.
Cheers.
jdog5000 Jun 18, 2008, 12:18 AM Here are some questions:
1) startWarVal iClosenessValue == 0: that /4 should be left alone in all cases yes?
2) what algorithm is the attacker using to judge the defense of his neighbouring opponent?
Cheers
1) I'm going with the following for now:
if (iClosenessValue == 0)
{
iValue /= (GC.getGameINLINE().isOption(GAMEOPTION_AGGRESSIVE _AI) ? 4 : 2);
}
The rationale as Yakk and I were discussing before being that /= 4 is a pretty drastic reduction, especially considering that it has never been invoked in game until this week. Dividing by 4 for far away civs is sort of equivalent to worsening relations by two steps for nearby civs, ie Friendly -> Cautious or Cautious -> Furious... there are several other factors, but for just startWarVal that is basically true. On Aggressive the increased odds of having a cordial neighboring AI backstab you to gain territory may make sense, but for normal it seems like /= 2 would allow for more roleplaying.
2) Depends. For AI_doWar where the AI contemplates starting a war there are checks of the team's power versus the victim's getDefensivePower(), which is just the sum of power for teammates, vassals, and defensive pacts. There are different modifiers and considerations depending on whether the check is for total war, limited war, or a dogpile.
That's just for choosing whether to pick a fight, in terms of the tactical choices of which city to attack I believe there is no check for defensive power. CvPlayerAI::AI_targetCityValue does not consider the strength of defenders. There are also mechanisms in CvUnitAI for picking targets and deciding whether to launch an attack or wait for reinforcements so this may not be the whole story. In previous versions of civ you could play games with SoD by moving defenders around and having the stack chase a constantly shifting poorly defended city (or worker even), the AI doesn't cheat in this way any more but now is happy to march towards a well-defended city.
jdog5000 Jun 18, 2008, 12:23 AM Would you humour me for a moment and not to rain on my own cloud for a little while even if I am "delusional"? The most beautiful logical constructed turn based games I think humans have ever come up with are these:
.
.
.
My approach will be to type randomly on the computer keyboard until then, and hope that something dawns on me. I hope you will use a more sophisticated approach.
Cheers.
:lol: Awesome. If only computers were fast enough so that the AI could simulate 50 turns to decide whether a particular action was good ... then humans would be screwed :scan:
Roland Johansen Jun 18, 2008, 02:49 AM I'm not a programmer, but I'm going to follow this project and wish you the best of luck. :thumbsup: Your ambitions will at least not be the limiting factor of this project. :)
gavagai Jun 18, 2008, 02:58 AM Hej, nice work. As I just wrote in the bhruic-thread I would like to test some of your improvements in a new game. I can probably make the changes myself if I get a short instruction, otherwise I would love if you loaded up some of your files. :goodjob:
Yakk Jun 18, 2008, 10:25 AM So, the value we get from this calculation -- is it relative? Is it absolute?
Is it linear-relative? (if you double all values, does the situation not change)
Affine-relative? (if you add 1000 to all values, does the situation not change)
Ordered-relative? (if you do any operation that doesn't change the order, the situation doesn't change)
Linear-absolute? (every doubling of the number has about the same effect)
Affine-absolute? (every increase of 100 in the number has about the same effect)
glider1 Jun 18, 2008, 04:44 PM Hej, nice work. ... otherwise I would love if you loaded up some of your files. :goodjob:
Releases will happen for sure. "This" better-ai has already a very fortunate head start which means that there are already achievements......It's called finding the "closeness bug"! The other head start are that Yakk and Jdog will be working on it ;)
Cheers.
glider1 Jun 18, 2008, 05:00 PM I'm not a programmer, but I'm going to follow this project and wish you the best of luck. :thumbsup: Your ambitions will at least not be the limiting factor of this project. :)
I remember the wonderful "discussion" you had with Bhruic regarding "worker behaviour" and the like and that plus AI-build schedules would have to be yet another prime avenue for improvement. Not a simple problem at all to say the least!
Like Yakk said, the BTS AI is already very cool. Help on a project like this is zeroing in on the tough task of visualising "clear" avenues of progress that can be made through the haze and the maze of the "ghost in the machine" of unintended consequences.
Cheers.
Roland Johansen Jun 18, 2008, 06:02 PM I remember the wonderful "discussion" you had with Bhruic regarding "worker behaviour" and the like and that plus AI-build schedules would have to be yet another prime avenue for improvement. Not a simple problem at all to say the least!
Like Yakk said, the BTS AI is already very cool. Help on a project like this is zeroing in on the tough task of visualising "clear" avenues of progress that can be made through the haze and the maze of the "ghost in the machine" of unintended consequences.
Cheers.
Another difficult and interesting improvement avenue would be the AI assessment of the strength of an enemy stack of units compared to their own stack of units, especially when attacking cities. More in general, the AI battle behaviour might be an area that could be improved although I guess it's a hard nut to crack. Some discussion about this matter also took place in Bhruics thread.
Maybe easier would be improving the AI's use of money to spread corporations. From my experience, the AI is not very capable at saving money to spread corporations. It spends its money to upgrade units and rush buy stuff (according to Bhruic) and nothing is left for using the corporate executives it has constructed. Bhruic taught the AI to not build an endless supply of corporate executives, but the heart of the problem is the AI's problem with saving money for spreading corporations.
glider1 Jun 18, 2008, 07:08 PM That's just for choosing whether to pick a fight, in terms of the tactical choices of which city to attack I believe there is no check for defensive power.
Thanks for that and I understand that determining whether and how this check happens in some indirect way is ongoing....
We need ideas no question. My thoughts on improving the ai in modest ways are at least these:
1) Algorithm "improvement" or new algorithm to check specific defensive power of the intended attack target prior to launching a border attack and then either cancelling, postponing or modifying the war plan. The BTS method at the moment is already a big improvement on Jdog's observation about the old days when you could keep the AI double guessing "infinitely" which was not good. Now what should happen is that the AI's single minded attack target decision has to be honed even more prior to launch.
2) Improving the calculate path distance algorithm in CvCityAI now that CPU power has gone up since BTS was released.
3) Introducing an algorithm that allows AI cities to share and work common plots without having to redo the entire plot improvement and worker algorithms. Not a simple problem! at all because of "oscillation" issues and the like.
4) Revisiting Roland's and Bhruic's excellent investigations into the AI ripping up towns. What was the conclusion?
5) Many other ideas including all Yakk's and Jdog's ideas.
6) Working out how to do all this and still get the dishes washed.
Cheers.
PS) I wish I had the knowledge to answer Yakk's excellent question on whether: "The value we get from this calculation -- is it relative? Is it absolute?"
From my perspective it could be catagorized as this:
Affine-itdifficult? (every change in value declares my ignorance) :rolleyes:
glider1 Jun 19, 2008, 12:01 AM Could we split this forum into seperate topics? There are so many different areas of potential improvements that can be made in small but significant ways. Sub-forums could be:
Better BTS war strategy
Better BTS war tactics
Better BTS city production
Better BTS city improvements
Better BTS corporate AI
I'm sure that there are ways to forge forward in all these and more areas without totally re-engineering the AI. Reasonably simple ways. But the discussion will get messy unless it is divided up.
For example, on better BTS war tactics, just a simple thing like ensuring that before an AI DOWS in a border war, that it's planned city razing stack has 10% extra offensive capability against the planned city would already be good. (just one extra city razing unit for example). Now that border wars are much more common, even a cancellation of a border conflict until there is better offensive capability would be justified. If as Jdog has hinted, that there is no direct assessment of this in the code (that we can see so far) well simple then, let's implement one :)
As it stands now, it is indeed a complex thing to totally overhaul war tactics. With the "closeness" bug fix, already I am beginning to see much more "colour" in the behaviour of AI war tactics when neighbours DOW in conjunction with non-neighbour partnerships. Very nice. This behaviour often was not triggered in vanilla BTS because of the "closeness" bug.
But the issue of totally revamping the AI war tactic is really hard. For example, in my scenario currently under investigation, three AI's neighbours have dowed on me on different fronts. One is raiding, two are city attacking. I am able to defend against this but long term how much will it hit me even if I am successfully defending in the short term? How difficult is it to judge to what extent an AI can afford to loose a city razing stack in reality?
Already the behaviour is good. I go for 10% more city razing offense is all.
Big questions.....Small answers?
Cheers.
ocitalis Jun 19, 2008, 10:15 AM I would like to join.
The BTS AI is quite an improvement from before, no doubt. It manages to do a marginal job of handling some tasks that are very complex, such as city production choices, irrigation, and plot improvements. But it can be much better.
I am currently of the opinion that the main weakness of the AI is its lack of centralized control, at all levels. I have been looking through the city code recently, and cities seem to rely on 1) AreaAI and 2) the civ's number of units, for determining when to build combat units. Those two factors, (and perhaps a few other things, like number of warplans), are nearly the only means for the city to know whats going on in the rest of the world, outside the city's BFC. Not an easy problem to remedy, I know, but it can be done.
jdog5000 Jun 19, 2008, 11:11 AM So, the value we get from this calculation -- is it relative? Is it absolute?
Is it linear-relative? (if you double all values, does the situation not change)
Affine-relative? (if you add 1000 to all values, does the situation not change)
Ordered-relative? (if you do any operation that doesn't change the order, the situation doesn't change)
Linear-absolute? (every doubling of the number has about the same effect)
Affine-absolute? (every increase of 100 in the number has about the same effect)
For closeness? At least when it comes to affecting the startWarVal it has none of those properties ... it gets summed with other values so doubling would make a difference. There is special handling for the == 0 case plus different multipliers depending on attitude so affine is out as well.
jkp1187 Jun 19, 2008, 12:19 PM I'm not a programmer, but I'm going to follow this project and wish you the best of luck. :thumbsup: Your ambitions will at least not be the limiting factor of this project. :)
I'm with Roland -- though I hope to learn a bit more about C++ programming along the way.
jdog5000 Jun 19, 2008, 12:29 PM I would like to join.
The BTS AI is quite an improvement from before, no doubt. It manages to do a marginal job of handling some tasks that are very complex, such as city production choices, irrigation, and plot improvements. But it can be much better.
I am currently of the opinion that the main weakness of the AI is its lack of centralized control, at all levels. I have been looking through the city code recently, and cities seem to rely on 1) AreaAI and 2) the civ's number of units, for determining when to build combat units. Those two factors, (and perhaps a few other things, like number of warplans), are nearly the only means for the city to know whats going on in the rest of the world, outside the city's BFC. Not an easy problem to remedy, I know, but it can be done.
I thought you might want to get in on this ... welcome to the fold :cool:
I'm with Roland -- though I hope to learn a bit more about C++ programming along the way.
Cool ... I hope we have a lot more discussions like the one spawned by the first bug, it will be great fun. BTW, I saw you got some serious props in the 3.17 change list for Next War :goodjob:
oedali Jun 19, 2008, 01:01 PM I read about this at the same time I found out about the new official patch. Just wanted to let you guys know that I am very excited about this important bug fix and I will stick with the 3.13 and apply your patch right away (instead of applying 3.17, until you release the 3.17 version). 3.17 does not look too different from Bhruic's anyways. Keep up the good work!
Yakk Jun 19, 2008, 01:14 PM For closeness? At least when it comes to affecting the startWarVal it has none of those properties ... it gets summed with other values so doubling would make a difference. There is special handling for the == 0 case plus different multipliers depending on attitude so affine is out as well.
Aha, but look at how AI_startWarVal is used. If you double the value of AI_startWarVal for every player, the gameflow logic remains unchanged.
If you increase the value of AI_startWarVal by 10000 for every player, the gameflow logic remains unchanged.
AI_startWarVal is basically the sum of:
1> How much closeness we have with them.
2> The value of the tiles near the border between us and them
3> How close our capitols are.
These 3 values are then multiplied by:
8 if their Victory countdown is lower than ours.
6 if we are close to domination on aggressive AI, 4 otherwise (! I think this does nothing)
A value between 1 and 16 depending on attitude
The value is then divided by 3 or 8 depending on if a member of our team is doing a cultural victory
As the value is only used for ordering potential war options... much of the above us utterly wasted. Anything that uniformly scales your AI_startWarVal does nothing!
jdog5000 Jun 20, 2008, 02:24 PM Version 0.1 for BTS 3.17 is out!!! Get it here. (http://forums.civfanatics.com/downloads.php?do=file&id=9819)
It includes the closeness changes we have been discussing, the captured holy city defender bug from earlier, plus three other things. The first is a reduction to the demand for transports when the AI is involved in a local war or when they only have galleys. Transport demand is determined by the number of attack units, when the AI is in a land war it will have many attack units that it doesn't intend to load on transports. The second set of things is an unfinished project to create a new A* route solver for closeness to replace the current combo of one to two solvers plus multipliers. These do not yet effect gameplay. Finally, I have modified the debug mode output when mousing over cities and territory so that it gives more information about things important to these developments and included my AIAutoPlay SDK code.
Better BTS AI Changelog
_________
- Fixed bug in player closeness calculations causing the AI to be blind to its actual proximity to other players (CvPlayerAI::AI_playerCloseness, used Option A from Unofficial Patch discussion thread)
- Fixed bug with needed defenders where the AI would choose to defend a recently captured holy city less than a normal city
- Modified how closeness is used for determining who to attack, different settings for regular and Aggressive 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)
- Lowered demand for transports when either in a land war or when the civ can only build galleys
- Partial implementation of a new A* solver for determining closeness, does not yet affect calculations
- Modified debug mode output to show relevant information for these developments
glider1 Jun 20, 2008, 03:56 PM Thankyou Jdog, hopefully there will be many "play testers" of this important discovery.
Yakk Jun 20, 2008, 07:24 PM How big are Civ4 maps, anyhow? Hmm. I've been playing with planar pathing recently. :-)
500 x 400 is 80,000. 80,000^1.5*ln(80,000) = 255,458,603
* 20 civilizations = 5 gig.
Think a 5 gig cache for ultra-fast pathing is worth it? Probably not. ;)
jdog5000 Jun 20, 2008, 08:12 PM Maps are a lot smaller than that normally ... I think standard is about 120 across, but it varies depending on the script (Terra is bigger).
jdog5000 Jun 20, 2008, 08:43 PM Download (http://forums.civfanatics.com/downloads.php?do=file&id=9819) resubmitted after glider caught a section of code I had forgotten to comment and update. For the 16 of you who downloaded already you'll want to pull it in again even if you're not checking out the sources.
All the changes are now commented and can be found by searching for BETTER_BTS_AI_MOD in the sources.
Balderstrom Jun 20, 2008, 09:42 PM Just a heads up, since it might wind up being a DLL fix - and would need to be incorporated. Currently Barrage is broken (http://forums.civfanatics.com/showthread.php?t=276713&page=10) for any unit that doesn't naturally have it (Just Armored I believe).
glider1 Jun 20, 2008, 11:17 PM I've been playing with planar pathing recently
I can tell that you have here been do so here!?:
http://forums.xkcd.com/viewtopic.php?f=12&t=6206
Very interesting Yakk and yeah I can confirm that a 500x300 map is not huge.......it is very huge by vanilla BTS standards.
By the way could you split the forum up into sub topics? It's a bit of work or do you want to leave that for source forge or the like?
Cheers
jkp1187 Jun 21, 2008, 09:13 AM Just curious if the all-new Better AI is going to include Solver's unofficial 3.17 patch (http://forums.civfanatics.com/showthread.php?t=279724)?
I mean, I can always merge the two myself, but let's not forget those cold and timid souls who, unable to compile, know neither victory nor defeat. :)
PieceOfMind Jun 21, 2008, 12:16 PM Just curious if the all-new Better AI is going to include Solver's unofficial 3.17 patch (http://forums.civfanatics.com/showthread.php?t=279724)?
I mean, I can always merge the two myself, but let's not forget those cold and timid souls who, unable to compile, know neither victory nor defeat. :)
I was worrying about this just now. Ideally I don't want to have to make a choice between two unofficial patches. Granted Solver's patch appears to be the more "official" unofficial patch since Better BTS is a bit more experimental, it also has a lower scope (so far) so I don't know which to go with.
My vote would be to include Solver's changes in this patch as a matter of course.
Solver Jun 21, 2008, 04:57 PM Hey guys, what's up with this mod?
If you have a detailed changelist, it'd be good if you posted in the unofficial patch thread. AI improvements are among the stuff I want in my unofficial patch. I'm also looking to make a few tweaks to the AI myself, though sadly I'm not much good at AI programming.
jdog5000 Jun 22, 2008, 12:17 AM I'll definitely fold in Solver's fixes for this and also tried to summarize what we've done so far in the unofficial patch thread so more can benefit. Not everything we've tweaked is necessarily appropriate for an unofficial patch even though I'd wouldn't want to play without the changes.
Anyway, I say we just basically take over this forum for our discussions. Once we have a chance to get organized we can ask a mod to change the stickied posts and all that jazz. Just mark new threads with [BTS] or something ... so glider, blast away with new threads!
On the sourceforge front, if I don't hear back on taking over the existing Better AI project in the next few days I'll request a new project.
PieceOfMind Jun 22, 2008, 09:47 AM I was playing a game with version 0.1 of this patch today and I stumbled across some very odd city placement decisions by the AI on my island. I honestly can't say whether this is something caused by the 3.17 patch, this v0.1 patch or whether it's something that has always been in the game. Anyway, after wiping out the Mongolians and keeking their capital, Montezuma seemed to obsessively surround this new city of mine with his own new cities. Over not many turns, there were 3 cities founded right on this city's border and two of these cities had their own borders pushed back fairly quickly too. If you look at the picture, you see his capital is far over to the right.
I seem to recall someone saying the AI tended to try and make its empire more concave, but that is through conquests right? (Not city placement?) What Monty has done appears to be super aggressive expansion towards me, to the point where it's stupid.
Random personalities, nonAggAI are settings that could be relevant. Monarch difficulty.
1 city was defended with a single chariot, another with a single spearman, and another with 2 archers. All on flat ground too. Is this perhaps a result of me playing standard AI instead of Agg AI for once? If this is how a normal AI normally plays then it's pretty disappointing.
I don't know if you guys think this is an issue but something just did not feel right in this game so I was wondering whether it was this patch.
http://forums.civfanatics.com/attachment.php?attachmentid=180893&stc=1&d=1214149338
jdog5000 Jun 22, 2008, 02:49 PM We haven't looked at city placement yet and none of the closeness changes would affect city placement ... they're only calculated between cities so it's impossible for it to affect choices before the city is built.
Certainly keep a save of the game from this time (preferably before the cities were founded if you have one). I'll create a thread about in game debugging and you can go back and explore why the AI made the choices it did. It takes a little bit of time mousing around but in debug mode you can see exactly where the AI wants to place a new city at any point in time.
jdog5000 Jun 22, 2008, 04:10 PM Version 0.11 is posted (http://forums.civfanatics.com/downloads.php?do=file&id=9819) with two changes.
First, the first addition of Solver's unofficial patch in included. This will be a running target as there seem to be several potential issues being worked out.
Second, I removed the unneeded variable saving from AIAutoPlay ... the good news is that v0.11 is savegame compatible with Vanilla BTS 3.17, the bad news being that it is not save compatible with v0.1. My apologies for that for those of you with v0.1 games going, I shouldn't have included the variable saving here in the first place. (It's only needed to prevent an exploit in my Revolution mod)
I also updated the install instructions which now specify two ways to use Better BTS AI ... use it as a mod if you just want to try it or maintain online play compatibility with those who don't have it, replace the main BTS files if you want the changes to apply for Firaxis BTS scenarios and many other mods as well.
glider1 Jun 22, 2008, 05:19 PM Anyway, after wiping out the Mongolians and keeking their capital, Montezuma seemed to obsessively surround this new city of mine with his own new cities. Over not many turns, there were 3 cities founded right on this city
Great that you are examining the better bts build 0.11 with so much detail. The point thus far is to examine under the microscope why the AI declares war in the first place. There have been no other major changes. Did Montezuma have a legitimate case for wiping out the Mongolians?
So far better BTS AI is all about the better behaviour of AI war declarations. Look for anything stupid happening in that and look closely for other ripple effects. Distant war declarations may be perfectly valid for diplomatic reasons so filter those out in your analysis.
For example there should be more border conflict which has not been fully tested and initial stack attack strength might need tweaking although so far so good except for "aggressive ai" I perceive.
Another thing to look out for is border conflicts that have been triggered from mutual friendly or pleased relationships and that don't seem right that sort of thing.
I know what you mean, I used to be an aggressive ai player myself, but standard is good now. I'm getting whipped on monarch standard aggression sometimes now. Cool.
Cheers
PS) Save game unusual scenarios for sure.
jdog5000 Jun 22, 2008, 05:59 PM I looked into the chances for Friendly/Pleased war declarations a little more. In AI_doWar there's a odds check against AI_noWarAttitudeProb before the startWarVal is even computed ... each AI has their own % of the time they will not even consider a DOW for certain attitudes specified in XML under <NoWarAttitudeProbs>. None of the AIs will initiate a war when they are Friendly to you which is good. About half will also never start a war against you on Pleased, for the rest the odds are mostly 10% with a smattering of 20%.
The chances for a Pleased declaration of war on a neighbor if the 10-20% chance check passes are now much higher with the Closeness fixes, but the initial check makes this still a fairly rare event. On aggressive AI those 10-20% chances are more like 20-30% and the differentiation in startWarVal for close vs non-close civs means you really can't really trust your neighbors unless they're Friendly or engaged in other wars.
When the AI is Cautious towards you the odds of checking startWarVal range from 80% to only 10% for Sitting Bull. This is the scenario where most of the changes in behavior will occur I think, the AI will pick a war against a neighbor they're Cautious towards over a distant Annoyed much more often now. On Aggressive AI they will even be fairly likely to declare on a neighbor they're Cautious towards over a distant Furious.
PieceOfMind Jun 22, 2008, 10:27 PM We haven't looked at city placement yet and none of the closeness changes would affect city placement ... they're only calculated between cities so it's impossible for it to affect choices before the city is built.
Certainly keep a save of the game from this time (preferably before the cities were founded if you have one). I'll create a thread about in game debugging and you can go back and explore why the AI made the choices it did. It takes a little bit of time mousing around but in debug mode you can see exactly where the AI wants to place a new city at any point in time.
All saves and autosaves since 4000BC now backed up! :)
(I happen to keep 400 autosaves at 4 turn intervals before they're overwritten :D)
Version 0.11 is posted (http://forums.civfanatics.com/downloads.php?do=file&id=9819) with two changes.
First, the first addition of Solver's unofficial patch in included. This will be a running target as there seem to be several potential issues being worked out.
Second, I removed the unneeded variable saving from AIAutoPlay ... the good news is that v0.11 is savegame compatible with Vanilla BTS 3.17, the bad news being that it is not save compatible with v0.1. My apologies for that for those of you with v0.1 games going, I shouldn't have included the variable saving here in the first place. (It's only needed to prevent an exploit in my Revolution mod)
:( I'll have to stick with v0.1 for now then because this game will take a while. Epic speed large map and all!
Great that you are examining the better bts build 0.11 with so much detail. The point thus far is to examine under the microscope why the AI declares war in the first place. There have been no other major changes. Did Montezuma have a legitimate case for wiping out the Mongolians?
So far better BTS AI is all about the better behaviour of AI war declarations. Look for anything stupid happening in that and look closely for other ripple effects. Distant war declarations may be perfectly valid for diplomatic reasons so filter those out in your analysis.
For example there should be more border conflict which has not been fully tested and initial stack attack strength might need tweaking although so far so good except for "aggressive ai" I perceive.
Another thing to look out for is border conflicts that have been triggered from mutual friendly or pleased relationships and that don't seem right that sort of thing.
I know what you mean, I used to be an aggressive ai player myself, but standard is good now. I'm getting whipped on monarch standard aggression sometimes now. Cool.
Cheers
PS) Save game unusual scenarios for sure.
Actually you may be disappointed when I point out it wasn't Monty who declared war on the Mongolians; it was I. But I kept their capital city and Monty in his expansion mindset built cities way too close IMO to this new high culture city (this is by the time the Mongolians were wiped out). By the way don't you love it when you see an enemy GG born in the city you're besieging! The next turn when you caputre the city you find a nice little settled GG. It's great to have the AI do the work for you! :lol:
Anyway, I'll certainly keep an eye out for all war declarations and let you know of anything interesting or odd.
glider1 Jun 22, 2008, 10:38 PM I looked into the chances for Friendly/Pleased war declarations a little more.
Beautiful level of detail. Thanks!
By the way, I've set up a new sub-forum for discussing AI war strategy and tactics in case you want to use that. It's entitled:
[BTS] AI Strategy - war
http://forums.civfanatics.com/showthread.php?t=279953
[BTS] AI Tactics - war
http://forums.civfanatics.com/showthread.php?t=279955
A reproduction of your information Jdog is going straight in there now...
Cheers.
jdog5000 Jun 23, 2008, 03:57 PM By the way don't you love it when you see an enemy GG born in the city you're besieging! The next turn when you caputre the city you find a nice little settled GG. It's great to have the AI do the work for you! :lol:
Ya know, that's a scenario where the AI could be improved! Be careful what you point out around here ... :p
PieceOfMind Jun 24, 2008, 11:32 PM Ya know, that's a scenario where the AI could be improved! Be careful what you point out around here ... :p
It would appear Solver has just put this feature into his patch! :)
I finally finished a game with v0.1. Sadly I didn't witness very many wars at all. However the wars that did take place were always between neighbouring civs except for the one time I was attacked from the sea by the Mayans. As usual, the escort fleet did not bother to do anything like reduce the defenses on the town, so several infantry were just suicided into a 60% city-on-a-hill machine gun. The AI doesn't even seem to pillage fishing boats anymore.
No major issues to report. :goodjob:
PieceOfMind Jun 25, 2008, 08:12 AM As per request of Solver, and for the interest of the authors of this mod, I have attached to this post the replay file from the game I finished in v0.1 of this patch.
Unfortunately due to the nature of the map there weren't terribly many war declarations so I'm not sure how useful a test case this game was... In the very least it showed AIs will still declare war on overseas civs. And most war declarations were on neighbours so it certainly didn't really break my expectations.
Settings:
nonAgg AI, large map, epic speed, random personalities, all vic conditions enabled, Monarch diff.
Notes:
-The war in ~1932AD between Brennus and Pericles was me bribing Brennus into war because Pericles appeared to be going for culture vic and I wanted to stall him with little effort on my part. :) This was the only war I ever bribed someone into.
-The only across-ocean war was when Pacal declared war on me fairly late in the game. He attacked one of my west cities but died horribly. It was only a few turns before he was happy to pay a lot for peace.
-I noticed no one ever bothered to capture the barb cities in the north west. I think Hannibal had landed some units before the game came to an end, but it surprised me a bit. Is this something that is possibly affected by the changes to the code?
Any other queries about this game I can answer happily, though from tomorrow I'll be unable to access the game for about 3 weeks. I'll have to recall details from memory.
P.S. lol at the shape of my empire at ~1350AD. :lol:
Solver Jun 25, 2008, 03:58 PM Interesting. Actually Qin was on a separate landmass, too, and he did declare war as well. This is good and I like what I'm seeing.
jdog5000 Jun 25, 2008, 05:50 PM I've finished merging in the unofficial 0.17 with new changes based on the Naval AI discussion and will post a new version after a little testing this evening.
I removed the earlier change to demand for building of transports ... under most circumstances it did nothing as the bLandWar and bAssault flags are mutually exclusive (they represent different sets of AreaAIs). That section of code only fires when the AI is running AREAAI_ASSAULT, which should only trigger when the AI's only war is against a player with no cities in the area. The reduction to transport demand before galleons was therefore actually somewhat detrimental in the very rare circumstance of inter-island war before galleons. I brought this change over from my Revolution mod where I would often see the AI running AREAAI_ASSAULT in the early eras and therefore sometimes pumping out galleys that it would never use ... it turns out this was an issue with poor support for minor civs in the SDK. Minor civs are a common occurrence in Revolution and the AI was preparing to invade minor civs on faraway continents that it had never met. Now that I understand the real cause of the galley spam problem I saw a while ago (and AreaAIs a little better) it's clear that change should be removed.
Anyway, here's what the new changelog will be, I updated the format so it's a little easier to see what's going on:
Better BTS AI 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.
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.17.
glider1 Jun 25, 2008, 05:56 PM Wow cool. As far as I'm concerned the war strategy in the middle ages gets a big tick. The question is how to best test the naval changes....Hmmm. Looks like worldbuilder will be the place to hang out. Thanks for the efforts!
Cheers.
jdog5000 Jun 25, 2008, 07:11 PM Version 0.2 (http://forums.civfanatics.com/downloads.php?do=file&id=9819) is up!
BobTheTerrible Jun 25, 2008, 07:40 PM Hey guys, it's awesome that you've come in to take the reigns of this project, which I'll be following closely. I thought I'd point out another mod that has made some changes to the AI - Seven05's World Piece. In the first post of the thread, he says:
AI tweaks
The AI has undergone several changes involving countless tweaks to unit, building and technology changes. They have been made smarter and more aggressive towards each other, not just the human player(s). And, perhaps most importantly, the majority of their bonuses to production and research have been removed including a few well hidden bonuses.
The AI diplomacy has been adjusted with the major change in determining if they'll ask you to join a war or stop trading with another civ. In the case of joining their war they'll only ask you if their relations with you are better than your relations with their enemy. Their requirements to ask you to stop trading are based on your relationship with them, this value can be different per leader and mirrors their required attitude before they'll accept a request from you to stop trading with another civ.
The AI's workers (and your automated workers) should no longer attempt to improve tiles outside of the workable area (fat cross) of your cities. There are a couple of exceptions to this- they will improve tiles with resources on them if they need the resource and they will continue to build routes in tiles that can't be worked.
I know you guys are focusing on war behavior right now, but it might be useful to see what other changes he's made to improve the AI (I particularly like the diplo changes). Later in the thread he mentions wanting to create goal-based behavior for the AI, which I think would be very relevant to this project. I don't think he's updated in a while due to real life, but there's a link to his mod's thread here: http://forums.civfanatics.com/showthread.php?t=254299
jdog5000 Jun 25, 2008, 07:44 PM Thanks Bob, we'll definitely check that out.
Solver Jun 26, 2008, 10:59 AM So, does anything I did with the AI in the unofficial patch seem useful to you? :)
jdog5000 Jun 26, 2008, 02:56 PM I put it all in for 0.2, definitely just based on the code many of the pieces seemed good. Moving ships and planes out of seriously threatened cities is a desperately needed behavior, I like what you have now as a first step but I think it could be improved.
As you have it now it looks like if I land a warrior next to a heavily defended city all the AI ships will leave ... for AI-AI battles this is probably okay, but the ease of flushing out the enemy ships could be exploited. It would be better to have more of a sense of the threat posed ... maybe using:
int iOurDefense = GET_PLAYER(pPlot->getOwnerINLINE()).AI_getOurPlotStrength(pPlot, 0, true, false);
int iEnemyOffense = GET_PLAYER(pPlot->getOwnerINLINE()).AI_getEnemyPlotStrength(pPlot, 2, false, false);
if( iEnemyOffense > iOurDefense/2 )
{
move away behavior
}
The ratio of iOurDefense can be set to determine how optimistic/pessimistic the ships are. Dividing by 2 is pretty pessimistic but get___PlotStrength routines aren't perfect predictors of the odds of victory/defeat. BTW, in debug mode the game will give you the ratio of iEnemyOffense to iOurDefense for any plot while holding down ALT, it has the format "Danger: %.2f (%d/%d)" and is red.
Also, just a note that AI_getPlotDanger has the benefit of counting whether the plot is on/near a border to determine danger, which the above doesn't do ... however, it only adds the border threat if the plot is not a city, so in all the places you're using it just returns the number of nearby enemies I believe.
Right now you moved some Firaxis code for planes earlier in the AI routine, definitely a good idea but they will still only move from their base when it's threatened if there is no defender. I would say planes should be more optimistic than ships since they can injure the incoming units and ships cannot, but I would still use an approach like the above but maybe without the / 2 even up to 4/3 perhaps. When the danger fraction is above 1/2 and the planes choose to stay it might make sense for them to prioritize striking the incoming units, right now defensive air units will do airstrikes first but attack ones should as well in this situation.
Since we're on the subject, the current air unit AI doesn't take into account the player's AreaAI ... if the player is playing defense then the behavior of attack air units could be a bit different, perhaps prioritizing air strikes some fraction of the time. Currently, the priority for attack air units is to support an offensive using AI_airBombDefenses over possible running defensive airstrikes. Certainly when their base is threatened defense should take priority. But now that I look it doesn't seem like CvUnitAI::AI_airStrike currently is written with defense in mind really either, there's no boost in value if the potential air strike victim poses any threat ... from the looks of things a plane would be far more likely to airstrike an empty transport than the stack of troops it had just left next to the plane's base .... that's something else which should be looked at.
One last comment: all of this code so far is contingent on the ship/plane being in a city ... this should be updated to take forts into account by using pPlot->isCity( true ). In fact, all uses of CvPlot::getPlotCity() in these kinds of situations should be double checked since it ignores forts.
I haven't really analyzed the other changes you made ... not settling great people in endangered cities is definitely a good one (sorry to spoil the fun PieceOfMind :p) but again could perhaps benefit from some of the same ideas as above.
Solver Jun 26, 2008, 04:36 PM Yeah, I've thought about it - my code does make ships rather easy to scare away but the Ai doesn't really have good routines for evaluating danger and relative strength of enemy stacks. I'm very familiar with the debug mode ;), which is part of the reason why I'm dissatisfied with those AI estimates.
The considerations I added for planes are actually new, didn't move them from the existing code. But I don't think planes should be more optimistic. The check there checks for danger within a 2-plot radius of the city. Planes should get out if the enemy has broken through this close... yes, they can hurt incoming units but if they do, they have to stay in place and so will die anyway if the city is taken. Sure, it would ideally use those strength considerations, it'd be great if that algorithm can be improved.
As for forts... I just forgot about those :D
jdog5000 Jun 26, 2008, 09:21 PM I simulated a full game with Better BTS AI 0.2, the replay is attached :cool:
It's a Large Terra map with fairly standard settings (not Aggressive AI). Shaka went on to win a diplomatic victory in 1980 just a couple turns after this replay ... since I was automating, I had to go back and retire right before he won to get the replay. He had like 6 vassals which is what put him over the top for Diplo, plus he was most of the way to a Domination victory. Right at the end he starts a true World War by declaring on 2nd place Asoka who had two vassals.
BTW, it says it took 10 hours, but it was open sitting there doing nothing in the background for most of that ...
oedali Jun 27, 2008, 03:35 PM FYI, Solver just released a new version (http://forums.civfanatics.com/showthread.php?t=279724)of his unofficial patch
Solver Jun 27, 2008, 05:00 PM The AI nuke ban tweak from my latest version may be something appropriate for this mod.
glider1 Jun 27, 2008, 06:05 PM I simulated a full game with Better BTS AI 0.2, the replay is attached :cool:
565AD: Shaka dows on Asoka a non-neighbour but it is a religious war.
950AD: Hannibal becomes a vassal of China (why)
1060AD: Shaka DOWS on neighbour Egypt (why)
1070AD: Shaka and Egypt make peace in 1 turn (how)
1140AD: Ramesse and Asoka dow on China/Hannibal
1140AD: China/Hannibal dow on Mansa (border war! but wise?)
1150AD: Bismarck dows on China/Hannibal(Bismarck is being squeezed)
1170AD: China/Hannibal break away from each other
1180AD: Shaka dows Asoka a non-neighbour (why)
1200AD: Isabella dows on Shaka a non-neighbour (probably religion)
1210AD: Asoka, Isabella and Shaka make peace in 1 turn (how)
1295AD: Shaka turns on neighbour Ramesse (border war!)
1300AD: Asoka and China declare peace but Asoka still at war on Hann
1310AD: Ramesse and China declare peace but Ramesse still at war on Hann
1315AD: China becomes vassal of Bismarck and thus at war on Hann (border war!)
1315AD: China/Bismarck at peace with Mansa because of vassal agreement
1350AD: Ragnar dows on China/Bismarck (in centre hotspot)
1355AD: Shaka making good progress in border war with Egypt
1370AD: Bismarck making good progress on Hannibal
1385AD: Bismarck/China make peace with Hannibal
1390AD: Hannibal makes peace with Mansa
1460AD: Ragnar looses war and becomes vassal of Bismarck/China
1470AD: Hannibal looses war and becomes a vassal of Asoka
1485AD: Shaka wins war on Ramesse extending border territory and peace declared
1495AD: Ramesse becomes a vassal of Shaka
1515AD: Shaka/Ramesse declare regional war on Isabella
1570AD: Shaka wins border territory from Isabella and Isabella becomes a vassal
1595AD: Bismarck/China/Ragnar DOW on Shaka/Ramesse/Isabella (emerging east/west conflict)
1655AD: East/West war over with Bismarck making some border territory on Shaka
1728AD: Bismarck/China/Ragnar DOW on Asoka/Hannibal (why)
1734AD: Shaka/Ramesse/Isabella DOW on Bismarck/China/Ragnar(good)
1750AD: Good border wars between vassal rival
1766AD: Bismarck making good progress in border war with Ramesse
1776AD: Wars over leaving Bismarck and Shaka with a little more border territory
1796AD: Bismarck/China/Ragnar peace with Asoka/Hann with Bismarck making more centre territory
1800AD: All old world wars are over and now new world race begins
1824AD: Shaka/Ramesse/Isabella DOW on Bismarck/China
1851AD: Ragnar liberates new world to Roosevelt
1855AD: Bismarck looses significant ground in border war with Shaka
1856AD: Bismarck/China break apart
1860AD: Shaka/Ramesse/Isabella make peace with Bismarck and vassal him
1860AD: Bismarck turns on broken vassal china (border war in centre)
1878AD: Shaka(west) captures China city (east) how?
1878AD: China becomes vassal of Shaka
1891AD: Mansa gets on with wonder construction
1892AD: Mansa at war with Ragnar in new world (how)
1898AD: Shaka/Ramesse/Isabella/Bismarck(west super power) DOW on Mansa
1908AD: West war against Mansa over with Mansa loosing old world territory
1918AD: Mansa looses old world territory to Ragnar in only old world war
1924AD: New world/old world war begins between West super power against Ragnar/Roosevelt
1934AD: Old world war status quo but new world war favours west super power
1934AD: Ragnar/Roosevelt become vassals to western super power nations
1936AD: Ramesse breaks vassal arrangement with western super power because of new world territory gains
1941AD: Ramesse returns to the western super power as a vassal (good idea!)
1941AD: Mansa liberates old world city to Asoka/Hannibal
1943AD: Mansa almost non-existent in old world but has large new world territory
1945AD: World war between west/east including Mansa verses the West
1959AD: World peace with the western super power making good progress
1959AD: Ramesse breaks free of western super power and continues war on Asoka in new world(not a good idea?)
1969AD: Western super power DOWS on Ramesse (punishment)
1974AD: War over Ramesse gains in new world but looses in old world
1978AD: Massive world war
-Shaka head of the western super power wins a diplomatic victory-
These are my comments:
1) sounds like a heap of fun
2) there seems to be a mix of border conflict and religious conflict early
3) a couple of questionable war decisions
4) The early phases of the old world wars need examining
5) The interaction between the old world and new world is complicated and possibly produces questionable war declarations
6) This game started with low number of civs and thus was not all about border wars. If you start with high numbers of civs, border war is much more emphasised earlier.
7) This behaviour of Better than BTS seems consistent and reasonable.
Cheers.
jdog5000 Jun 28, 2008, 01:21 PM Yeah, religion and more broadly relations, still have a very strong effect on wars ... Shaka was on pretty good terms with his neighbors and so only had either 60% (Cautious) or 10% (Pleased) chance of considering war against them. His first DOW on Asoka fell to his 3rd choice (in terms of startWarVal) because of relations which were fueled by sharing religion.
You can see that Shaka's startWarVal for Egypt was higher but his relations with them caused him to sometimes choose war against India instead in the beginning. He also had a small chance of DOW on Isabella iirc.
I have saves from BC 800 every turn through the rest of the game if you want to check any of them out. I'll look into those strange early peace deals, that seems a little odd.
glider1 Jun 28, 2008, 10:04 PM Yeah, religion and more broadly relations, still have a very strong effect on wars ... Shaka was on pretty good terms with his neighbors and so only had either 60% (Cautious) or 10% (Pleased) chance of considering war against them. His first DOW on Asoka fell to his 3rd choice (in terms of startWarVal) because of relations which were fueled by sharing religion. You can see that Shaka's startWarVal for Egypt was higher but his relations with them caused him to sometimes choose war against India instead in the beginning. He also had a small chance of DOW on Isabella iirc.
When Shaka finally dows on his neighbour Egypt in 1295AD, that is the beginning of the Zulu victory. That was a border war.
The other beautiful thing about the BTS engine in this example was Mansa. His AI seemed to concentrate on non-violence and culture and finally when the pressure on him in the old world got too much, he successfully colonised the new world, to such an extent that his new world existence was much more influential than his old world was. However he had heavily built a lot of culture in his old world territory which ensured his survival.
We should not destroy the beautiful relationships between the various paths that are possible in this great game. We should just continue to develop without destroying the balance. Difficult.
Of course I realise that on first impression, this "example" contains a lot of warfare which makes "standard" aggression look more like "aggressive ai" in Better Than BTS! But if you were to look at the finer grain of this example, I'm sure there would have been a lot of fun in the non-violence geo-political juggling act even with only nine initial civs!
The other observation is the emergence of better regionality now. I might be delusional but there seems to be much more regional cooperative relationships between ai's emerging in Better than BTS. It's like now that the chance of "spurious" closeness wars are minimised which is equivalent to "noise", the delicate growth of regional cooperative partnerships is now not destroyed.
What is interesting is how in BTS, it appears that smaller numbers of starting civs can mean the emergence of large scale regional partnerships which results in large scale world war later. Starting with high numbers of civs seems to disturb the formation of these large scale partnerships which actually results in less large scale warfare but greater distributed warfare.
Cheers.
Duuk Jun 29, 2008, 12:19 AM I'll pipe in: I love the closeness changes. The AI actually eliminates neighboring civs in conquest now. I had almost never seen an AI-on-AI civ destruction before this patch.
jkp1187 Jun 29, 2008, 07:43 AM Version 0.2 (http://forums.civfanatics.com/downloads.php?do=file&id=9819) is up!
jdog -- can you start a new thread with the most recent updates in the first post? That way it'll be easier for people who want to give it a try to find the latest version....
jdog5000 Jun 29, 2008, 06:45 PM 0.2 Discussion thread (http://forums.civfanatics.com/showthread.php?t=280857) created.
glider1 Jun 30, 2008, 09:08 PM Referring back to the game sample Jdog supplied, could someone remind me why an AI can declare war and then declare peace in one turn? Probably an explanation but can't think of it. For example in the save game above:
1060AD: Shaka DOWS on neighbour Egypt (why)
1070AD: Shaka and Egypt make peace in 1 turn (how)
Is it simply that AI's never "refuse to talk" with each other only with humans (no big problem with that I think?). What made Shaka want to go to war and then change his mind? What did Egypt supply him with to appease him in only 1 turn?
I wonder if Jdog still has the autosaves for this situation?
EDIT: Doooh. Forgot possible vassal arrangements affecting these instant war/peace declarations. Did Egypt sign a vassal arrangement with someone Shaka is not at war with?
Cheers
BobTheTerrible Jun 30, 2008, 10:08 PM Could have been a random event, too (one of those "peacemakers" ones).
EDIT: AIs do "refuse to talk" to one another. If 2 AIs are at war, and you contact one of them to see if they'll make peace with the other, sometimes the peace option is redded out, and says "we'd love to, but you'll have to contact them" implying that the other AI "refuses to talk" to that one.
glider1 Jul 01, 2008, 01:56 AM @BobTT
Nice. Forgot the random event possibility. It happened twice in Jdog's example which is not completely impossible for a random event. Hmmmmmmm.
Cheers.
jdog5000 Jul 01, 2008, 01:49 PM EDIT: AIs do "refuse to talk" to one another. If 2 AIs are at war, and you contact one of them to see if they'll make peace with the other, sometimes the peace option is redded out, and says "we'd love to, but you'll have to contact them" implying that the other AI "refuses to talk" to that one.
Is refusing to talk the reason for that? I thought it was one AI was simply losing and you'd have to give stuff to the other AI to get them to stop the bloodshed since they were winning.
EDIT: As I thought, this is triggered when one AI has a very different AI_endWarVal than the other, usually because one is winning. There does not seem to be a block in AI_makePeaceTrade for refusal to talk.
jkp1187 Jul 01, 2008, 02:49 PM Could have been a random event, too (one of those "peacemakers" ones).
EDIT: AIs do "refuse to talk" to one another. If 2 AIs are at war, and you contact one of them to see if they'll make peace with the other, sometimes the peace option is redded out, and says "we'd love to, but you'll have to contact them" implying that the other AI "refuses to talk" to that one.
I've never seen this option redded out for both parties. If it's redded out for one, it means you have to talk to the other party, who will be amenable to the idea of a bribe to end the war.
BobTheTerrible Jul 02, 2008, 12:04 AM You guys are right. I never really thought about it. I assumed that the AI that was saying "you'll have to contact them" was open to peace, but the other AI just had "refused to talk" to them (just like how when an AI declares war on you, you may or may not be open to contacting them, but they won't let you).
glider1 Jul 02, 2008, 02:01 AM So excuse me if I'm confused but are we back to square one? That is why and how does an AI declare and retract a war declaration in one turn? If only one party refuses to talk that should be sufficient to cancel any possibility of retracting the war declaration immediately?
It may not even matter to the Better Than BTS discussions. Wasn't Yakk indirectly harking to this "issue" on page 1 post 1 of this forum?
If Jdog still has the saves that would be good but if not that's cool because this situation happens fairly regularly and can be recreated and has probably been resolved on some other forum anyway....
Cheers.
armand453 Jul 02, 2008, 06:22 AM Very good begining :). I hope you'll manage to learn to the AI to do serious amphibious attack at the end.:goodjob:
glider1 Jul 02, 2008, 03:48 PM Agree, if amphibious attack could be improved, that would already make the AI much better. A forum is up and running on this topic:
http://forums.civfanatics.com/showthread.php?t=281085
Cheers.
Iustus Jul 03, 2008, 10:33 AM Hello everyone,
Glad to see there is still some interest in this.
As I mentioned in my response to the sourceforge private message, I would be happy to add some folks as developers/admins to the sourceforge site. just pm me your unix name (not password) for the sourceforge site.
I am not sure what the process is to get the admin of this forum changed, but I would be happy to do that as well.
-Iustus
ori Jul 03, 2008, 10:49 AM I am not sure what the process is to get the admin of this forum changed, but I would be happy to do that as well.
-Iustus
probably just pm Thunderfall...
jdog5000 Jul 03, 2008, 12:51 PM Thanks Iustus, having the sourceforge repository will be great.
jdog5000 Jul 03, 2008, 03:05 PM Referring back to the game sample Jdog supplied, could someone remind me why an AI can declare war and then declare peace in one turn? Probably an explanation but can't think of it. For example in the save game above:
1060AD: Shaka DOWS on neighbour Egypt (why)
1070AD: Shaka and Egypt make peace in 1 turn (how)
Is it simply that AI's never "refuse to talk" with each other only with humans (no big problem with that I think?). What made Shaka want to go to war and then change his mind? What did Egypt supply him with to appease him in only 1 turn?
I wonder if Jdog still has the autosaves for this situation?
EDIT: Doooh. Forgot possible vassal arrangements affecting these instant war/peace declarations. Did Egypt sign a vassal arrangement with someone Shaka is not at war with?
Cheers
I went back to check out the 1-turn war. Ramesses is the owner and resident of the AP and is given the option to call a vote on the same turn that Shaka declares war. Since Ramesses' turn comes after Shaka's, he calls for an end to the just started war and the voting members agree. The war ends on the next turn.
Glad that's settled, it certainly looked strange!
glider1 Jul 03, 2008, 03:30 PM There is one more occurrence in your reference game of a 1 turn war. I suspect it has a simple explanation as well.
Cheers.
jdog5000 Jul 03, 2008, 05:29 PM Version 0.21 (http://forums.civfanatics.com/downloads.php?do=file&id=9819) has been posted!
Updates include Solver's 0.19 and a lot of small tweaks to the behavior for moving ships and air units from threatened cities. Most importantly, the retreat AI for these units has been specialized for the various Unit AI types (ie, battleships, carriers, and transport groups will respond differently).
Enjoy.
glider1 Jul 03, 2008, 07:23 PM Thanks Jdog! It looks that you are possibly iterating closer and closer to improving one of the biggest AI tactical problems for vanilla BTS and Revolutions, amphibious invasions. You have a rapidly improving insight into the mechanics of this AI beast, so we all hope that you can crack it. :goodjob:
EDIT: just looked at the "readme". Thanks for ensuring that you keep this text file up to date so that testers can have some idea of what to look out for in the various contexts the AI has been re-engineered.
MaxCiv Jul 04, 2008, 04:36 AM Thank you jdog! This is excatly what I was waiting for before starting a new game. Well done!
jdog5000 Jul 23, 2008, 12:32 AM Version 0.3 has been posted in the usual place (http://forums.civfanatics.com/downloads.php?do=file&id=9819), includes a very important trade bug fix thanks to DanF's persistence!
glider1 Jul 23, 2008, 05:33 PM Version 0.3 has been posted
Excellent stuff and thanks to everyone for this. Do testers consider this as solid release on fixing transcontinental invasion? If so, I'll go straight into small sized continent maps and check it out.
Cheers :goodjob:
jdog5000 Jul 30, 2008, 12:15 AM Version 0.35 (http://forums.civfanatics.com/downloads.php?do=file&id=9819) has been posted, fixing the bomber bug and making a lot of other improvements to airplane behavior.
Enjoy.
jdog5000 Aug 17, 2008, 07:37 PM Version 0.36 (http://forums.civfanatics.com/downloads.php?do=file&id=9819) has been posted. Fixes the recently discovered bugs with immunity to collateral damage, spread culture espionage mission, and civs refusing to switch to Emancipation instead of out of it.
Enjoy!
glider1 Aug 18, 2008, 12:24 AM Brilliant Jdog thanks :goodjob:
jdog5000 Sep 05, 2008, 06:08 PM Version 0.37 (http://forums.civfanatics.com/downloads.php?do=file&id=9819) has been posted. Several small fixes including everything from Unofficial Patch 0.19.1 (thanks Dresden!). Also includes adapted AIAutoPlay and ChangePlayer python components to make debugging easier and fun.
Enjoy!
|
|