Automatic attack choice for you

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:
Invisible Philosopher
Posts: 873
Joined: July 4th, 2004, 9:14 pm
Location: My imagination
Contact:

Automatic attack choice for you

Post by Invisible Philosopher »

Currently, when you attack something, the game chooses the first attack in the list which does the most damage (you can change it after, of course). For certain units, that is quite annoying. For example, Elvish Rangers normally have equal melee and ranged attacks. The melee attack comes first in the list, so it is selected. But most enemies have stronger melee than ranged, so I have to keep selecting the ranged attack every time I attack.

Possible solutions:
When the attacks do equal average damage, pick the one that does less average damage to the attacker.
Or,
Use a scheme similar to the aggression that the AI uses.

The second one might not be entirely desirable, but the first one would be very convenient.
Play a Silver Mage in the Wesvoid campaign.
User avatar
turin
Lord of the East
Posts: 11662
Joined: January 11th, 2004, 7:17 pm
Location: Texas
Contact:

Post by turin »

it doesn't always choose the best attack. It always chooses the melee attack. It orders them from melee to ranged, every time.

Because of this, your whole statement makes little sense...
For I am Turin Turambar - Master of Doom, by doom mastered. On permanent Wesbreak. Will not respond to private messages. Sorry!
And I hate stupid people.
The World of Orbivm
Dave
Founding Developer
Posts: 7071
Joined: August 17th, 2003, 5:07 am
Location: Seattle
Contact:

Post by Dave »

turin wrote:it doesn't always choose the best attack. It always chooses the melee attack. It orders them from melee to ranged, every time.
It orders them the same all the time, but the attack that is selected when the dialog is opened varies. Currently it will select the attack where damage*number_of_strikes*chance_to_hit is the highest, choosing the first in the list if they are equal.
Invisible Philosopher wrote: When the attacks do equal average damage, pick the one that does less average damage to the attacker.
I agree with this. It's a small improvement that'd make the selection slightly better. I'll look at changing it.
Invisible Philosopher wrote: Use a scheme similar to the aggression that the AI uses.
This has been suggested before, but I don't like it so much. The idea of the default attack selection is to make the 'very very obvious choice' of the most powerful attack. If the player wants to do something 'smart' like choose a less powerful attack in exchange for less retaliation, or for a higher chance to kill, etc, then that's up to them to make that tactical choice.

David
“At Gambling, the deadly sin is to mistake bad play for bad luck.” -- Ian Fleming
User avatar
turin
Lord of the East
Posts: 11662
Joined: January 11th, 2004, 7:17 pm
Location: Texas
Contact:

Post by turin »

i stand corrected...
anyway, i still don't see a point to this. it doesn't take much time at all to select what attack you want, and personally i would find it annoying to have it keep switching back and forth on what the default selected attack was.
but if someone wants to implement it, i have no major objections.. :)
For I am Turin Turambar - Master of Doom, by doom mastered. On permanent Wesbreak. Will not respond to private messages. Sorry!
And I hate stupid people.
The World of Orbivm
User avatar
Elvish_Pillager
Posts: 8137
Joined: May 28th, 2004, 10:21 am
Location: Everywhere you think, nowhere you can possibly imagine.
Contact:

Post by Elvish_Pillager »

turin wrote:and personally i would find it annoying to have it keep switching back and forth on what the default selected attack was.
Well, suppose you want to attack an Orcish Grunt with your Elvish Ranger. Which attack would you use?
It's all fun and games until someone loses a lawsuit. Oh, and by the way, sending me private messages won't work. :/ If you must contact me, there's an e-mail address listed on the website in my profile.
User avatar
turin
Lord of the East
Posts: 11662
Joined: January 11th, 2004, 7:17 pm
Location: Texas
Contact:

Post by turin »

Elvish Pillager wrote:
turin wrote:and personally i would find it annoying to have it keep switching back and forth on what the default selected attack was.
Well, suppose you want to attack an Orcish Grunt with your Elvish Ranger. Which attack would you use?
i would take the time to change the attack manually, rather than trust the computer to do it, ;)
For I am Turin Turambar - Master of Doom, by doom mastered. On permanent Wesbreak. Will not respond to private messages. Sorry!
And I hate stupid people.
The World of Orbivm
Dave
Founding Developer
Posts: 7071
Joined: August 17th, 2003, 5:07 am
Location: Seattle
Contact:

Post by Dave »

turin wrote:
Elvish Pillager wrote: Well, suppose you want to attack an Orcish Grunt with your Elvish Ranger. Which attack would you use?
i would take the time to change the attack manually, rather than trust the computer to do it, ;)
But you don't have to 'trust' the computer to do it.

You select to attack with your Ranger, and you see that by default the ranged attack is highlighted, which is the attack you wanted to use anyway. Then you press enter (or click ok) to confirm the attack.

David
“At Gambling, the deadly sin is to mistake bad play for bad luck.” -- Ian Fleming
User avatar
Elvish_Pillager
Posts: 8137
Joined: May 28th, 2004, 10:21 am
Location: Everywhere you think, nowhere you can possibly imagine.
Contact:

Post by Elvish_Pillager »

For instance, if you have a large number of Elvish Archers attacking a large number of Orcish Grunts, you know you want to use their bows, so you can do "attack-ok-attack-ok-etc" but with a large number of Elvish Rangers in the same position where none of them are Strong, you have to do "attack-select-ok-attack-select-ok-etc" which is much more of a nuisance.
It's all fun and games until someone loses a lawsuit. Oh, and by the way, sending me private messages won't work. :/ If you must contact me, there's an e-mail address listed on the website in my profile.
SteelP
Posts: 131
Joined: May 18th, 2004, 2:18 pm
Location: Spain

Post by SteelP »

Well, you could give them the attack that is their specialty... I mean, rangers come from archers, so long range would be their default; all the advanced units will have the default attack specialty of the basic unit of their branch; I think this would work for every unit (as its basic specialty is always their best attack), and is a lot more simple. But I don't know if it's easy to implement...
Perhaps this could be set in the .cfg for each unit?
Dacyn
Posts: 1855
Joined: May 1st, 2004, 9:34 am
Location: Texas

Post by Dacyn »

Or have the default be whatever was done last time...
neil
Posts: 20
Joined: June 24th, 2004, 7:24 pm

good idea

Post by neil »

I have been thinking about this myself for a while... I think I posted something about picking attacks based on something slightly different.

If it's not too presumtuous, I want to suggest a way of doing this.

Math follows: !!

For every possible attack-defence pair. suppose that the attack is 4-2 50% and the defence is 3-1 30%

you build a table of all possible outcomes: the table is (2+1) by (1+1) since you can hit between 0 and 2 times and you can get hit between 0 and 1 times. Each entry in the table has:

- the probability that this case happens (you can fill this table very quickly by dynamic programming)
- the amount of damage that the attacker and defender has taken
- whether or not the attacker or defender is dead

taking a weighted average of each entry in the table you get:
Ad and Dd: the average amount of damage each has taken
Ak and Dk: the chance that each has been killed

These values could be used to improve the AI as well as give the player the more obvious answer.

given two choices of attack, we want to compare them. I suggest we use Ad/Dd as the goodness of that choice, the better goodness wins and use Ad in case both Dd are 0. That's simple and will do what Invisible Philosopher wants.

But to make things even better, I sometimes do want the melee attack if it has a strength of 10 and the ranged attack has a strength of 8 and the defender has 9 HP then even if he can fight back, I want to increase my chances of killing him.

So, maybe the formula could be a bit more clever: if Ak for both attacks that we are comparing is 0 and Dk is higher for one of the two attacks by at least 5% then over-ride the formula above and go for this method.

Doing this, at least for the AI, will be a big improvement. Many times I have suckered the AI into attacking into a blocker that will poison him, or attack from the water (the AI should not attack if Aa/Dd < 1/2 -- that means you are getting screwed). Also I noticed that Ad and Dd can be negative if someone has a draining attack.

Please don't tell me "my whole statement makes little sense" turin. :wink:
User avatar
Elvish_Pillager
Posts: 8137
Joined: May 28th, 2004, 10:21 am
Location: Everywhere you think, nowhere you can possibly imagine.
Contact:

Post by Elvish_Pillager »

No, your idea is up to Dave to refute.
Dave wrote:This has been suggested before, but I don't like it so much. The idea of the default attack selection is to make the 'very very obvious choice' of the most powerful attack. If the player wants to do something 'smart' like choose a less powerful attack in exchange for less retaliation, or for a higher chance to kill, etc, then that's up to them to make that tactical choice.

David
It's all fun and games until someone loses a lawsuit. Oh, and by the way, sending me private messages won't work. :/ If you must contact me, there's an e-mail address listed on the website in my profile.
neil
Posts: 20
Joined: June 24th, 2004, 7:24 pm

Post by neil »

Elvish Pillager wrote:No, your idea is up to Dave to refute.
Dave wrote:This has been suggested before, but I don't like it so much. The idea of the default attack selection is to make the 'very very obvious choice' of the most powerful attack. If the player wants to do something 'smart' like choose a less powerful attack in exchange for less retaliation, or for a higher chance to kill, etc, then that's up to them to make that tactical choice.

David
A bit snipish, eh Pillager?!

There are two reasons why you would want this system:
- the AI would be harder to trick
- it eliminates tedium from the game

Personally, I see the strategy of the game more in how you organize your troops and less in doing the numerology/math-crunching of choosing an attack. You can still be clever here, taking into account all sorts of different things (poison, how many attackers, etc.) but the default selection should, I think, do the math crunching.

Neil
User avatar
turin
Lord of the East
Posts: 11662
Joined: January 11th, 2004, 7:17 pm
Location: Texas
Contact:

Post by turin »

Elvish pillager, his suggestion was for a new AI attack method, not deciding what would be selected by default when you open the attack window.
For I am Turin Turambar - Master of Doom, by doom mastered. On permanent Wesbreak. Will not respond to private messages. Sorry!
And I hate stupid people.
The World of Orbivm
Dacyn
Posts: 1855
Joined: May 1st, 2004, 9:34 am
Location: Texas

Post by Dacyn »

I think the AI should be for the AI; the default for the player should not be chosen by a complicated AI. I like the idea of the default being specified by the unit creator somewhat...
Post Reply