Improved AI Ally Control

Discussion and development of scenarios and campaigns for the game.

Moderator: Forum Moderators

vghetto
Posts: 755
Joined: November 2nd, 2019, 5:12 pm

Re: Improved AI Ally Control

Post by vghetto »

Adamant14 wrote: June 30th, 2021, 5:35 pm The big advantage of Beetlenaut's AI controller is that it is not complicated. If I understood it correctly, the old AI controller was removed from the mainline campaigns because it was too complicated and not intuitive enough. If you make Beetlenaut's AI controller just as complicated, what have we gained? Couldn't we have kept the old Ai controller right away? The AI controller actually has everything it takes, the only concession I would add is to assign a goal to the AI.
I have to disagree with you. I think you are overstating what Beetlenaut's AI controller actually does.
The way I understood it is like so: The leader of side X can either "Move to here (after recruiting) OR stand still OR do whatever default AI behavior the leader is supposed to do." For the last one, that is usually standing still on the keep anyways.
Note this only affects the leader of the side and not the entire side.

The way that the deprecated AI was supposed to work is for the entire side is to "Attack side X/ Protect side X/ Value own units over enemy in deciding to attack or vice versa" There might have been other things too, I don't remember.

That didn't always work out as expected not because the macros are complicated, but because of the internal evaluation of the AI move targets is complex after it factors in distance and aggression and caution and other factors.
So when you say to the side attack side X which is far away, but the AI sees the side Y is much closer, you'll see it still going after the wrong side because internally that is the better evaluation of the AI. And that is why it appeared to be broken.

Now the way to fix that is with micro_ais. And this is where I'm hoping for Beetlenaut to expand it further, if he wants to.
The AI controller actually has everything it takes, the only concession I would add is to assign a goal to the AI.
Are you referring to this one? Sorry I just don't see how that is so.
User avatar
beetlenaut
Developer
Posts: 2825
Joined: December 8th, 2007, 3:21 am
Location: Washington State
Contact:

Re: Improved AI Ally Control

Post by beetlenaut »

vghetto wrote: June 30th, 2021, 6:26 pm For the [default], that is usually standing still on the keep anyways.
Only when the enemy is multiple turns away. I wrote this after a leader jumped from his keep, passed through my line into the snow, and attacked a wounded enemy. He got mobbed and died easily before I had another turn, so I lost. There was nothing I could have done differently to prevent it except to put my units in every snow hex instead of the villages and forests they were in. I would have lost that way too. I wrote this and added it to the UMC I was playing. (Which I'm not going to name.)
vghetto wrote: June 30th, 2021, 6:26 pm it appeared to be broken.
That's why I didn't add any of that older functionality to what I wrote. I didn't think it was that complicated, it just didn't really work.
vghetto wrote: June 30th, 2021, 6:26 pm Now the way to fix that is with micro_ais.
True. There are some micro_ais that would make sense to use this way, but I don't plan on adding them myself. There are two reasons why not: For one, deciding and describing what each option does exactly would be difficult. Second, some UMC authors might object to you having such fine-grained control over the AI side. Because of this, I think any micro AI behavior modifier should be in a separate macro anyway. However, if you disagree, don't let me stop you from giving it a try!
Campaigns: Dead Water,
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
User avatar
egallager
Posts: 583
Joined: November 19th, 2020, 7:27 pm
Location: Concord, New Hampshire
Contact:

Re: Improved AI Ally Control

Post by egallager »

Lord-Knightmare wrote: June 30th, 2021, 5:53 pm
If I understood it correctly, the old AI controller was removed from the mainline campaigns because it was too complicated and not intuitive enough. If you make Beetlenaut's AI controller just as complicated, what have we gained? Couldn't we have kept the old Ai controller right away? The AI controller actually has everything it takes, the only concession I would add is to assign a goal to the AI.
Complicated Code is not the issue. It's the results from the code. If the improved one is doing way better than the predecessor, then yes. Everyone will enjoy it. Right now, the starting impression is very positive so addition of working functionality for modifiable aggression, caution, targeting and protecting will be even more appreicated.
I think Adamant meant "complicated" not in the sense of the code, but rather in terms of players being able to understand how it works in game. The code is understandable enough if you're a programmer who can understand code in general, but many players aren't programmers, nor should they have to be. I do think, though, that there could have been other solutions to the old AI controller being too complicated besides just removing it, though; for example, the documentation could have been improved, or there could have been a tutorial scenario created for it that explains all of its quirks. Removal isn't TOO bad, though; thanks to this being open-source, nothing ever TRULY gets deleted; the old AI controller file will still be in the repository history for UMC authors to copy into their own campaigns if they want, which is what I'll be doing.
Last edited by egallager on July 1st, 2021, 5:01 pm, edited 1 time in total.
User avatar
Adamant14
Posts: 968
Joined: April 24th, 2010, 1:14 pm

Re: Improved AI Ally Control

Post by Adamant14 »

egallager wrote: July 1st, 2021, 4:49 pm I think Adamant meant "complicated" not in the sense of the code, but rather in terms of players being able to understand how it works in game.
Exactly
Author of Antar, Son of Rheor ( SP Campaign) | Development Thread + Feedback Thread + Replays of ASoR
User avatar
Lord-Knightmare
Discord Moderator
Posts: 2360
Joined: May 24th, 2010, 5:26 pm
Location: Somewhere in the depths of Irdya, gathering my army to eventually destroy the known world.
Contact:

Re: Improved AI Ally Control

Post by Lord-Knightmare »

egallager wrote: July 1st, 2021, 4:49 pm
Lord-Knightmare wrote: June 30th, 2021, 5:53 pm
If I understood it correctly, the old AI controller was removed from the mainline campaigns because it was too complicated and not intuitive enough. If you make Beetlenaut's AI controller just as complicated, what have we gained? Couldn't we have kept the old Ai controller right away? The AI controller actually has everything it takes, the only concession I would add is to assign a goal to the AI.
Complicated Code is not the issue. It's the results from the code. If the improved one is doing way better than the predecessor, then yes. Everyone will enjoy it. Right now, the starting impression is very positive so addition of working functionality for modifiable aggression, caution, targeting and protecting will be even more appreicated.
I think Adamant meant "complicated" not in the sense of the code, but rather in terms of players being able to understand how it works in game.
Laconic instructions can be provided in the scenario messages. I have done this for the scenario I am using it in. Gave clear instructions on what it can and cannot do.
Creator of "War of Legends"
Creator of the Isle of Mists survival scenario.
Maintainer of Forward They Cried
User:Knyghtmare | My Medium
User avatar
Toranks
Translator
Posts: 168
Joined: October 21st, 2022, 8:59 pm
Location: Sevilla
Contact:

Re: Improved AI Ally Control

Post by Toranks »

But... :hmm:
Why not both?? :lol: Both together works very well. You can test it on Advanced Wesnoth Wars (fork), I've just updated it. I was amazed at the existence of these macros while playing A New Order, and decided to adapt it to work with any campaign and scenario. And for now, it works pretty well. I don't know how it will works in multiplayer, but it should work since it supports multiple human controllers.
Being able to control the "tendency" of aggressiveness and caution of the AI, as well as precisely guide the leader anywhere and keep them there, I'd say basically completely changes the way you play with allied AIs, who are usually pretty suicidal. For me, it's giving a new flavor to the game, which I like more every day.
imagen.png
image2.png
Post Reply