AI points system

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
TheLost1
Posts: 154
Joined: April 9th, 2006, 1:12 am

AI points system

Post by TheLost1 »

I would like to propose that, in order to improve the AI, there is a points system initiated. Eve though I am not a programmer it seems easy to implement because it is based on variables. The system would work something like this:

1) During every turn, the AI assigns a value to each unit. it would assign these points based on normal damage dealing ability(without modifers), max hit points, current experience(or maybe experience needed), and proximity to strategic terrain(Explained later). Leaders would have the highest value. This will show the AI what enemy units it should kill, as well as what units it should retreat.

2) Each unit will also have a danger value based on the terrain it stands on, its current HP, and its current damage dealing ability. This will show the AI which units to avoid and which units to defend with.

A note on strategic terrain: Strategic terrain is based on the advantage it will give to both the player and The AI. a Dwarf AI will place great value on Mountains while a Elf AI will go for Forests. If they were both playing against each-other, both AI's would "Realize" that mountains and forests were valuable to each-other and fight over them.

I hope that people will give advice to this idea and eventually it might be implemented in a streamlined form.
The dragons are all colour-coded,
Some consider this system outmoded.
This was not preordained
Gary Gygax explained,
"My box of Crayolas exploded."
Dacyn
Posts: 1855
Joined: May 1st, 2004, 9:34 am
Location: Texas

Post by Dacyn »

isn't this basically how the AI already works?
(actually, unit values are currently based only on cost, but I don't see why your system would be better...)
Jester
Posts: 422
Joined: November 10th, 2005, 2:46 pm
Location: Delft

Post by Jester »

Dacyn wrote:isn't this basically how the AI already works?
(actually, unit values are currently based only on cost, but I don't see why your system would be better...)
I do. If a unit is more expensive then another one doesn't really matter (most of the times anyway), positioning, hp, xp, damage and such however do matter. The AI will fight a lot more inteligent this way, going after the important units, not only the expensive or weak.
I heard they were stoned out of their minds, trying to convince the Statue of Liberty to get naked...

CCBS - Compulsive Cat Biting Syndrome, when you know that kittens shouldn't have heads attached to their bodies.
TheLost1
Posts: 154
Joined: April 9th, 2006, 1:12 am

Post by TheLost1 »

What ive noticed is that the AI will chargeright into a horde of my strong units just to get at a weak one. The AI doesn't seem to have any regard for its own troops.
The dragons are all colour-coded,
Some consider this system outmoded.
This was not preordained
Gary Gygax explained,
"My box of Crayolas exploded."
Dacyn
Posts: 1855
Joined: May 1st, 2004, 9:34 am
Location: Texas

Post by Dacyn »

Jester wrote:If a unit is more expensive then another one doesn't really matter (most of the times anyway), positioning, hp, xp, damage and such however do matter.
Sorry, I meant to say that a unit's intrinsic value is determined only by cost[1]. Current HP and positioning are of course taken into account... (XP is generally not taken into account except for the opponent IIRC, but this is because it would be difficult for the AI to advance units anyway)
TheLost1 wrote:The AI doesn't seem to have any regard for its own troops.
IIRC that's based on the WML settings and not the AI itself. (so it can change from scenario to scenario)
Also, consider that there may be a reason. The AI does not have to conserve troops for the next scenario, so killing off a wounded lvl 2 unit could be worthwhile even if it completely exposes the AI's troops.

I would advise not making any suggestions about the AI unless you look at code, though...

[1] Actually this rule is not true for leaders
SmokemJags
Posts: 580
Joined: February 14th, 2006, 3:24 am
Location: New Avalon
Contact:

Post by SmokemJags »

http://www.wesnoth.org/wiki/AiWML

aggression This key affects how an AI player will fight.
It determines how an AI considers the difference between its units and its opponents by taking the value 1 - AI unit value in proportion to opponent unit value. ('Unit value' here means that the AI weights its decision on the chance to kill a unit or be killed, using a combination of its own units.) So, to make an AI which considers its units worthless i.e. only cares about how much damage attacks inflict, set aggression at 1 - 0 = 1.0. This is the highest meaningful value for aggression; although it is insane, it is used on many HttT levels. If an AI set on this value can inflict 1 damage and take 0, or inflict 2 damage and take 20 himself, he'll take the latter option. To make an AI which considers its units equally as valuable as its opponent's i.e. only attacks if he feels he can inflict more damage than he receives, set aggression at 1 - 1 = 0.0. Although an AI which considers its opponent's units worthless is impossible under this scheme, an AI which, for example, considers its units twice as valuable as its opponent's can be represented by aggression 1 - 2 = -1.0. having to be able to inflict more damage than he takes for it to be worth his while. The default is 1 - 1/2 = 0.5, which means the AI is content with dealing only half the damage to his opponent of that which he himself takes.
"A wise man speaks when he has something to say. A fool speaks when he has to say something."
TheLost1
Posts: 154
Joined: April 9th, 2006, 1:12 am

Post by TheLost1 »

I was talking about multiplayer.
The dragons are all colour-coded,
Some consider this system outmoded.
This was not preordained
Gary Gygax explained,
"My box of Crayolas exploded."
Dacyn
Posts: 1855
Joined: May 1st, 2004, 9:34 am
Location: Texas

Post by Dacyn »

well, I do think aggression in multiplayer should be 0, since the AI has the same resources as you do.
SmokemJags
Posts: 580
Joined: February 14th, 2006, 3:24 am
Location: New Avalon
Contact:

Post by SmokemJags »

Eve though I am not a programmer it seems easy to implement because it is based on variables. The system would work something like this:
Have fun and let us know when you've got a working model.
I was talking about multiplayer.
Why are you even concerned with AI in 'multiplayer'. The point of multiplayer is... oh forget it. :lol:
"A wise man speaks when he has something to say. A fool speaks when he has to say something."
User avatar
Elvish_Pillager
Posts: 8137
Joined: May 28th, 2004, 10:21 am
Location: Everywhere you think, nowhere you can possibly imagine.
Contact:

Re: AI points system

Post by Elvish_Pillager »

TheLost1 wrote:Even though I am not a programmer it seems easy to implement because it is based on variables.
1. Just about everything in programming is based on variables.
2. Traditionally, it's the non-programmers who think that features are easier to code than they actually would be. It would make sense for a programmer to say "Even though I am a programmer it seems easy to implement."
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
irrevenant
Moderator Emeritus
Posts: 3692
Joined: August 15th, 2005, 7:57 am
Location: I'm all around you.

Post by irrevenant »

Dacyn wrote:I would advise not making any suggestions about the AI unless you look at code, though...
I thoroughly disagree with this. You don't have to be a programmer to be familiar with how the Wesnoth AI plays; you just have to be observant. You don't have to be a programmer to notice something wrong that could use improvement.

Of course, if you aren't a programmer, you're not in a position to judge how feasible fixing it is, either...
SmokemJags wrote:Have fun and let us know when you've got a working model.
I'm quite tired of seeing this type of comment. I know the Open Source model is 'muck in and do it yourself' but that doesn't mean we should just ignore when someone without coding skill spots a problem.
SmokemJags wrote:Why are you even concerned with AI in 'multiplayer'. The point of multiplayer is... oh forget it. :lol:
There's nothing wrong with Multiplayer vs the AI. For starters, the AI tends to complain less when you only have time to play a game in 5-10 minute snatches. :)
Soliton
Site Administrator
Posts: 1688
Joined: April 5th, 2005, 3:25 pm
Location: #wesnoth-mp

Post by Soliton »

irrevenant wrote:
Dacyn wrote:I would advise not making any suggestions about the AI unless you look at code, though...
I thoroughly disagree with this. You don't have to be a programmer to be familiar with how the Wesnoth AI plays; you just have to be observant. You don't have to be a programmer to notice something wrong that could use improvement.
The point is, it's easy to spot i.e. "everyone" knows about it. So unless you're actually able/willing at working towards a fix it's a bit pointless to make any comments.
And as no-one is really working at the AI currently...
irrevenant wrote:
SmokemJags wrote:Have fun and let us know when you've got a working model.
I'm quite tired of seeing this type of comment. I know the Open Source model is 'muck in and do it yourself' but that doesn't mean we should just ignore when someone without coding skill spots a problem.
It is however slightly annoying if obvious problems are pointed out and suggested fixes show that there was not much effort taken to examine the current situation.
"If gameplay requires it, they can be made to live on Venus." -- scott
Dacyn
Posts: 1855
Joined: May 1st, 2004, 9:34 am
Location: Texas

Post by Dacyn »

irrevenant wrote:You don't have to be a programmer to be familiar with how the Wesnoth AI plays; you just have to be observant. You don't have to be a programmer to notice something wrong that could use improvement.
Suggesting something wrong, maybe. Suggesting a system which is similar to what we already have, but worse, seems totally pointless. So to rephrase, I would advise not suggesting a detailed system for the AI to follow unless you know something about the system it follows currently...
Although you might not have to look at code to do this; for example there is a reference at AiWML:
It decides upon 'targets', assigns those targets values, and moves units toward targets based on how easy it is to get to the targets, and how valuable the targets are.
Post Reply