Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate the AI controller for removal #3668

Closed
mattsc opened this issue Oct 28, 2018 · 13 comments
Closed

Deprecate the AI controller for removal #3668

mattsc opened this issue Oct 28, 2018 · 13 comments
Labels
AI Issues with the AI engine, including micro AIs. Enhancement Issues that are requests for new features or changes to existing ones.

Comments

@mattsc
Copy link
Member

mattsc commented Oct 28, 2018

The AI controller is used in roughly 2 dozen mainline scenarios. It certainly has its uses, but it has a whole bunch of issues too.

Arguably its biggest problem is that, unless you're quite familiar with both the AI and what the AI controller does internally, it is not at all obvious what it does. Settings like "Be more defensive" or "Focus on protecting..." do not necessarily do what one would intuitively expect. As a result, it is not always obvious what the controller is doing, often leading players to conclude that it simply isn't working.

It is also possible to choose options that actively contradict each other. See, for example, #3066.

And, in general, because it has to work within the limitations of the default AI, a lot of the effects are rather subtle in the first place, and it is questionable whether they really make a noticeable difference.

So what should we do about this? Possibilities include:

  1. Leave it as is (easiest solution, of course)
  2. Remove it altogether (almost as simple)
  3. Add more instructions/explanations, so that it is more obvious what the AI controller does
  4. Add conditions so that contradictory instructions cannot be chosen
  5. Add additional behavior (for example, in one of my campaigns I have "make allied leader go here" and "release allied leader from going here" context menu options to keep said leader from committing suicide)
  6. Customize the options per scenario
  7. ...

... or combinations thereof.

Speaking from a practical perspective, I'd just remove the thing altogether, because I don't think it is all that useful in its current stage and improving it is more effort than it's worth. Idealistically speaking, I would of course like to turn it into something more useful, along the lines of options 5 or 6. Or we could just leave it as is ...

So I guess I am asking for two things: for people's opinions on the topic and for volunteers to help with ideas, customizations by scenario, writing of more intuitive instructions etc. I'd be happy to help with whatever AI work might be needed, but in practice there's no way I am going to go through 20+ scenarios to customize this.

@mattsc mattsc added Enhancement Issues that are requests for new features or changes to existing ones. Question Issues that are actually questions rather than problem reports. AI Issues with the AI engine, including micro AIs. labels Oct 28, 2018
@Vultraz
Copy link
Member

Vultraz commented Oct 28, 2018

Remove it completely. It's always been a confusing, overly-complex mechanic that likely no-one uses that just creates headaches for us and doesn't enhance scenarios in any way.

@gfgtdf
Copy link
Contributor

gfgtdf commented Oct 28, 2018

A way to control the ai is clearly useful if done properly, It is still annyoing when you for example play a scenario with an ai ally and you see the ai going siuicidal towardes the enemy area instead of just staying in the castle, and wait for me to do a joined forces attack.

From what you said though it seems like the current ai controller is neither easy to understand/maintain nor is really capable to fix these things, so ye i'd also go with removing it, at least the current code, from talking a briref look at you link it seems like its actually 90% hard-to-understand wml dialog code that would nowdays be done via wesnoth.show_dialgo anyways and 10%ai code that as you said doesnt really work the expected way.

@GregoryLundberg
Copy link
Contributor

I'm going to miss it but it sounds like it needs far too much work, so I won't oppose removing it.

Truthfully, I never really understood it, and I do remember giving exactly those orders which you said were contradictory.

If it stays, it needs "all, or some combination, of the above": better descriptive terms on-screen, better documentation, checks to prevent illogical or impossible conditions, and strengthening so the effects are more noticeable.

@mattsc
Copy link
Member Author

mattsc commented Oct 28, 2018

Yeah, I think it would be a lot of work to make it work better and more intuitively. Just to give a couple examples as a bit more background information:

"Be more defensive": Most people would expect some hanging back, maybe even forming defensive lines behavior. All this does is to set caution and aggression to less aggressive values, which is almost unnoticeable.

"Focus on protecting...": sets the protect_unit or protect_locationAI goals, which have a big disclaimer on the AiWML wiki page: Note that the AI will not station any units around the protected locations/units. It will only send units toward enemy units that come within protect_radius of them."

In either case, the AI does exactly what it is told to do, just that it is not necessarily what one would expect without reasonably in-depth knowledge of how the AI works.

@GregoryLundberg
Copy link
Contributor

GregoryLundberg commented Oct 28, 2018

So just make the options say what they mean:

"Be a bit more cautious in your hopeless, suicidal charges."

"Pay minimal lip service to protecting <unit> during your hopeless, suicidal charges."

/s

@CelticMinstrel
Copy link
Member

Additional options:

  • Change the behaviour of each command to be closer to what the player would expect, for example using MicroAIs.
  • Deprecate it, write something new from scratch to take its place.

@mattsc
Copy link
Member Author

mattsc commented Oct 29, 2018

Agreed that those would be good/preferable options. The problem is that I do not know how to do either one of those in a way that would work well enough in a (somewhat) general setting.

@Vultraz
Copy link
Member

Vultraz commented Nov 1, 2018

Remove it is!

@Vultraz Vultraz closed this as completed Nov 1, 2018
@CelticMinstrel
Copy link
Member

CelticMinstrel commented Nov 2, 2018

And @Vultraz instantly picks the absolute worst of the options. Thanks!

More seriously, at least put it through the proper deprecation cycle. This is not one of those cases where we cannot afford to maintain it just a little bit longer.

@CelticMinstrel CelticMinstrel changed the title What should we do with the AI controller? Deprecate the AI controller for removal Nov 2, 2018
@CelticMinstrel
Copy link
Member

CelticMinstrel commented Nov 2, 2018

After some discussion with Vultraz on IRC/Discord, we decided to reopen this as a reminder to actually do it.

The goal then is:

  • Mark the AI Controller macro(s) for level 3 deprecation, to be removed in 1.17.
  • Start removing any usage of them from mainline scenarios.

Personally I think it'd be preferable if an alternative were produced before we remove it, but apparently no-one really knows how to do that, so it seems likely that it won't happen, I guess. If I find time (which is unlikely), I may try my hand at it, but...

@CelticMinstrel CelticMinstrel reopened this Nov 2, 2018
@mattsc
Copy link
Member Author

mattsc commented Nov 2, 2018

Just adding a cross-link to #3450, where this is also mentioned as an action item.

@CelticMinstrel CelticMinstrel removed the Question Issues that are actually questions rather than problem reports. label Nov 3, 2018
@CelticMinstrel
Copy link
Member

Thinking of ideas for a Lua-based replacement, maybe with custom WML tags. Not sure yet if I'll actually do it, though.

mattsc added a commit that referenced this issue Nov 8, 2018
Ideally we would replace it with a more effective and intuitive version at some point, but currently we do not know how to set up AI behavior that both makes sense and is usable in a general setting (without consisting of unit-level control).
@mattsc
Copy link
Member Author

mattsc commented Nov 8, 2018

Ticked off both tasks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AI Issues with the AI engine, including micro AIs. Enhancement Issues that are requests for new features or changes to existing ones.
Projects
None yet
Development

No branches or pull requests

5 participants