Adjustable AI strength

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:
User avatar
Dragon280
Posts: 8
Joined: December 18th, 2008, 2:03 pm

Adjustable AI strength

Post by Dragon280 »

A common complaint of players is randomness, but analysis shows that the RNG is fair. People think that randomness is an issue because AI tends to handle poor random numbers better. The problem lies in the AI, which is too strong for many players. Currently, the difficulty is adjusted by changing the resources (gold, units, etc) available to each team. The AI remains strong even at lower difficulty levels. Wesnoth would be more playable and more popular if the strength of the AI could be easily adjusted. The user experience would be more pleasent and less frustrating for players at all levels. The fact that Wesnoth is designed to be challenging should not prevent beginners from having fun from the game. Many commercial strategy games allow the adjustment of the difficulty of the AI. Widespread adoption of Wesnoth would only be possible if the game suits a wider audience.
Hard work isn't hard; you just have to do it.
User avatar
Ken_Oh
Moderator Emeritus
Posts: 2178
Joined: February 6th, 2006, 4:03 am
Location: Baltimore, Maryland, USA

Re: Adjustable AI strength

Post by Ken_Oh »

Welcome to the forum.

Please define "easily adjusted" and in what context would you like that adjustment to be able to be made?
User avatar
Dragon280
Posts: 8
Joined: December 18th, 2008, 2:03 pm

Re: Adjustable AI strength

Post by Dragon280 »

Ken_Oh wrote:Welcome to the forum.

Please define "easily adjusted" and in what context would you like that adjustment to be able to be made?
"Easily adjusted" means that the user can drag a slider (or a similar GUI widget) to set the difficulty of the AI in a multiplayer game before the game begins; for campaigns, the AI strength should be based on the difficulty level the player chooses before the campaign begins.
Hard work isn't hard; you just have to do it.
User avatar
Ken_Oh
Moderator Emeritus
Posts: 2178
Joined: February 6th, 2006, 4:03 am
Location: Baltimore, Maryland, USA

Re: Adjustable AI strength

Post by Ken_Oh »

AI strength is usually adjusted depending on campaign difficulty. Look in the campaign scenario files for "ifdef EASY/MEDIUM/HARD" to see this. e.g. in Heir to the Throne, Elves Besieged .

Code: Select all

#ifdef HARD
#define HIGH_PRIORITY_TARGETS
    [target]
        id=Delfador
        value=100
    [/target]
    [target]
        id=Konrad
        value=100
    [/target]
#enddef
#endif
Normally, you simply get this: {ATTACK_DEPTH 1 3 5}, which means how many units the AI will think about to attack a single unit. If you choose easy, it will be 1, medium 3 and hard 5.

Of course, this isn't the slider you're talking about. It's all defined by the designer, but a well-designed campaign will have things like this.

For MP, there are different AI you can choose while you're assigning the sides. However, as far as I know, none of them are that much better than the original one we've had for years. Turning up the "strength" of the AI isn't all that easy.
User avatar
Dragon280
Posts: 8
Joined: December 18th, 2008, 2:03 pm

Re: Adjustable AI strength

Post by Dragon280 »

At best, it should be easy for a player to fine-tune the AI without the need for the player to know Python; the game should allow the player to create and edit AIs in a fashion similar to Chessmaster (http://www.chessmaster.com).
I may be unavailable for about two weeks; please tell admins not to delete my account. Thank you.
Hard work isn't hard; you just have to do it.
theeggman85
Posts: 8
Joined: December 21st, 2008, 6:36 am

Re: Adjustable AI strength

Post by theeggman85 »

I agree that adjusting AI should be easier, especially in multiplayer where only one of the AI's seems to make sense. Perhaps an AI intelligence slider, which would be hard to program I would assume. However, more clever AI would be amazing and a great addition to this game.
Skizzaltix
Posts: 1114
Joined: December 9th, 2005, 2:38 am

Re: Adjustable AI strength

Post by Skizzaltix »

It's a good idea--The only thing left is for someone(s) to sit down and program it in.

Also, I wouldn't worry about the admins deleting your account because you haven't logged in for a couple of weeks if I were you--I've been away for stretches of at least a year in the past, and my account's still around ;)
Max
Posts: 1449
Joined: April 13th, 2008, 12:41 am

Re: Adjustable AI strength

Post by Max »

Dragon280 wrote:The fact that Wesnoth is designed to be challenging should not prevent beginners from having fun from the game. Many commercial strategy games allow the adjustment of the difficulty of the AI. Widespread adoption of Wesnoth would only be possible if the game suits a wider audience.
there are lots of options to modify the difficulty in MP games - like gold or income. not sure why a lack of a slider for ai should be an issue that prevents bfw from getting more audience.

and for campaigns - most of the (single player) commercial games i know of also have fixed settings.
User avatar
Dragon280
Posts: 8
Joined: December 18th, 2008, 2:03 pm

Re: Adjustable AI strength

Post by Dragon280 »

Understood. I apologize for my mistake.

N.B. I was unable to quote the above post because I am currently using a mobile browser. I will be unavailable for about two weeks beginning from about tomorrow afternoon. Sorry if I'm distracting or repetitive; I'm only trying to clarify. Thank you.
Hard work isn't hard; you just have to do it.
User avatar
JW
Posts: 5046
Joined: November 10th, 2005, 7:06 am
Location: Chicago-ish, Illinois

Re: Adjustable AI strength

Post by JW »

The AI is pretty dumb currently. If you can code a harder AI I'm sure there would be need for a slider. As it stands though, the AI is really just too dumb to warrant anything like this.

I'm actually quite surprised that you think the AI is too hard. I'm guessing it's because they are difficult in campaigns? Well, generally the AI has a large monetary and/or positional advantage over the player, in addition to the limited number of turns the player gets to defeat it. With these advantages yes campaigns can be very difficult.

This is not due to the AI's general intelligence though. As I stated before the AI is actually quite stupid. It is due to very specific commands given to it in campaign scenarios that it even seemingly has intelligence - which it completely lacks if you were to play against it in a multiplayer match outside of a campaign.

I wholeheartedly agree that it would be nice to have a more easily programmable AI: it is apparently a very hard thing to code from what I hear. But, as it is, we all have to deal with what's given.

And please remember my first paragraph.
User avatar
thespaceinvader
Retired Art Director
Posts: 8414
Joined: August 25th, 2007, 10:12 am
Location: Oxford, UK
Contact:

Re: Adjustable AI strength

Post by thespaceinvader »

It would be lovely to have a better AI with controllable difficulty, among many other things (simple intelligence, for example, would be nice, in terms of things liek the use of ZoC to protect misson-critical units, and the ability to construct a decent defensive line). But writing a wesnoth AI is hard. Don't underestimate it. It's far, FAR more complex than games where writing a game-beating AI has been possible to date (such as chess, checkers, possibly Go etc).

SO feel free to give it a shot. But bear in mind that it is not easy.
http://thespaceinvader.co.uk | http://thespaceinvader.deviantart.com
Back to work. Current projects: Catching up on commits. Picking Meridia back up. Sprite animations, many and varied.
User avatar
Dragon280
Posts: 8
Joined: December 18th, 2008, 2:03 pm

Re: Adjustable AI strength

Post by Dragon280 »

JW wrote:The AI is pretty dumb currently. If you can code a harder AI I'm sure there would be need for a slider. As it stands though, the AI is really just too dumb to warrant anything like this.

I'm actually quite surprised that you think the AI is too hard. I'm guessing it's because they are difficult in campaigns? Well, generally the AI has a large monetary and/or positional advantage over the player, in addition to the limited number of turns the player gets to defeat it. With these advantages yes campaigns can be very difficult.

This is not due to the AI's general intelligence though. As I stated before the AI is actually quite stupid. It is due to very specific commands given to it in campaign scenarios that it even seemingly has intelligence - which it completely lacks if you were to play against it in a multiplayer match outside of a campaign.

I wholeheartedly agree that it would be nice to have a more easily programmable AI: it is apparently a very hard thing to code from what I hear. But, as it is, we all have to deal with what's given.

And please remember my first paragraph.
I hear you. I'm actually a fairly new player. :)
thespaceinvader wrote:It would be lovely to have a better AI with controllable difficulty, among many other things (simple intelligence, for example, would be nice, in terms of things liek the use of ZoC to protect misson-critical units, and the ability to construct a decent defensive line). But writing a wesnoth AI is hard. Don't underestimate it. It's far, FAR more complex than games where writing a game-beating AI has been possible to date (such as chess, checkers, possibly Go etc).

SO feel free to give it a shot. But bear in mind that it is not easy.
Yes, creating an AI that will satisfy players at all levels isn't easy, and making it possible for a player to easily change the AI's characteristics is even harder. But I agree that it would be a wonderful addition, and it would greatly enhance the Wesnoth experience for everyone. Unfortunately, I cannot program in Python and, given the difficulty of writing such an AI, I do not expect this feature to be available anytime soon. I hope such an AI will be available by version 1.8 or equivalent.

I'm sorry that I'll be temporarily unavailable (see above posts) and this will be my last post before leaving. I will come back to the bulletin board in about two weeks. Since we seem to have consensus on this topic, I think it's okay to close this topic.
Hard work isn't hard; you just have to do it.
Max
Posts: 1449
Joined: April 13th, 2008, 12:41 am

Re: Adjustable AI strength

Post by Max »

Dragon280 wrote:Yes, creating an AI that will satisfy players at all levels isn't easy, and making it possible for a player to easily change the AI's characteristics is even harder. But I agree that it would be a wonderful addition, and it would greatly enhance the Wesnoth experience for everyone.
a slider for ai strength would be nice. it could be implemented (or rather faked) by setting a pool of global variables (that already exist in wml and campaigns could make use of). but it never would have a linear effect because you can't predict how certain settings affect a particular map/setup. (and that will always be the case unless someone creates a chess-like ai...)

but i still don't see why it "would greatly enhance the Wesnoth experience for everyone". and if you try to get a more "granular" difficulty option why does it have to be done by influencing the AI? what's wrong with income and gold?
Dave
Founding Developer
Posts: 7071
Joined: August 17th, 2003, 5:07 am
Location: Seattle
Contact:

Re: Adjustable AI strength

Post by Dave »

There are parameters available to scenario designers to allow them to tweak AI behavior and analysis depth, hence essentially tweaking AI difficulty.

The biggest problem, however, is that tweaking the AI to adjust difficulty is much harder than tweaking the resources available to the AI. In some scenarios, changing the AI's analysis depth might make a huge difference in difficulty, while in others it may make almost no difference at all. It is very difficult for a scenario designer to predict how much exactly changing the AI's analysis depth will alter the difficulty of their scenario, and would require a great deal of play testing to work out.

For these reasons, I think most scenario designers stick to tweaking resource availability to determine difficulty, rather than trying to tweak AI behavior.

David
“At Gambling, the deadly sin is to mistake bad play for bad luck.” -- Ian Fleming
roadkill
Posts: 92
Joined: November 3rd, 2008, 11:48 am

Re: Adjustable AI strength

Post by roadkill »

It may be hard to create a good AI for wesnoth, but is it that hard to create a worse one?

Heck could just change the current ais to be called easy, medium, hard. With "hard" corresponding with default.

Would keep new players happy.

But you would end up getting threads like "do you think normal difficulty is harder than hard difficulty?"

Or if an easier AI were made new players may start multiplayer even less-well prepared, by being deluded that they are competant & average by being able to beat the game on "normal" easier than what we have today!

I don't think it would be such a good idea to incorporate easier difficulties because of the problems above.

As for my opinion of the difficulty of the wenoth AI as it stands... its not really that hard, its competant in small areas (and makes good moves). If you made it dumber when I had picked "easy" as an eager noob, I think I would have cast aside the game thinking it was too easy & therefore crap.

So yeh its ok at the moment...

hey why not even copy the default ai 3 times & call them easy medium & hard. Gives the illusion of choice (which people want) doesn't leave the negative first impression that an easy AI would leave..
Post Reply