This is a suggestion to make the AI use/build things well... smarter... or at least, not stupidly. It'll probably contain some jargon that you'd only be familiar with if you dug into the xml files, so I'll apologize before hand if it doesn't make a lot of sense for those who don't.
It all started with this thread: https://forums.elementalgame.com/425251
For those who don't want to read the thread: Basically, the AI is doing things that it shouldn't. In the thread's case, it was casting curse on those with no def (which was pointless). That was when I explained that the AI doesn't actually know what the skill "curse" actually does, and that it would help if there were conditions to alter the skill's priority so that it doesn't use it when it isn't necessary.
It didn't take too long before I started seeing this behavior pop up all over the place in my own games (actually I've noticed for a while, but it's glaringly obvious now). For example, I watched Tarth builds an Inn in a nearby city... that would normally be a great thing (since it insists on pumping out useless units 98% of the time - but that's another matter)... except the city it builds the Inn in... is full of people. What it SHOULD have built, was a granary. But nope, it wants an Inn (and that's the ONLY building it built in that city for 250+ turns - at least build the barracks if you're pumping troops... jeez).
So what I'm suggesting is: instead of assigning these straight forward "10"s and "15"s value as priority for these buildings (and skills), that the AI doesn't really understand, what we should do is turn priority into a variable that can be defined by humans that knows what those things are suppose to do. In the case of the Inn, the variable would be a calculation based on the number of available food remaining in the city... say: available food/5 + 1 (to say that it's a bit better than pubs - due to construction time). So if you have a lot of food.. the priority is very high (makes sense, that's when the Inn would be most useful), and if the food supply is already low, then priority is also very low (so it won't build it when it really doesn't need to). The opposite for the Granary, whose priority could be based on a value minus the available food supply (to get higher priority when food is low) multiplied by the potential growth of the city (before the zeroing out). So if there is a lot of growth, and no available food, priority for granary is very high.
The same thing can be applied to skills. For "curse", you'd get the target's def and use that as its priority. So if they have high def, curse gets high priority. You can also do the same thing for other skills, like fire spells that has priority based on its target fire resists. High resist, low priority, a fire weakness? Super high priority. Makes sense, right?
I'm pretty sure that if you do this, you can get the AI to build and use skills in a much better manner.
I agree a flat priority is pointless.
For the AI to ever be competitive without cheating it needs to understand the attributes of the spell/building/unit and choose according to those attributes rather than a pre-defined and static priority.
I'm not sure how exactly the AI is implemented or coded, but would it be difficult to add flags to buildings, spells, and troops for the AI to cross reference?
For example: You go into combat, the enemy AI assesses what your biggest threat is, and determines that it is a unit of defenders, since the Defenders have a Defense of greater than its best attack unit, it flags the defenders with [ARMOR], it assesses what it's best course of action is. It looks through its spells and finds a spell with the [ARMOR] flag, and casts it. It was Curse. Similarly, if there are no such units, but there is one with a lot of HPS and low defense, it might choose to use a [DAMAGE] spell instead.
Keep in mind, I have no personal game coding experience, but I know that in cross table searches you can add keys which allow you to join data pretty quickly and easily. You should be able to build a [FLAG A] > [FLAG B] WHEN [FLAG C] meta-logic that can be applied after the AI assesses what its best movement is.
I'm sure they could do something like that. I'm sure they could embed AI instructions into all their objects, spells, building ect that have certain restrictions of use for the AI, like the AI isn't allowed to build an inn in a city that has already maxed population ect, these wouldn't even really have to be AI only restrictions come to think of it- they could show up as an advisor for noob players.
saying, yes, technically you can do this, but you really don't want to bc of blah...
of course telling players your AI is better than them is ballsy, so maybe it could also have a do it anyways override button:
which would give an option text input for the player to explain why the option really does make sense in their situation.
(oh course w/o knowledge of the state of their current code base I have no idea how much work something like that would be for them to do.)
There are many great features available to you once you register, including:
Sign in or Create Account