It is currently Thu Aug 16, 2018 2:40 am

All times are UTC + 9:30 hours




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Eternal Golden Braid/Chess-style AI
PostPosted: Fri Mar 23, 2007 5:32 am 
Offline
User avatar

Joined: Thu Sep 21, 2006 6:48 am
Posts: 3681
Location: Location, Location
So, after we set up a 'single-turn' basis (an AI that reacts soley based upon the conditions as they are on the field.) we can start structuring an AI that works more along the lines of chess.

I'm not sure if this is feasible due to the massive amount of processing power required, but, well, it's be neat if we could.

Basically, in chess the AI goes:
> How should I move?
>Well, if I was the enemy how would I move? (Projecting 1 turn ahead)
>Well, if I was the enemy, plotting my move, I would see how would my enemy, ie, me, move. (Projecting 2 turns ahead)
>Well, if I was the enemy, plotting my move, I would see how would my enemy, ie, me, move. Of course, I would move depending on how my enemy moved... (Projecting 3 turns ahead)

And it gets progressively more complicated until we hit a point where the AI simply 'bottoms out' and says

>...based on current map conditions I would do this

And then the reasons sort of snaps back along the line to finally allow the AI to take its turn.

So basically, I'm not exactly sure how we could do this without using a huge amount of memory (since AW is more complicated than chess, and I think that to simulate this the computer would just create a geometrically increasing amount of maps per projection) but it's a nice idea.

_________________
"I got this [dragon tattoo] while a teenager. I met the greatest girl in the world and now I'm married. Problem is, she's afraid of dragons. I've started getting it removed. Will take years."


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 23, 2007 5:37 am 
Offline
User avatar

Joined: Thu Mar 22, 2007 9:36 am
Posts: 1665
Location: Waiting for blue mutants to feed me.
That sounds highly recursive...


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 23, 2007 8:04 am 
Offline
User avatar

Joined: Thu Jun 22, 2006 11:25 pm
Posts: 3903
Location: United Kingdom
Something like that would be great, but even just predicting 1 move ahead would probably do.

For example, we've already discussed how the AI should send infantry to capture buildings, now say there's an infantry 6 spaces away from a city, this would take 3 days to capture, however, what if there's an enemy infantry also 6 spaces away? The AI'll go for that city, while not realising that it's going to get attacked the following turn and slow down the capture. The thing is, the AI might have an APC or recon about that would reach the same city in 2 days and set up a block between your infantry and the enemy infantry, thus maintaining a 2 day capture.

Yeah, so, the AI would decide to move its infantry towards the city, but before doing so it could check if any units could potentially reach the same city in 2 days, and if so attempt to plan a block.

Before doing any move at all though it should scan every unit on the field once, then work back over and assign each move a 'desirability rating'. So taking our infantry and recon scenario, if there're no enemy units able to attack within the 3 days then that move is assigned 1, a certain move. However if there is something in range, say another infantry, then the rating for that move would drop to 0.6, with a 0.4 chance to do something else (go for a different city or something. Taking the recon's point of view the rating for moving the recon as a block could be 0.5, while the other 0.5 may be to stop an enemy infantry capturing a different city within 2 days. If a tank was thrown into the fray though that choice would suddenly plummt to 0.05, and the option to act as a block would rise to 0.95, as a result (seeing as this is the most desirable move) your infantry going to capture that city would jump back up to 1 - there's now no reason not to do it.

So yeah, I propose that the AI analyses every unit once and then go back over itself to the start point and assigns each of a unit's potential moves a number where their totals sum to 1. These numbers can flacuate depending on other influeneces, see if it went for the infantry first it wouldn't have known there was a tank there until it got round to analysing the recon, and so the infantry values would alter accordingly on the backward swoop. Then, the number that is the highest for each unit's moves is the one that's executed.

_________________
Image


Top
 Profile  
 
 Post subject:
PostPosted: Sat Mar 24, 2007 2:32 am 
Offline
User avatar

Joined: Sat Jun 24, 2006 3:11 pm
Posts: 1266
Location: Should be programming AI and Sound
The problem with that is that with Chess there are a limited number of options, at the moment, on large maps, using that system the AI will explode. The best way to do the AI is definatly unit by unit, and to unify them all using some system. At the moment I plan to do this with something I call the "Objective System"which assigns a particular duty to each unit, which then attempts to fufill that duty first, and if not, attempt to fufill it, and then goes on to simpler tasks.

These would be easily changable, but would allow for some form of unification. I.E. a recon could be assigned the objective "Guard Infantry 6" which would then look for any units who could attank the infantry, and attack the most dangerous one to the infantry, which it could best damage OR if the location of the infantry is such that blocking, say, a choke point would be better, it would instead do that.

The principle is very similar to how the people I have discussed this with play, and I'm pretty sure that it accomplishes the same goal (unification and long term planning) but without the complexities or horrible run times that would be involved in a Chess style AI.

_________________
Image
Thanks to Taboo for the sig and avy. CLIFF NEEDS RATES AND COMMENTS: http://forums.customwars.com/viewtopic.php?t=5351


Top
 Profile  
 
 Post subject:
PostPosted: Sat Mar 24, 2007 9:27 am 
Offline
User avatar

Joined: Thu Sep 21, 2006 6:48 am
Posts: 3681
Location: Location, Location
We could always prune the number of possible moves - as in discarding 'trivial moves' (an infantry with no movement restrictions and not within the range of enemies has no reason to move 1/2 spaces - it should max out movement, period)

But, uh, yeah. You're the AI programmer!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC + 9:30 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Blue Moon by Trent © 2007
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group