What modded abilities can the AI use correctly?

Brainstorm ideas of possible additions to the game. Read this before posting!

Moderator: Forum Moderators

Forum rules
Before posting a new idea, you must read the following:
Post Reply
Bobit
Posts: 28
Joined: February 10th, 2015, 2:42 pm

What modded abilities can the AI use correctly?

Post by Bobit »

(Disclaimer: I am nobody and probably won't make anything)

I'm pretty sure the AI will automatically know how to correctly use abilities which alter damage/healing during combat, e.g. a 1% chance to do 9999 damage. I'm not so sure whether they would be able to correctly use auras similar to leadership and healing.

But how can the AI be made to correctly use whirlwind-esque abilities, and hit-and-run abilities? The algorithms for doing so should be straightforward (for example the value of Whirlwind would be equivalent to the value of its damage), but coding it is difficult.

Such abilities are core to several mods so I think solving this problem could be worthwhile.
tejehi3126
Posts: 1
Joined: October 6th, 2021, 5:47 pm

Re: What modded abilities can the AI use correctly?

Post by tejehi3126 »

Bobit wrote: March 11th, 2021, 6:42 pm (Disclaimer: I am nobody and probably won't make anything)

I'm pretty sure the AI will automatically know how to correctly use abilities which alter damage/healing during combat, e.g. a 1% chance to do 9999 damage. I'm not so sure whether they would be able to correctly use auras similar to leadership and healing.

But how can the AI be made to correctly use whirlwind-esque abilities, and hit-and-run abilities? The algorithms for doing so should be straightforward (for example the value of Whirlwind would be equivalent to the value of its damage), but coding it is difficult.

Such abilities are core to several mods so I think solving this problem could be worthwhile.
If AI CAN DO IT, it will be definitely worth the wait!

Regards,
Russel P. Halpern
Hi team, thanks for creating such an active forum.
shevegen
Posts: 402
Joined: June 3rd, 2004, 4:35 pm

Re: What modded abilities can the AI use correctly?

Post by shevegen »

This is an interesting question. I wondered about this too.

I noticed that to some extent you can "abuse" the AI, e. g. when the AI has a "drive" to
want to kill weak units and you can bait enemy units that way. Berserk is one of the
strangest abilities in this regard - like when you miscalculate the range and suddenly
an enemy berserk unit goes in for the nuke. Experience can help against that, but I
often tend to forget things when playing or after a long break ... (can work the other
way around as well, if you have berserk units and you need to carve out some
areas and guarantee a kill. I still prefer units such as elven ranger or those with
markmanship; am not the biggest fan of berserk... lesser berserk may be better
than a "fight to the death", but I digress)

> I'm not so sure whether they would be able to correctly use auras similar to leadership and healing.

I guess it depends on how it is written. Different AI "styles" or flavours would be interesting,
like a priest/healing AI for units that have that. I know too little to really understand all
factors you need to take into account - evidently having a priest surrounded by 3 friendly
units far away from all the other friendly units wouldn't work that much. Whereas a long
range and healing support in backrow evidently works better. (Often makes me wonder
about long range weapons! Like siege weapons as part of the main game ... but I suppose
it may make it too difficult for newcomers, so perhaps only for add-ons and stuff.)

> The algorithms for doing so should be straightforward

Guess we need someone who knows the code to explain the AI parts. For the most part I
think the AI in wesnoth is fairly ok. Sometimes it is a bit frustrating, in particular allied
leaders that suddenly rush forward, to kill an enemy unit, and then get killed the next
round because they thought being a hero solo on the battle field is cool ... and then you
lose a scenario because the allied leader was not very smart. So you have to work
around that with your own units ... but it would be better if they don't do suicide-runs. :P
(I guess this part is easy to change, e. g. just calculate how many other, strong enemy
units are NEARBY that unit you want to rush-nuke, and if there are too many, like the
risk of death is too high, to NOT do so. That could fix it. Evidently there are more ways
to fix this than that, I just wanted to give an example.)
User avatar
beetlenaut
Developer
Posts: 2575
Joined: December 8th, 2007, 3:21 am
Location: Washington State
Contact:

Re: What modded abilities can the AI use correctly?

Post by beetlenaut »

shevegen wrote: October 10th, 2021, 1:55 pm ...and then you lose a scenario because the allied leader was not very smart.
That's my least favorite thing, and sometimes there is nothing you can do to prevent it. They will happily jump over a line of your screening units onto terrible terrain. For that reason, I wrote a leader movement-control macro recently, and I hope it gets used in more all scenarios with an allied AI that can't be allowed to die. (Search for Improved AI Ally Control in Scenario Campaign Development.)
Campaigns: Dead Water,
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
Post Reply