Resource icon

AI+ v13.1

Siesta, don't make AI+ something "significantly harder to build" - do yourself and us a favour :)

I think, it would be OK to have the AI cheat with a method, if the method is technically simple, effective on the result the AI can get/make and is not breaking my player experience.

AI as now is bad enough to let some cheats and enjoy better AI results... we need AI that bring better experience in gamplay, I can forgive the cheats as long as I enjoy them ;)

Agree -- do everyone a favor and don't make it so difficult to build that it becomes a dead-end mod at the first Firaxis patch.

I agree with V. Soma -- some cheats that drive better AI results is great. And in all honesty, anything that causes me to cut back the difficulty level if welcome even if it is "cheating". In my mind, the AI having full visibility of all of my units on tiles that they had previously explored is not game breaking. I'm sure for others it might be -- but I am up to that challenge.

But first and foremost -- I would keep to simple to build, simple to update, and simple to keep up to date.
 
I did an AI autoplay test

Firaxis TSL Europe, 11 AI civs, Smoother immortal, standard speed
played 170 turns

CombatStackingOverhaul mod
AI+ 12.0

some notes:

- religious civs build well, religious district. OK. But no other district - may this be because of small city size? (next time I check this)
- Rome built econ district, but only Rome...
- Greece Pericles had culture district, nobody else
- I see AI building cities very far away, makes no sense
- defending AI sometimes does not attack enemy catapult next to own city though it could...
- defending AI goes to capture a free city and thus leaves own city undefended, though it is attacked by enemy

question:
- can you make AI decide on to make a city specialized to sci/culture/military/economy/industry...?
I think I see that for example Russia build religious district in all cities... not effective...
 
- can you make AI decide on to make a city specialized to sci/culture/military/economy/industry...?
I think I see that for example Russia build religious district in all cities... not effective...

Thanks for your test
I should be able to actually control what civs build in the new version. The old xml system just wasn't good enough to handle this kind of stuff in detail. It's going to take a while though and as it's a complete rewrite of that system should not share the same issues this version does (though obviously new problems may appear)
Same deal with settling locations and behavior
Not 100% sure yet how well microing units can be done (I can't seem to find a way to order them to attack units reliably so far), but large scale troop movements should be possible
 
It's actually related to AI+, because in vanilla they don't really, while in AI+ they do, I have something in place that boosts faith desire for those with a religion. Might have to buff it though if it's not noticeable enough to even offer you a RV challenge on deity.
Just to give me some idea how high I should put it, are you finding that in AI+ the following leaders do adequately try to engage with the RV?: Gandhi, Hardrada, Tomyris, Philip, Jayavarman, Jadwiga, Montezuma, Chandragupta, Tamar, Gitarja, Hojo.
I've got these marked as religious civs

Sorry haven't had much time to play further lately. Re: RV competitiveness, in my current game I have Jaya, Chandra, and Jadwiga. The latter 2 managed to find a religion but didnt pursue RV much - I easily converted them both. Pound maker on the other continent however has taken off and is generating over 200 faith / T I which is higher than I had usually seen prior to AI+. But he is also leading in overall score and everything else.

One additional quirk I noticed is that Pound maker invested **13** envoys in Jerusalem (+ 2 from Amani so 15 total) even though the next runner up only has 3 envoys. I guess it makes sense to focus if he is going for RV, but more logical thing would be to save up the extra envoys beyond suzerain status and add more if you lose that status, which is what a human player would do. Perhaps this is coz the AI cannot save envoys by design and forced to assign? If so it makes sense - I would do the same if I couldn't save envoys and going for RV and that's the only Religious CS. (Which I it is)
 
Sorry haven't had much time to play further lately. Re: RV competitiveness, in my current game I have Jaya, Chandra, and Jadwiga. The latter 2 managed to find a religion but didnt pursue RV much - I easily converted them both. Pound maker on the other continent however has taken off and is generating over 200 faith / T I which is higher than I had usually seen prior to AI+. But he is also leading in overall score and everything else.

One additional quirk I noticed is that Pound maker invested **13** envoys in Jerusalem (+ 2 from Amani so 15 total) even though the next runner up only has 3 envoys. I guess it makes sense to focus if he is going for RV, but more logical thing would be to save up the extra envoys beyond suzerain status and add more if you lose that status, which is what a human player would do. Perhaps this is coz the AI cannot save envoys by design and forced to assign? If so it makes sense - I would do the same if I couldn't save envoys and going for RV and that's the only Religious CS. (Which I it is)

Thanks for the tip, I wasn't aware they did that. I'll have a look and see if I can control envoy sending behavior at some point. Probably a bit of a lower priority issue, but it does impact the game quite a bit, so it couldn't hurt to writing something better. Doubt I'll be able to allow them to save up points too though, one of my main struggles so far with lua is that I can't stop the inbuild AI, and so it tries overriding a lot of my choices. And if you ignore envoy saving, it usually feels like they pick city states pretty reasonably.
 
Siesta, pls tell us every now and then how you progress with plans and making the new AI+... :)

You know, some short "developer's notes/diary"... on a weekly dose...
 
AI can actually save envoys, that's why you very often lose suzerainity one turn after getting it if you're in an envoy war.
 
Thanks for the tip, I wasn't aware they did that. I'll have a look and see if I can control envoy sending behavior at some point. Probably a bit of a lower priority issue, but it does impact the game quite a bit, so it couldn't hurt to writing something better. Doubt I'll be able to allow them to save up points too though, one of my main struggles so far with lua is that I can't stop the inbuild AI, and so it tries overriding a lot of my choices. And if you ignore envoy saving, it usually feels like they pick city states pretty reasonably.

Actually scratch that, I realized it was due to him having a promoted Amani that doubles his envoys.. he moved Amani and is down to 5 envoys now. So no issue with AI & envoys.
 
Siesta, pls tell us every now and then how you progress with plans and making the new AI+... :)

You know, some short "developer's notes/diary"... on a weekly dose...

Sure, why not. Well, maybe not weekly, but I can give you one now.


Basically right now I'm still in the exploratory and infrastructure phase of the new version.
The newly discovered lua possibilities have a lot of potential power, but it's as of now still uncertain how much control they give exactly. There are basically two main things I can now explore. I can make cities build things based on lua code, and I can use unit 'operations'.
These operations are used in vanilla civ to send groups of units to enemy cities, and to settle spots, as well as some other things. Luckily, these are very customizable thanks to the 'behaviortrees' system, and because I can now both start operations at will, along with target coordinates, and with the exact units it should contain, I can actually hijack this system and do things with it that were probably never really intended.

What I'm attempting to do, is to use these operations to control individual units instead of groups. Because they support target coordinates, a move command, an attack command, a settle command, as well as some others, I can now order individual units around the map. This allows me to fully take over all macro movement of units, as well as some part of the micro.

Unfortunately, the way operations are executed leaves some room for the inbuild AI to make decisions. These operations could be seen as 'guidelines' that I can now give the AI. But since it doesn't listen perfectly, it causes some issues. For example, if I tell the AI to move a unit one tile using these operations, the AI can decide after that to move its unit back to the tile it came from. Similarly, I can give an 'attack' guideline, but it might still decide to attack another unit, or might be too scared to attack.
It's also impossible (not sure yet?) for me to order moves in any way, which makes micro unpredictable. A common ingame scenario might be to have these units: -RM-E where R is a ranged unit of mine, M is a melee unit of mine, E is an enemy, and '-' are empty spots. It tends to be wise to first move the melee unit to the empty tile, then move the ranged unit and shoot, and then attack with the melee unit.
But unfortunately, since I can't order things as I want them to, it might up trying to walk with the ranged unit first, and since the intended tile is blocked, the inbuild AI may then decide to actually move it somewhere else.
So instead of the intended result with a unit kill: --RM-
It may end up resulting in this instead: R--ME in which case I not only missed out on a kill, but leave my melee unit in a place it might die and my ranged unit useless.

Because of stuff like this, most of my efforts so far are in two areas:
- Find out how to maximize the amount of direct power I can assume without having the inbuild AI overrule me and without it doing weird stuff like double moves / stacking units that shouldn't be stackable.
- Build an infrastructure to allow me to make decisions. For example: writing a system to analyse where units can move based on terrain, or writing a system that allows me to easily access information and make high level decisions.

There's a lot of stuff that goes into civ, and since there are no tutorials or documentation for most of this, it's rather time intensive work, but it should pay off in the end. Exploration & infrastructure are generally the most important aspects of making a bot that works well and which can be easily maintained.

The next phase, which will start when I'm satisfied I've exhausted the possibilities, will be to start making some actually reasonable decisions. Right now all my heuristics are very simple and just to confirm that what I'm trying to get the units/cities to do is actually having the anticipated effect. It's currently still very far from even the vanilla civ in terms of capabilities because of it (except for the settling spot evaluation, which already seems better than the default).
I'm hoping that this phase will be relatively smooth sailing once I've got a proper architecture down and I should be able to quickly surpass the vanilla AI in several areas once I'm far enough to start tweaking this.

In later phases, I'll try exploring some additional areas. Like there seems there might be room to allow me to decide what improvements to prioritize, and something that might allow policy decision making, but I haven't really looked at these yet.

After that, I'm hoping to reintroduce unique behaviors for civs, unique strategies, etc.


While building this, I'm trying to keep mod compatibility in mind. For example, the way I handle units should be as generic as possible, to make sure the mod doesn't break upon introduction of some new UU. I do take a few shortcuts here and there where I don't really expect mods, or when it'd be too time draining to take everything into account (like all ways of making modded wonders).

Because the scale of possibilities here is much larger than in xml, I might consider trying to turn this project into a bit more of a community project if others are willing to help. I'll first set up a solid basis though so that people will have something to work with
 
Thanks for the "diary", Siesta - well, wow, that sounds exciting but also a bit of hard and long work, too... I'll wait patiently and give support...
 
Thanks :) Yes, some patience will be needed. It's a large game and tools are limited
I'm already up to 3k lines of code without feeling like I've touched much of the game at all.
 
A community project sounds like a great idea. I am not a coder myself but took some CS classes back in college lol. Maybe I can get back into it - all for the love of civ :) I glanced at the Civ 5 community patch forum the other day (Vox Populi) and looked like they are still fully on it making regular updates. Perhaps some of those folks would be interested in helping out?
 
I got to play more of my Deity RV game beyond T230. Here are a couple more behaviors I continue to notice (both in vanilla and AI+). These are well known AI flaws that have existed since the very beginning, but curious to hear your thoughts:

- AI suicide attacks its apostles. With no chance of winning. Still. Doesn't withdraw to heal or bring gurus.

- AI still sends out apostles to convert far away obscure cities (especially CS - they don't even count for RV) with no strategy whatsoever. Instead of methodically expanding their religious sphere of influence.

- Pound maker is making over 350 faith per turn, higher than me. But once I made a bunch of apostles and starting converting his cities, he hardly spawned any apostles or inquisitiors. I have virtually converted all of his cities at this point so game is practically won. I have no idea what he is using his faith for (buying military units, great people?) but there seems to be no urgency to create defensive religious units when he is losing his religion. I have always noticed this behavior with AI but this case is even more dramatic coz he could really afford it easily if he wanted to. He is going for science victory I think. Nevertheless, There should be a trigger to buy apostles / inquisitiors when AI 's religion is being invaded, similar to when their cities are being attacked by military. I wonder if this is something you have looked into and can control?
 
@oedali

Yeah, I've noticed the same behavior of them running around converting CSes. I'm not really sure why they do it either, perhaps they're trying to avoid the diplo hit with their cs converts?
As for defending their own religion, well, it probably just stems from the same problem they have when defending with their troops. It's just entirely missing some important code, like an increase of desire to build units / purchase religious units when under threat. At least for the military case, it's obvious there just isn't some logic hiding in the internal code that attempts to handle defending. There's a bit of xml dedicated to military defense, but I don't see any xml dedicated to religious defense. Which probably means there just isn't any logic like that.

When it comes to fixing it on my end, I'm not sure yet. It's definitely not possible with XML to improve their behavior in these areas. On lua side it may be possible, though I've yet to test out whether some fundamental requirements are possible. I can almost certainly move the religious units around at will, but do not know yet if I can make them attack other religious units, attempt to convert cities and choose promotions, nor have I been able to confirm whether I can make it purchase units.

Priority wise, I think I'll put this before things like policies and unique civ behavior, but after build choices, settling and military micro.
 
It's also impossible (not sure yet?) for me to order moves in any way, which makes micro unpredictable. A common ingame scenario might be to have these units: -RM-E where R is a ranged unit of mine, M is a melee unit of mine, E is an enemy, and '-' are empty spots. It tends to be wise to first move the melee unit to the empty tile, then move the ranged unit and shoot, and then attack with the melee unit.
But unfortunately, since I can't order things as I want them to, it might up trying to walk with the ranged unit first, and since the intended tile is blocked, the inbuild AI may then decide to actually move it somewhere else.
So instead of the intended result with a unit kill: --RM-
It may end up resulting in this instead: R--ME in which case I not only missed out on a kill, but leave my melee unit in a place it might die and my ranged unit useless.

I've noticed before how the AI often moves all it's melee units in range before attacking to maximise support bonuses. Maybe you can use something similar to get this to work?
 
I've noticed before how the AI often moves all it's melee units in range before attacking to maximise support bonuses. Maybe you can use something similar to get this to work?

It isn't so much a lack of a way of solving conceptually or computationally how to order moves, it's more that there may not be a button for me to push that allows doing the actual ordering. I have to execute all my movement stuff before the inbuild AI does its thing, and can't give it time ordered commands. If the AI does indeed do such a thing (I have my doubts), the logic behind it is not something I can access
There's a move lua command which theoretically could do it, but so far I've been unable to get that to work in combination with attacks without having the AI do double moves with units.
 
New patch released.. Hopefully positive impact from these. Not sure what the first one really does. Any chance AI+ would override this change though?
  • Improved AI progress through tech and civic tree.
  • Garrisoned ranged units are much less likely to leave City Centers and Encampments.
  • Increased defenses of early era city states to discourage easy conquest by AI and players.
 
@oedali
Hmm that should theoretically all be fine. I guess the last change kind might kind of make my change to make cs build more units in ancients irrelevant, but I don't see how it would hurt having the both of them.

Don't really have the time to test right now. Could anyone let me know if it breaks the game?
 
Any chance this mod can make AIs use air units? The AI does not appear capable of using air units in the base game. I have seen the AI build jet bombers but they never attack my units, although the AI did use one to deliver a nuke once.
 
Top Bottom