Author |
Message |
jgillotti1352
Joined: Tue Aug 12, 2008 2:07 pm Posts: 39
|
how would i make a changeable AI for a computer player in action script 2.0
|
Sat Apr 11, 2009 11:22 am |
|
|
MoChild
Joined: Sat Jan 24, 2009 3:01 pm Posts: 40
|
You might want to tell us what kind of game this is going to be before we give you an idea. What would you want the AI to do? And what do you mean by changeable, stats or what?
_________________
|
Sat Apr 11, 2009 4:25 pm |
|
|
x2i
Joined: Mon Aug 11, 2008 1:09 pm Posts: 166 Location: England lol
Gender: Male
Currently Playing: Minecraft
|
Aside from what MoChild said - AI is difficult to program and the term is used too loosely - Artificial Intelligence is when a computer is seeming to think for itself based on information it receives, but actually all it is doing is math and what are known as IF statements - for instance if it gets too close to a wall it would compute the fact that it needs to turn. If you are playing a game of snap and the computer places a card down that is similar to the one on the pile - they would determine the need to call Snap.
So therefore it all depends on what type of game you are making and what kind of 'AI' you want the character to have. And how impressive you want the 'AI' to be depends on how much effort you put in... usually the more info you give the better decisions it will be able to make.
Some forms of 'AI' I use are distance calculation in a fighting game - such as if two characters are close together, they may wish to attack one another. Another might be based on how much health a player has as to whether or not he should heal - providing he has enough health packs. Do you see what I mean about providing information?
If you understand these concepts then 'changeable AI' (I'm assuming you mean 'AI' that can change depending on certain criteria) should be easier to grasp. But please... tell us a little bit more about what you aim to achieve.
|
Sat Apr 11, 2009 7:16 pm |
|
|
jgillotti1352
Joined: Tue Aug 12, 2008 2:07 pm Posts: 39
|
the kind of AI i am looking for is for a smash bros type of game and i want it to be changeable based on the level of difficulty that a person would choose so that the ai won't be to hard for a person
|
Sun Apr 12, 2009 1:27 pm |
|
|
x2i
Joined: Mon Aug 11, 2008 1:09 pm Posts: 166 Location: England lol
Gender: Male
Currently Playing: Minecraft
|
Well, like I said, distance calculation would help for that... you could make the computer attack more often on a higher level of difficulty and make him deal more damage too - that would simulate difficulty levels.
Take SSF2 for example, on the easier levels, the characters seem to stand around gawmlessly for a while before attacking, this would also simulate a low level AI, because they act like they haven't got a clue what to do in the game.
If you read the readme post, you can find a lot that will help you along with these types of AI.
|
Sun Apr 12, 2009 6:52 pm |
|
|
Kirbyfan42
Joined: Mon Aug 11, 2008 12:07 pm Posts: 827
Gender: Anime Girl
|
Things that may help you with lower leveled AI Smash Enemies: -Make them not run -They will have slow reaction time -Their damage ratio should be higher (they get hit farther, and the scale is much for extended) -Mainly use weak moves -Slow recovery time
That what I got off the top of my head. I don't have Flash yet, so I can't help you with the actaully coding, but I can tell you what you should do with it.
_________________ Not credited in SSF2's credits. I've accomplished nothing. =p
|
Sat Apr 18, 2009 6:07 pm |
|
|
jgillotti1352
Joined: Tue Aug 12, 2008 2:07 pm Posts: 39
|
i already know what i want in the game but thanks for trying to help anyway
|
Sun Apr 19, 2009 7:47 am |
|
|
Kirbyfan42
Joined: Mon Aug 11, 2008 12:07 pm Posts: 827
Gender: Anime Girl
|
Ok.
_________________ Not credited in SSF2's credits. I've accomplished nothing. =p
|
Sun Apr 19, 2009 10:36 am |
|
|
johnnyg5646
Joined: Mon Aug 11, 2008 6:56 am Posts: 469 Location: not so superhappy fun fun land....
|
There's few ways to make AI possibly a code where the AI tries to run after the character. you can find that some where on newgrounds or here for sure. and when the AI gets a cirtain distance to the character he could attack with a random attack. theres two ways I can think of. one requiers complete solid code. another would be to put circles (alpha all the way to 0) and make them movieclips and put this code in it: correct me if i'm wrong here. AI is very complex and take a while to get it right.
_________________
|
Thu Apr 23, 2009 6:20 pm |
|
|
jgillotti1352
Joined: Tue Aug 12, 2008 2:07 pm Posts: 39
|
| | | | johnnyg5646 wrote: There's few ways to make AI possibly a code where the AI tries to run after the character. you can find that some where on newgrounds or here for sure. and when the AI gets a cirtain distance to the character he could attack with a random attack. theres two ways I can think of. one requiers complete solid code. another would be to put circles (alpha all the way to 0) and make them movieclips and put this code in it: correct me if i'm wrong here. AI is very complex and take a while to get it right. | | | | |
ok ill look at newgrounds and thanks ill try the code out
|
Sat Apr 25, 2009 6:34 pm |
|
|
johnnyg5646
Joined: Mon Aug 11, 2008 6:56 am Posts: 469 Location: not so superhappy fun fun land....
|
| | | | jgillotti1352 wrote: | | | | johnnyg5646 wrote: There's few ways to make AI possibly a code where the AI tries to run after the character. you can find that some where on newgrounds or here for sure. and when the AI gets a cirtain distance to the character he could attack with a random attack. theres two ways I can think of. one requiers complete solid code. another would be to put circles (alpha all the way to 0) and make them movieclips and put this code in it: correct me if i'm wrong here. AI is very complex and take a while to get it right. | | | | |
ok ill look at newgrounds and thanks ill try the code out | | | | |
if the code doesn't work, i probibly have the random part wrong, maybe someone should check it?
_________________
|
Mon Apr 27, 2009 3:42 pm |
|
|
Evilagram
Joined: Wed Apr 29, 2009 11:28 pm Posts: 323 Location: Nowhere, Antarctica
Gender: Anime Girl
Skype: Evilagram
|
It's easier to code a difficult AI than to code a stupid one. To code a brilliant AI however is much harder than both.
Define two or three motion ranges, close, mid, far, or something like that. Say that it is in _____ range when the absolute value of the distance on the X axis is whatever. If it is on the ground, and in range, then have it perform an attack. If it is further away, have it move closer. If it has a ranged attack, and they're in range, have them use that. Obvious stuff. Do the same for aerial attacks. If they're in close range and the y value is less than the character's then have them attack down. If they are below the character, have them attack up. If in mid range and above, have them approach and attack from the side.
Figure out some stuff on your own, we can't program an AI for you.
_________________Style [Stayl] (n) - One's unique and personal method of defacing a perfectly good piece of paper. READ THIS: http://ipgd.freehostia.com/copypasta.html
|
Thu Apr 30, 2009 1:00 am |
|
|