It is currently Tue Oct 23, 2018 9:37 am

All times are UTC + 9:30 hours




Post new topic Reply to topic  [ 15 posts ] 
Author Message
 Post subject: So, let's make some AI flowcharts
PostPosted: Tue Jan 16, 2007 12:31 pm 
Offline
User avatar

Joined: Thu Sep 21, 2006 6:48 am
Posts: 3681
Location: Location, Location
In my spare time I made a huge flowchart of a rudimentary AI shell, but I'm too lazy to upload all of them.

So, uh, we don't need code, just how the computer would 'think' when looking at a situation.

A 'basic' AI would work like this:

Power Phase (may change due to CO)
Capture Phase
Repair Phase
Combat Phase
Advance Phase
Build Phase
(veggie-hunter's airport chart: here

Capture Phase:
[Do nothing, because they'll be moved at the Advance Phase]
Image

I'll get the others up(...later), but this is sort of the 'generalized' way we can use at the moment to hammer something out.

_________________
"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."


Last edited by Captain Vimes on Sun Jan 28, 2007 7:51 am, edited 1 time in total.

Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 16, 2007 1:16 pm 
Offline
User avatar

Joined: Fri Jun 23, 2006 2:33 am
Posts: 10286
Location: TF2
Hmmm....

we're going to have to do different ones for different AI settings, don't we?

Or different COs, too.

good idea though.

Organizing <_<


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 16, 2007 1:20 pm 
Offline
User avatar

Joined: Thu Sep 21, 2006 6:48 am
Posts: 3681
Location: Location, Location
Most AIs will be the same.

Hopefully in the end we'll mostly just have to tweak a few values (Sami might have a lower threshold for whether a property is defendable or not, MD COs might activate their power anytime, etc.)

_________________
"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: Tue Jan 16, 2007 1:25 pm 
Offline
User avatar

Joined: Fri Jun 23, 2006 2:01 am
Posts: 253
Location: Kansas
That's pretty good for an example, though it would definitely need tweaking. For example, in that one you would just have to kill an APC to get the AI to want to build another one, wasting its funds.

Also, you have nowhere, move infantry toward properties. Instead, they sit and do nothing.

GJ with the example though and we really should be getting these done.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 16, 2007 1:29 pm 
Offline
User avatar

Joined: Fri Jun 23, 2006 1:09 am
Posts: 2528
Location: Bored out of my mind.
Speaking of powers...
Quote:
One thing that bugged me about the AW2/AW:DS AI was that except for certain rare cases (such as Andy's SCOP), the AI used their SCOP at the start of the first turn the meter was full (or when charged, as was the case with Mass Damage COs). I propose that the CW AI be more strategic about their power usage. (This ignores COs whose powers are based on Mass Damage, since that's helpful in most cases).

My idea:
* At the start of a turn when an SCOP meter is full, the battlefield is checked against criteria for its activation (note that if a Tag Power were ready, these criteria would be more lenient). If those conditions are met, then they activate the power. It could be something like (in Adder's case) an amount of viable (i.e. not Tank VS Md. Tank) attack options would be opened up by Sidewinder. For firepower COs, it could be in terms of OHKOs.
* If these criteria are not met, the next RN in a series of RNs determined at the start of the battle will be checked against a percentage chance that the CO will activate the power anyways, so that we don't get situations where the CO never uses their power. This chance increases for each turn the power isn't used.
* If a CO like Sasha is in play as an enemy, the power is more likely to be activated.

Or something like that. I thought of this when considering how nasty Falcone's SCOP is when used correctly (read: enemy built heavy units), and how the AI generally wouldn't know how to use it correctly...

Of course, that would happen farther down the line, when the AI becomes more elaborate.

_________________
~Blue Moon Campaign Designer~
Image
Credit to Fighter_Dedede for the banner.
"Golly great geishas, Kanbei! The enemy's advancing like mold on bread!" ~Kosheh
Indeed. The fact I actually know someone who wrote Sailor Moon Cannibal Slash proves this point. ~Xenesis


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 23, 2007 8:18 pm 
Offline
User avatar

Joined: Fri Jun 23, 2006 2:02 am
Posts: 158
I agree that OP but change "do nothing" to "move closer capturable property". That way they don't waste their time to wait APC. Also move to transport only if it is closer than target enemy/neutral property.

Then. Typical AW 2 and AW weakness in AI is to block them so that they just wasted their turns. So change that when Infantry is in stuck and can't move anywhere expect only way out is to attack enemy unit, attack to that unit make room for AI to move so they can destroy blocked path when stuck and order neaby best unit for situation to attack that path blocker enemy unit.


EDIT: oops

Quote:
Capture Phase:
[Do nothing, because they'll be moved at the Advance Phase]

_________________
Image
Image
http://www.allyourbsoft.net site owner.
www.cnc3forums.com moderator.


Top
 Profile  
 
 Post subject: Re: So, let's make some AI flowcharts
PostPosted: Wed Jan 24, 2007 7:14 pm 
Offline
User avatar

Joined: Mon Dec 04, 2006 1:04 pm
Posts: 30
Captain Vimes wrote:
In my spare time I made a huge flowchart of a rudimentary AI shell, but I'm too lazy to upload all of them.

So, uh, we don't need code, just how the computer would 'think' when looking at a situation.

A 'basic' AI would work like this:

Power Phase (may change due to CO)
Capture Phase
Repair Phase
Combat Phase
Advance Phase
Build Phase

Capture Phase:
[Do nothing, because they'll be moved at the Advance Phase]
Image

I'll get the others up(...later), but this is sort of the 'generalized' way we can use at the moment to hammer something out.


This is a good start to what we call a "decision tree" in AI, and whether you intended it or not, you've got it completely right in terms of structure.

A decision tree plots a bunch of nodes with 2 branches leading to child nodes that ask a yes/no question, and based on a series of yes' and no's, you arrive at some action.

This is a good start. Just be careful that it stays general and that it accounts for a team's various levels of strategy rather than just that one unit's goals. And most importantly, you need to more precisely define vague terms that you've conveniently quoted in there because you knew they were subject to discussion. :)


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 25, 2007 8:03 am 
Offline
User avatar

Joined: Thu Sep 21, 2006 6:48 am
Posts: 3681
Location: Location, Location
I've got to update this topic >_>

But yeah, AI is going to be really difficult to tweek. If we had a userbase that would support about 100 games per week against an AI we could do some neat darwinian jig-bobs with adjusting priorities up and down until we hit a sweet spot.

But we don't. ;_;

_________________
"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: Thu Jan 25, 2007 9:19 am 
Offline
User avatar

Joined: Mon Jul 31, 2006 9:01 am
Posts: 1191
Location: Burning stuff on your lawn
I'm positive we can hire a hobo to play 100 games a week. It'll cost three sandwiches. I've got some lunchmeat, anyone have a loaf of bread?

On topic, I see a problem with the flowchart you have there. After all the properties are captured, the AI would see that there are none in range, and since there's not likely to be transports near the front lines, they'll probably make transports a priority for a good duration of the game. While this isn't bad during the beginning of the game, it'll need tweaking so that there isn't a flood of transports. Oh, wait...there'll always be props to capture, since there's two armies...well, a cap on the number of transports is still a good idea. 14 T-copters aren't going to help them.

_________________
sup


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 25, 2007 11:40 am 
Offline
User avatar

Joined: Mon Dec 04, 2006 1:04 pm
Posts: 30
Captain Vimes wrote:
I've got to update this topic >_>

But yeah, AI is going to be really difficult to tweek. If we had a userbase that would support about 100 games per week against an AI we could do some neat darwinian jig-bobs with adjusting priorities up and down until we hit a sweet spot.

But we don't. ;_;


If you are talking about implementing a learning scheme to "teach" the AI, a more efficient way would be to pit a basic AI against itself, but on a whole, I discourage the use of learning as a technique for bolstering the AI. It holds a lot of promise in the academic side of things, but in practice, it's not used very much at all in games, especially one with so many rules like AW.

If you want a customizable, flexible AI, you are going to have to take a completely different approach from this because this approach does not cater to flexibility and derives its simplicity and efficiency from its inflexibility.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 26, 2007 9:05 am 
Offline
User avatar

Joined: Mon Jul 31, 2006 9:01 am
Posts: 1191
Location: Burning stuff on your lawn
How much more difficult would it be to give the AI the ability to learn from it's errors and the player's actions? As the game progresses, the AI could change tactics to counter what the player is doing.

For example, the AI builds a bomber. It gets shot down by the player's Anti-Air, and the next time they build a bomber, they keep it safe until all of the Anti-Air units nearby are destroyed.

_________________
sup


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 26, 2007 9:12 am 
Offline
User avatar

Joined: Thu Sep 21, 2006 6:48 am
Posts: 3681
Location: Location, Location
I think it would be easier just to say "If there are anti-air units within range of the airport, don't build bombers and prioritize destroying those anti-air (if bombers are absolutely nessecary)" >_>

_________________
"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 Jan 26, 2007 9:41 am 
Offline
User avatar

Joined: Mon Jul 31, 2006 9:01 am
Posts: 1191
Location: Burning stuff on your lawn
Sorry, that's a poor example...I mean something along the lines of building a counter to whatever the player has rushed with. If the player rushes them with B-copters, the AI will make sure they have a few Anti-Air units around to prevent it from happening again.

Or, when they're on the offensive, they try new strategies every time their attack fails. If they rush the enemy with tanks and get wiped out, they'll probably try an air strike, or use tanks and flank with b-copters.

Complicated, yes, but it'd give the AI an unpredictable edge.

_________________
sup


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 26, 2007 2:07 pm 
Offline
User avatar

Joined: Mon Dec 04, 2006 1:04 pm
Posts: 30
Kornelius The Great wrote:
How much more difficult would it be to give the AI the ability to learn from it's errors and the player's actions? As the game progresses, the AI could change tactics to counter what the player is doing.

For example, the AI builds a bomber. It gets shot down by the player's Anti-Air, and the next time they build a bomber, they keep it safe until all of the Anti-Air units nearby are destroyed.


It's a whole subfield of AI within itself. It works great and is manageable to implement for a smaller board game like Tic-Tac-Toe or even chess (I did an learning AI for these a few years ago), but I've never seen it done for a turn-based strategy game like this because of this game's relative complexity. I'm not saying that it's impossible, but whoever would implement this *really* needs to know their stuff to succeed at it, otherwise, you end up making a seemingly "dumber" AI than one that doesn't learn.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jan 28, 2007 4:50 am 
Offline
User avatar

Joined: Sat Oct 28, 2006 8:40 am
Posts: 2108
Suggestion for Capture Phase and other phases: At the end of each turn, if there are still empty bases, check to see if it has leftover funds for infantry, and if yes, build as many as possible.

Just a suggetion. I like the flowcharts...>_>

_________________
Image
Sig by Sasquatch.
Hit: Kindness
Miss: Pain
Violence = Leading cause of death in this country = illegal = fine and dandy. Pg-13, R if it's really bad.
Sex = leading cause of life in this country = natural and perfectly legal biological process = OMG TEH NOES XXX!11!!! ---Someone at some forum, I forget
"If you have made mistakes. . . there is always another chance for you. . . You may have a fresh start any moment you choose, for this thing we call 'failure' is not the falling down but the staying down." -- Mary Pickford


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 15 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