View Full Version : [MOD] Improved FFPlus AI
Secret_Squirrel Sep 07, 2009, 02:09 PM This is a small project I undertook in order to learn the basics of python, and so far its going well so I thought I would share it. Suggestions and feedback more than welcome.
Improved FFPlus AI - Version 2 Released!
The object of this modification is to make the AI make informed tech and unit choice decisions that are true to the flavour and playstyle of their race while maintaining a certain level of unpredictability. There is an equal focus on ensuring the AI economy will no longer crash due to poor economic teching.
Installation Instructions: Extract the zip file into your Fall Further Plus installation folder. If you have modified your CvGameUtils.py you should make a backup. The mod also relies on an unmodified PythonCallBackDefines.xml.
Note: If you have Odalrick's Modular Python mod installed, I'm pretty sure it would overwrite this but maybe not.
Changelog:
Teching:
- ALL civs have had their early beelines changed so that they are more "flavourful", biased towards ensuring that each civ leverages its strengths, builds its Unique Buildings and fields its Unique Units and Heroes.
- AI will research the required worker techs if enough resources of that type are present in their territory. ("Stolen" and modified from Turinturambar's Economic AI for FFH)
- Oceanfaring techs researched if the AI has many coastal cities.
- AI will ensure they have early economic techs before teching their preferred Tier 2 military techs.
- Writing beeline no longer based on random numbers, AI will now ensure they have writing before they delve too much into advanced military.
- Archery prioritised for those who have emphasised the recon line and do not have Bronze. (Ensures adequate city defense).
- Education researched early if civ starts near a lot of flood plains.
- Civs will now react to Hell Terrain entering their lands or somebody bringing Hyborem into the world, they can do the following:
Non Evil civs will research Divination if hell terrain starts to appear and they do not have life mana.
Evil civs will research Infernal Pact (to adopt AV&StW) if hell terrain starts to take over their lands.
AI's forced to make a decision on which "side" they take by researching Way of the Wise/Wicked dependant on their alignment and their mana types (Life, Nature, Law increase chance of heading for the Overcouncil. Death, Entropy, Chaos - Undercouncil)
- AI will check for opportunities to snatch the free great people at Drama, Military Strategy and Arcane Lore if nobody else has had them.
- War will now make the AI react!:
If an early war occurs, the AI will check if it has Copper in its territory, and if it does, it will beeline Bronze Working to get those str 4 warriors. If not then it will tech Archery.
If the enemy is superior in technology and weapons during an early war, the AI will focus on defensive military techs.
The AI will now ensure it has sufficient siege to conduct a war if it is able to build them.
- Peace will make the AI focus more on economy and (affordable) expansion.
- Better Magic!:
Node building techs (Necromancy, Divination, etc) prioritised by alignment.
Civs with Enchantment mana will pick up KotE once they have Bronze Working.
Sorcery researched sooner if the AI acquires more mana types.
AI now has a strategy when building new mana nodes and is fully capable of death mana/spectre spam.
Everyone will pick up a single enchantment node if they have Alteration.
Most (living) civs will pick up a single body node if they have Alteration.
Elves will try to build a fire node asap.
- AI will go for late game civilization/religious heroes with as much zeal as the early ones.
- Some early game blocks for not so useful techs. Stirrups for example is useless if you have no Horse or equivalent resource. (Unless your civ does not require it).
Religion:
- Religion founding now a lot more diverse and unpredictable while maintaining flavour. (Most civs have 2 or more available religions they can consider founding when appropriate).
- If there are unfounded religions and the civ does not have much incentive to remain under a religion they did not found, they are likely to try and found another fitting religion for themselves.
- Priesthood heavily prioritised for those with the Holy City of their state religion.
- No disciple spamming by civs who do not have flavour affinity for their state religion or the holy city.
- Religious techs will not be researched by those with inappropriate alignment (evil civs wont found order, empy, etc).
- Religious Civics adopted asap if civ has the holy city of their state religion.
Unit production:
- Much greater stack diversity. A lot of work has gone into trying to provide variety while remaining effective.
- Limited workers to 3 per city during peace. 1 per city during war. (They will not disband any units, they just wont build more unless they lose a whole lot).
- Very controlled Settler production to ensure limited over/under expansion.
- Scouts limited to 4 (except Svartalfar).
- AI Will no longer build certain low strength units if their rivals have better units. Example: Horsemen limited to 5 for everyone except the Hippus if any neighbouring civ has Iron Working and Iron weapons.
- Will no longer produce their first settler without appropriate military defense.
- Javelin Throwers limited to 2 per city if the civ has Bronze Working.
- Priests limited to 3 per city until Theology. (To stop most notably, the tiger spam!)
- AI will not build Privateers if rivals have superior naval technologies.
- Archers limited to 5 per city for everyone except Ljosalfar and Amurites.
- Once Archery has been researched, total number of warriors allowed limited to 5 per city. (Ensures civs able to build archery ranges will not continue to use warriors as city defenders).
- World Units cannot be built in cities with poor production
- Heroes built as soon as they are available
- Illians get their Temple of the Hand sooner if the terrain around the city is poor.
Building production:
- AI will build more markets in general.
- Infernal AI will no longer build health buildings.
- Many MORE changes to influence how the AI handles building construction.
- Most civs are now quite fond of their unique buildings (Shrouded Woods, Warrens, etc).
- Unit training buildings built more often, and with more variety and intelligence. Taking into account traits, available mana, technologies, etc.
- Commerce and science improving buildings (Library, Money Changer, etc) will be built more often when the civ is not at war, and the AI now only prioritises them in cities with a high science/commerce rate.
- Courthouses built when maintenance is high.
- Forges prioritised in high production cities.
- Theoretically the AI is capable of a tower victory, but only if it acquires enough Mana types.
Improvements:
- Cottages will not be built under Aristocracy if there are other options.
- Workshops will not be built unless Guilds has been researched.
- Elves blocked from building Lumbermills.
Civics:
- Religion civic blocked for those without a state religion.
- Pacifism blocked when at war if leader does not have Philosophical trait, however the switch out of Pacifism is only allowed if the civ can afford the turn of anarchy (has enough defenders).
- Conquest blocked until Sanitation to prevent early adoption stifling growth. Later it can be adopted by AI's if the free XP provided allows them to reach the 5XP mark (or less for Charismatic leaders). For example, civ has or is building Form of the Titan and running the Apprenticeship civic.
- God King cannot be maintained if the civ acquires too many cities and they have the Cartography tech.
- Apprenticeship cannot be maintained once the civ has researched Taxation as by that point there are much better civics available.
- AI will now adopt Foreign Trade if it has lots of coastal cities and can benefit significantly from it.
- All the above changes take into account religious civics and AI's running those civics will not change due to any of the above circumstances.
Bugs/Known Problems:
- Kuriotates have a habit of building their settler unit and then never settling it, even when there are no external threats. I would try to change this using getCityFoundValue but that gets called 5 bazillion times per turn and just isnt viable.
- The supply cost bug in FF affecting summons can sometimes kill the AI's economy now that they are likely to utilise the summons more in general. I hope this bug is fixed soon!
- I had to remove the imported code from the Economic AI mod which gave instructions on when to build less/more adepts. For some reason it was causing certain civs to stop building completely in one or more of their cities. Since I removed this code, it has not happened since and I have no other references to Adepts/Mages at all any more. The AI still use them better than before but I dont strictly control how many they build any more. Not until I can come up with a better system or get this one working.
To Do:
- Specific Infernal/Mercurians AI. They wont do any worse, they just dont have as many instructions as all the other civs.
- Perhaps a more predictive rather than reactive approach in the AI's behaviour. I may have them check their neighbours' attitudes and have them react based on that. If everyone around them is getting along nicely they can be more builder oriented, if everyone hates them then prepare for war. I think this approach would be better than a strict is/is not at war system. (Assuming neighbours' attitudes can be measured using Python!)
- More playtests, its difficult for me to assess where to go with this now until I review their performance more. Its much faster if I just watch the AI play but after recently witnessing an AI clash between Abashi the Black Dragon and Sphener, I think I might just play it a bit more now instead.
Download Version 2:
Valkrionn Sep 07, 2009, 02:43 PM Looks very nice indeed... May end up merging this in entirely. :goodjob:
Iceciro Sep 07, 2009, 02:57 PM Shame this is for FF+ and not base or I'd be using it. May still have a look at it and see things.
Valkrionn Sep 07, 2009, 03:09 PM Actually... This may be the first FFPlus specific mod made by someone other than a team member. :lol:
Secret_Squirrel Sep 07, 2009, 03:31 PM Although I have tried to put as much FFPlus specific stuff into it as possible, there isnt an incredible amount. It should be pretty simple once I get it "finished" to port it over to FF if the demand is there.
lemonjelly Sep 07, 2009, 04:05 PM Wow! This looks really good. I will definately use it when I play FF+ :D !
May I borrow this for Fallen Ages? I tried merging the Economic AI python mod, but it is rather complicated. This would work better for FF+, and would be easier to merge.
Great job! And, Valkrionn, I think you may be right. Fallen Ages was the first posted (Idea-wise) but this is the 1st released mod that I'm aware of that wasn't made by a team member.
x
Iceciro Sep 07, 2009, 07:06 PM I dunno, do you count the fact that my modular mods have always been viable for Fall Further Plus? If so, I had my mods out before Fall Plus was done :D
blade117 Sep 07, 2009, 08:58 PM PLEASE MERGE THIS!!!!!! (Just a thought.)
Valkrionn Sep 07, 2009, 11:50 PM I dunno, do you count the fact that my modular mods have always been viable for Fall Further Plus? If so, I had my mods out before Fall Plus was done :D
Nope. Those are 'compatible' but not 'exclusive'. :lol:
Even if they're linked to in the first post of the download thread... Need to add this one too.
PLEASE MERGE THIS!!!!!! (Just a thought.)
Planning on it, although I believe it's not a finished piece? Might merge just parts for now, incorporate more when it's finished.
Secret_Squirrel Sep 08, 2009, 06:45 AM Its not actually all that far away from what could be called a finished piece. I plan to add the missing races this week and do a little more play testing. Then I imagine there wont be much left to do and you can merge away.
2Hydroclopse Sep 09, 2009, 11:34 PM Suggestion/Request:
Would it be possible to not outright limit the number of a specific unit an AI civ can build? Instead, perhaps, have them be limited based on a case by case appraisal of their economic situation? This would be a more complicated solution than the original; but, it seems that it would be more intellectual for the AI.
Also, regarding archer spam, sending over stacks of archers isn't really a bad idea, (this is referring to offensive archers in specific; as for defensive archers, having ten defending on an enemy city might be bad for you, but if their economy is proficient, then it is only good for them, otherwise defensive production of archers could be limited as the above paragraph suggests). The AI just needs to know to use offensive archers for siege purposes rather than a direct city-attack.
Secret_Squirrel Sep 10, 2009, 08:50 AM There arent many limits imposed and of those I agree that the archer limit could be troublesome, as it stands it is still possible for archers to be used offensively but they rarely form the majority in an offensive army unless flavourful for them to do so.
I could have the limit completely lifted by another tech that would provide adequate city defender replacements for archers but in general they are always better when used defensively, even if that means comprising a small defensive group in an offensive army.
As for them being supplementary siege, I try to encourage the AI to build catapults wherever possible as I find them more effective. The obvious exception being the elves. Consequently the Ljosalfar do not have any cap on their archers, that only leaves the Svartalfar, I may remove the limit entirely for them too.
Breez Sep 10, 2009, 10:17 AM I have not played your mod as I accidently removed FF+ thinking it was an old version of FF... yeah I am an idiot.
Anyway, On unit production limits - have you concidered a limit on the number of Scouts, Hunters, and Rangers for the non-recon centric races? and/or limits on adepts (not mages)?
It seems I get invaded by stacks of Adepts and Rangers currently and those are 2 of the worst to attempt to take cities with. I am talking a stack with 12 rangers, 9 adepts, 1 Champion, and 3 or 4 catapults. It would be much more appropriate to see stacks of 16 Champions, 3 Rangers, 2 or 3 adepts, and 3 or 4 catapults
I think a limit of 4 adepts, 4 rangers, 3 hunters, and 2 scouts per city might be a good place to start thinking about.
2Hydroclopse Sep 10, 2009, 11:12 AM By siege I meant tile guarding in enemy fat-crosses, prioritizing the crippling of production and food for the city.
Also, nice mod this one is -other than my dislike of static AI unit production limitations-.
PS: Kuriotates might benefit from a higher cap, seeing as their cities can support a larger economic bubble, and that they have a limited number available.
Secret_Squirrel Sep 11, 2009, 08:33 AM Since the hard unit caps seem to be off-putting for some, i'll go into more detail about what is there, and what is currently under revision:
Scouts are currently limited to 4 for all races (considering removing this for Svartalfar).
Warriors are limited to 5 per city once the civ has researched Archery (helps with diverting hammers to get that first Archery Range up).
Javelin Throwers are limited to 2 per city once Bronze Working is researched.
Archers are limited to 5 per city once the civ (excluding elves) has researched Bronze Working (Will review for Kuriotates).
Adepts limited to 6 unless civ has Arcane trait or the Sorcery tech.
All tier 1 religious disciples limited to 3 unless civ has holy city or flavour-affinity for said religion (Example: Malakim - Empyrean).
Rangers are not limited because I find them a viable mainstay unit in the right circumstances, most of these "hard caps" are focused on the early game when mistakes are more fatal. I would like to apply as few of them as possible.
I have been doing some more play tests and tweaking so expect another version soon. I will also try to provide a more complete change log as its a little sparse compared to the number of actual changes.
Iceciro Sep 11, 2009, 08:44 AM I like those things you've posted up, Secret. Those seem like they'd actually really help the AI in the early game, where they tend to get eaten by barbs or other AIs with better teching.
Do you think it would be too off-flavor to order the Amurites to research Archery before going off down the Arcane line? They always tend to fair poorly in my games, and I think it's because they go straight for Adepts.
Breez Sep 11, 2009, 09:14 AM Since the hard unit caps seem to be off-putting for some, i'll go into more detail about what is there, and what is currently under revision:
That all makes sense. All the late stuff isn't limited at all, so it should be limited to the beginning of the game not late game.
Secret_Squirrel Sep 11, 2009, 09:42 AM Until I properly update the initial post, here's a short outline using the Amurites as an example of how the AI will tech using my system:
The first check is for resources, as it is for everyone. Then they have a choice of 3 techs (this ranges from 2-5 depending on how militarily focused the civ is). For the Amurites this is currently Archery, Knowledge Of The Ether or Education. A random number is then generated to "choose" the technology they then go on to research, this system could probably be refined but it works well at the moment. This results in an element of randomness while still having priorities. So it is possible and quite frequent that the Amurites will now go archery first and then perhaps even education and a few worker techs before they get Knowledge Of The Ether, but they will definitely pick it up before they move on to a higher "tier" technology. Upon moving to a higher tier there is then a similar restriction in place biasing a more "complete" range of useful Tier 2 technologies over moving onto end game techs.
The effect as a whole for all civs is one where it is unlikely that the AI will research an expensive Tier 2 or beyond technology (such as Iron Working) before they have rounded up most if not all of the cheaper useful technologies. It is possible for a "lucky" roll on the random numbers to allow a civ to beeline an expensive tech, but afterwards it would have to be extremely lucky to go for something else just as expensive, and would be more likely to pick up necessary economic or civic related technologies.
[to_xp]Gekko Sep 11, 2009, 09:47 AM why 6 adepts only? 8 makes a lot more sense to me. you could get 4 liches and 4 archmages, or replace your 4 archmages if they get killed.
readercolin Sep 11, 2009, 10:32 AM well... it is 6 adepts UNTIL the AI gets sorcery. Once the AI gets sorcery, then it will get more adepts. Personally, unless I really need it, I don't usually start building adepts except to cast inspiration/wall or stone etc. (units that never go on to become archmages), until I get sorcery. Too many hammers wasted on them that would be better spent building more axmen/archers.
-Colin
Breez Sep 11, 2009, 11:46 AM Gekko;8448582']why 6 adepts only? 8 makes a lot more sense to me. you could get 4 liches and 4 archmages, or replace your 4 archmages if they get killed.
just because it looks like this statement is about the player...
his limitations are AI only. the Player can build what ever.
The AI would not sit on its extra adepts simply waiting for the time to come where they were ready to promote. if they did that the line would not be needed at all.
Also once they get sorcery not only is the limit removed but also there is NO limit on mages at all, which is where you would REALLY want them sitting on a few reserves to replace Archmages.
Turinturambar Sep 11, 2009, 01:59 PM Glad to see my mod is helping! :)
I just uploaded a new version, maybe you find some more interesting tweaks for this mod.
Secret_Squirrel Sep 11, 2009, 05:15 PM In light of the release of a new version of Turinturambar's Economic AI, I foresee a slightly more lengthy wait on the new update of this, but it will be worth it. ;)
2Hydroclopse Sep 12, 2009, 04:11 PM It seems, that after plugging in the python for IFF+AI, every time a great person comes into existence an OOS occurs in MP.
Edit: Hm, I'm getting alot of OOS errors as of 15 minutes ago, but now I'm having them after restoring the file. That might mean your mod is uninvolved.
Secret_Squirrel Sep 12, 2009, 05:24 PM Im playing a multiplayer game using this mod right now, its turn 350 and CTD's are more common than OOS and thats just a FF/FF+ stability issue.
vivictius Sep 12, 2009, 09:31 PM I keep getting a python error, something about 'iMiningKhazad not defined'
Secret_Squirrel Sep 13, 2009, 08:18 AM Thanks for that, I have found the error and it will be fixed in the next release. It just means that the khazad are checking if they have one less technology when they make some decisions. Surprised I didnt pick that one up myself.
Secret_Squirrel Sep 15, 2009, 11:38 AM Ok, heres a sneak peek at most of the new changelog. There may be things added/tweaked before release but im primarily looking for feedback now that there are more details on what the mod does.
Features:
Teching:
- ALL civs have had their early beelines changed so that they are more "flavourful", biased towards ensuring that each civ leverages its strengths, builds its Unique Buildings and fields its Unique Units and Heroes.
- AI will research the required worker techs if enough resources of that type are present in their territory. ("Stolen" and modified from Turinturambar's Economic AI for FFH)
- Oceanfaring techs researched if the AI has many coastal cities.
- AI will ensure they have early economic techs before teching their preferred Tier 2 military techs.
- Writing beeline no longer based on random numbers, AI will now ensure they have writing before they delve too much into advanced military.
- Archery prioritised for those who have emphasised the recon line and do not have Bronze. (Ensures adequate city defense).
- Education researched early if civ starts near a lot of flood plains.
- Civs will now react to Hell Terrain entering their lands or somebody bringing Hyborem into the world, they can do the following:
Non Evil civs will research Divination if hell terrain starts to appear and they do not have life mana.
Evil civs will research Infernal Pact (to adopt AV&StW) if hell terrain starts to take over their lands.
AI's forced to make a decision on which "side" they take by researching Way of the Wise/Wicked dependant on their alignment and their mana types (Life, Nature, Law increase chance of heading for the Overcouncil. Death, Entropy, Chaos - Undercouncil)
- AI will check for opportunities to snatch the free great people at Drama, Military Strategy and Arcane Lore if nobody else has had them.
- War will now make the AI react!:
If an early war occurs, the AI will check if it has Copper in its territory, and if it does, it will beeline Bronze Working to get those str 4 warriors. If not then it will tech Archery.
If the enemy is superior in technology and weapons during an early war, the AI will focus on defensive military techs.
The AI will now ensure it has sufficient siege to conduct a war if it is able to build them.
- Peace will make the AI focus more on economy and (affordable) expansion.
- Better Magic!:
Node building techs (Necromancy, Divination, etc) prioritised by alignment.
Civs with Enchantment mana will pick up KotE once they have Bronze Working.
Sorcery researched sooner if the AI acquires more mana types.
AI now has a strategy when building new mana nodes and is fully capable of death mana/spectre spam.
More adepts/mages built if they are useful (If Arcane or in possession of lots of mana etc).
Everyone will pick up a single enchantment node if they have Alteration.
Most (living) civs will pick up a single body node if they have Alteration.
Elves will try to build a fire node asap.
- AI will go for late game civilization/religious heroes with as much zeal as the early ones.
Religion:
- Religion founding now a lot more diverse and unpredictable while maintaining flavour. (Most civs have 2 or more available religions they can consider founding when appropriate).
- If there are unfounded religions and the civ does not have much incentive to remain under a religion they did not found, they are likely to try and found another fitting religion for themselves.
- Priesthood heavily prioritised for those with the Holy City of their state religion.
- No disciple spamming by civs who do not have flavour affinity for their state religion or the holy city.
- Religious techs will not be researched by those with inappropriate alignment (evil civs wont found order, empy, etc).
- Religious Civics adopted asap if civ has the holy city of their state religion.
Unit production:
- Much greater stack diversity. A lot of work has gone into trying to provide variety while remaining effective.
- Limited workers to 3 per city during peace. 1 per city during war. (They will not disband any units, they just wont build more unless they lose a whole lot).
- Very controlled Settler production to ensure limited over/under expansion.
- Scouts limited to 4 (except Svartalfar).
- AI Will no longer build certain low strength units if their rivals have better units. Example: Horsemen limited to 5 for everyone except the Hippus if any neighbouring civ has Iron Working and Iron weapons.
- Will no longer produce their first settler without appropriate military defense.
- Javelin Throwers limited to 2 per city if the civ has Bronze Working.
- Priests limited to 3 per city until Theology. (To stop most notably, the tiger spam!)
- AI will not build Privateers if rivals have superior naval technologies.
- Archers limited to 5 per city for everyone except Ljosalfar and Amurites.
- Once Archery has been researched, total number of warriors allowed limited to 5 per city. (Ensures civs able to build archery ranges will not continue to use warriors as city defenders).
- World Units cannot be built in cities with poor production
Building production:
- AI will build more markets in general.
- Infernal AI will no longer build health buildings.
- Many changes to influence how the AI handles building construction.
- Most civs are now quite fond of their unique buildings (Shrouded Woods, Warrens, etc).
- Unit training buildings built more often, and with more variety and intelligence. Taking into account traits, available mana, technologies, etc.
Improvements:
- Cottages will not be built under Aristocracy if there are other options.
- Workshops will not be built unless Guilds has been researched.
- Elves blocked from building Lumbermills.
lemonjelly Sep 15, 2009, 11:45 AM yeah, they look really good. I can't wait until you have finished, so I can add into Fallen Ages.
x
Opera Sep 15, 2009, 11:47 AM Nice nice nice nice.
Some things would be better off in the DLL though... but I'm contemplating stealing your changes. Any ETA? Me eager to steal!
Secret_Squirrel Sep 15, 2009, 11:57 AM Im still testing and trying to iron out a few oddities (the Sheaim completely stopped teching in my last playtest, so until that is definitely fixed, no release :().
There are also a couple more things I think could be useful from Turinturambar's Economic AI so I'll make a conservative guess and say Friday, but it may be sooner!
lemonjelly Sep 15, 2009, 12:08 PM Secret Squirrel --> don't worry too much about rushing to release it. FA is nowhere near a releasable version. But, Friday is good. What a great day. I have loads of free time of friday :D
Bad thing about the Sheaim though :(
Opera Sep 15, 2009, 02:05 PM I had such a bug. Be careful with your AI_chooseTech() statements, it's easy to make a typo disallowing the AI to research ANY tech.
Turinturambar Sep 15, 2009, 02:45 PM Im still testing and trying to iron out a few oddities (the Sheaim completely stopped teching in my last playtest, so until that is definitely fixed, no release :().
Did the Sheaim change alignment? Sounds like the Sheaim switched to neutral or good and are forced to research a tech like way of the wicked, which is blocked for civs with good alignment.
Opera Sep 15, 2009, 03:19 PM Yeah, what Turin said looks like what I had too :)
Secret_Squirrel Sep 15, 2009, 03:52 PM Could be something along those lines as they were in fact Neutral, thanks, i'll look into it.
[to_xp]Gekko Sep 15, 2009, 04:50 PM nice stuff! FF badly needs a better AI :D
Valkrionn Sep 15, 2009, 04:56 PM Another thing to check would be your religion code.... You said it's set to check for an unfounded religion, and then try to go for it, right?
If the Mechanos aren't in game, that could possibly be an issue, seeing as you can't research the tech for their religion unless you're Mechanos or already following it.
Sephi Sep 16, 2009, 01:01 AM Im still testing and trying to iron out a few oddities (the Sheaim completely stopped teching in my last playtest, so until that is definitely fixed, no release :().
make sure to use canresearch in AI_choosetech
Secret_Squirrel Sep 16, 2009, 09:51 AM Ok, I think I have that issue fixed, found a typo and some conflicting instructions on when it is good to build a Sewer. Thanks for all the help.
I have tweaked the religion code a little so that when choosing a religion to found, they will always go for one that is unfounded UNLESS it is their obvious choice to get that religion anyway. As it was before, Ljosalfar could sit there all game without ever researching Way of the Forests because somebody else snagged the holy city.
Another addition is commerce and science improving buildings (Library, Money Changer, etc) will be built more often when the civ is not at war, and the AI now only prioritises them in cities with a high science/commerce rate.
I only have one major feature left to implement before I go into final testing and then onto release, and that is civics. At the moment the AI has limited ability to assess when a civic is good for it, I want to change that. They understand God King and City States and even Aristo-grarianism but they have no clue about a lot of the later game civics other than "oh that one looks nice!" or whatever crazy "logic" is calculated by them behind the scenes.
If there are any particularly powerful late game civic combinations that people use, even if they are civ/trait/economy/tech specific, throw them up here and I'll see about teaching the AI how to take advantage of them.
Edit: While on that note, are there any additional features at all that anyone would like to see implemented?
readercolin Sep 16, 2009, 11:00 AM 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
Secret_Squirrel Sep 17, 2009, 09:54 AM 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).
Secret_Squirrel Sep 18, 2009, 09:00 PM 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.
Frogeater Sep 22, 2009, 11:03 AM 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)
Breez Sep 22, 2009, 12:41 PM 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.
2Hydroclopse Sep 22, 2009, 01:22 PM 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-.
Secret_Squirrel Sep 22, 2009, 01:30 PM 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.
Morphem01 Sep 23, 2009, 11:49 PM 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:
Secret_Squirrel Sep 24, 2009, 06:41 PM 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?
Morphem01 Sep 24, 2009, 10:22 PM When you say 120% do you mean over twice the duration or a 20% increase?
over twice the duration
Tholal Oct 01, 2009, 05:57 PM The file size is over twice the original, so some slowdown especially on low end machines is going to happen.
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.
Wodan Oct 01, 2009, 07:00 PM 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
Secret_Squirrel Oct 02, 2009, 07:37 AM 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:
Turinturambar Oct 02, 2009, 07:53 AM 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.
Valkrionn Oct 02, 2009, 07:59 AM 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:
Tholal Oct 05, 2009, 06:55 PM 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.
Valkrionn Oct 13, 2009, 09:39 AM 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.
if eBuilding == gc.getInfoTypeForString('BUILDING_TOWER_OF_COMPLAC ENCY'):
if pCity.getHealth() <= 14:
return True
if eBuilding == gc.getInfoTypeForString('BUILDING_TOWER_OF_COMPLAC ENCY'):
if pCity.goodHealth() <= 14:
return True
vivictius Oct 13, 2009, 07:30 PM Ah, that explains the bug I was getting the other day, it was saying something about getHealth no found or some such.
|
|