[MOD] Improved FFPlus AI

A few civic combinations that I use:

Agrarian+Aristocracy (common) but also combine with STW and lots of sanctifying adepts

Apprenticeship+conquest (combine with other methods to get xp like command posts and such to pump out units with high xp - works even better with regular FF's theocracy for starting with 6 xp, but Valkrionn changed that, because then I was able to get units to start with 10 xp)

City States + Free Trade + Social Order (or religion, if you have lots of religions in your cities) (works very well with the Lanuan, don't have to worry about city happy caps, and they would have a large number of high food coastal cities. Switch from free trade to conquest in times of war)

Not a civic combination, but with the Kurotaes, build a few order priests, switch to a neutral civic, and upgrade the order priests to druids for permanent social order in ALL their cities. If switching to neutral consists of going to OO, can add to it by building the Tower of Complacency in their highest production city. Other civs can use this trick as well to get very large cities, and then switch back to order afterwards to get level 6 priests and sphener for a total of Tower of Complacency and 9 units casting unyielding order. Combine this with farms and agrarianism for very large cities (aristocracy is recommended), or combine with coastal cities and free trade for very large trading cities.

Thats all that I can think of off the top of my head.

-Colin
 
Aristo-grarian is already a viable option for the AI, especially for financial leaders. With StW they will adopt it if hell terrain begins to take over their lands, but I cannot control what they do with their adepts (sanctify). Hopefully when Wild Mana is merged in, that will help with things like that.

I will look into having the AI adopt Conquest and Apprenticeship if they already have a source of free XP to bump them over the 5XP mark (Form of the Titan, Shrine of the Champion, Military State + Organized Trait or Charismatic), so they get that all important extra level for their units. I might have to block conquest in certain situations though, especially early game as the AI has a tendency to always produce military and never grow their important cities.

I'll definitely have to check that Tower of Complacency is built intelligently and not in some mediocre nameless city.

I dont really like strategies that involve state religion switching as I find it a little "unflavourful". The only time a civ will "consciously" switch religion is when they do not have the holy city and a flavourful alternative is available to be founded by them.

Just FYI, next release is on course for tomorrow (Friday).
 
Ok, the new version is up (See first post). I hope it is as bug free as I think it is! Its definitely a vast improvement on the last version and as such I recommend all those who downloaded the previous version to update to this one, the installation process is exactly the same and it shouldn't affect saved games.

Have fun, and let me know what everyone thinks of the progress so far and if there are any directions they would like to see this go in, at the moment I am only editing the one file for simplicities sake but if there are ways to branch out to maybe one or two other python files and achieve great results then I may look into it.
 
i played with this new AI in hot seat with a friend:

-map standard, tectonic script
-difficulti prince, 8 player -> 4 team (team1: me and my friend: random, team2: random evil, team3: random neutral, team4: random good
-option : flavour start, barbarian world, living world, broarder alignement, enable combat log


early in the game (turn 100 and below):

-IA make lots of infantrie to defend their city (capital), but dont defend their worker, and settler and the town he have create with a settler and prefer have a large amount of troupe in their capital.

->in turn 120 an ai have none improvement in their capital foreground (herne curiotate)

-IA expend and create new town is slow, i am in prince and have 3 town well defend (4 warrior in all my town and some in territories to defend worker), the ia have just capital in turn 100, turn 120 just 1 ia take town to barbarian faction (averax; sheaim)
 
I am playing a no settler option game.

They are protecting their workers in my game. Mainly seen melee roaming around. Most the archers seemed to be defending.

BTW It did break my saved games. No big deal to me, but thought I would report it.
 
Hm, in my last game a Doviello fellow[Ai] never had any improvements and no workers that could be seen -all the way up to around turn 250, at which point a new game was started-; the Doviello did have two cities and a decent melee army. The other 6 or so civilizations seemed to be doing alright though.

Edit: The message that I was trying to convey was: the Doviello[Ai] in this instance did not seem to have any barbarian troubles in the slightest but yet still had no improvements. I therefore assume/d that they were, in fact, not making workers in the slightest -which is why I posted in this thread-.
 
Hmm, im really not sure how it could break saved games with the changes only being python but maybe im wrong on that one. Sorry to anyone who experienced anything unexpected!

One thing I have to make clear is that I have not influenced how the AI decides to use its units once they are produced. This cannot be done just by editing the one file I have chosen to edit. Tech and unit choice however have been changed significantly.

@Frogeater:

IA make lots of infantrie to defend their city (capital), but dont defend their worker, and settler and the town he have create with a settler and prefer have a large amount of troupe in their capital.

I have never seen the AI defend their workers any differently than usual using my mod, perhaps try disabling worker experience so that they never have any defensive strength, this seems to be the reason the AI dont deem them to be vulnerable afaik.

in turn 120 an ai have none improvement in their capital foreground (herne curiotate)

Again, I have never seen this either. There will be some improved code coming concerning the number of workers a civ should build when I get round to it though. I do know however that there is a problem with the Kuriotates where they build their first settler and NEVER settle it, which is quite frustrating.

IA expend and create new town is slow, i am in prince and have 3 town well defend (4 warrior in all my town and some in territories to defend worker), the ia have just capital in turn 100, turn 120 just 1 ia take town to barbarian faction (averax; sheaim)

Sometimes the AI will stay with just their capital starting city for a little longer than optimum, but there is nothing in this mod that would cause that to happen more than with the original AI. In fact to the contrary, the AI have been given specific instructions on how to expand until they reach 5 cities, which is usually as soon as possible.
 
I tested this mod for a few days now.

Nice job, the AI seems smarter all around, even though it still can't deal with naval warfare/colonization.

My only big concern so far is the AI turns take now too much longer on certain maps (up to 120% more waiting time). :(
I tested this by swapping your cvgameutils.py file on & off with the original FFPlus one, while timing the same turns.
By the way, it obviously didn't break my saved games.

Maybe someone else want to test this as well, as my comp is not very fast to begin with.:badcomp:
 
The file size is over twice the original, so some slowdown especially on low end machines is going to happen. I will have a look at trimming any excess code for the next release but that wont be happening until the new FF+ patch and that is assuming I have enough changes to make to continue the mod further.

When you say 120% do you mean over twice the duration or a 20% increase?
 
File size won't affect how fast the AI takes its turn. It sounds like some of your changes are requiring lots of processing time.

OTOH things that can cause lengthy turn times can also cause increased file size.

ymmv
 
Yeah I was mostly referring to the fact that greater file size = more code and more code = more slow :D

Has anyone else experience significant slow downs while using the mod? If so, I might have to go back and take a look at minimising those plot checks for resources and hell terrain as I have a feeling it could be those.

I, however have suffered little difference in turn times compared to the original AI. Either that or I just dont notice because FF is pretty damn slow anyway :lol:
 
The check all plot functions are definitely a resource hog. That's why I only used them in my mod in the early game, where slowdown is less noticeable. Checking for hell terrain sounds like overkill.
Generally loops should be used only cautiously.

In addition the canbuild callback gets called extremely often, so any code there should be kept to a minimum.
 
The check all plot functions are definitely a resource hog. That's why I only used them in my mod in the early game, where slowdown is less noticeable. Checking for hell terrain sounds like overkill.
Generally loops should be used only cautiously.

In addition the canbuild callback gets called extremely often, so any code there should be kept to a minimum.

That right there is one reason I was so happy that Ahwaric merged in Jeckel's Improvements Mod.. Can set distance between improvements via xml, no need for a can-build check anymore. :goodjob:

The other is, of course, that I don't need to check all plots on the map each turn for a Fort Commander and grant culture anymore. :eekdance:
 
checks for resources and hell terrain

Maybe instead of checking for the presence of the hell terrain, the AI should just ask itself,
1) Is Hyborem in the world, if so, then
2) Is the Armageddon Counter above <whatever threshhold makes sense>.

Seems like that would serve mostly the same purpose with a lot less processing.
 
Found a bug in the code. ;)

Where you determine if an AI should build the Tower of Complacency, you check for health in the city... However, the check you used doesn't exist. I've bolded the problem area, and it's fix.


Code:
if 	eBuilding == gc.getInfoTypeForString('BUILDING_TOWER_OF_COMPLACENCY'):
	if  pCity.[B]getHealth[/B]() <= 14:
		return True

Code:
if 	eBuilding == gc.getInfoTypeForString('BUILDING_TOWER_OF_COMPLACENCY'):
	if  pCity.[B]goodHealth[/B]() <= 14:
		return True
 
Ah, that explains the bug I was getting the other day, it was saying something about getHealth no found or some such.
 
Back
Top Bottom