AI scripting is basically scripting a computer programmed engine right? Like a computer programmed player? So I am just wondering for future reference, how do you do that?
Offline
To script an AI, you'd have to script the sprite to be aware of its surroundings, and make it respond to the changes around it. AI's tend to mimic actual players, by attempting to imitate what a player might do in the same situation they're in.
Offline
That'll probably be hard. Yea so I will definitely push my Super Smash Brawl game aside for a while until I unload other EASY Scratch game ideas.
Offline
Well still I will put it aside. I was making a game a while ago and it is up now and had ideas but couldn't figure it out. Now I know how to so that is why.
Offline
An AI opponent is a pretty tough thing to do. Even in the professional world, an intelligent AI is not easy. However, there are some basic things that you should remember when creating one:
-In its simplest sense, an AI is something that reacts based on the situation, just like a person does. Try having some conditionals that tell it what to do in certain situations. For example, you might have it punch when the player is in front of it, but try to move away or dodge if they're attacking.
-Once you've got the basic AI working, you may want to introduce some randomness. People are fallible and don't always react the same way, so neither should your AI. Maybe have it pick a random number and do various different things that someone might do in that situation depending on the number chosen.
That's all I can think of right now. If I come up with anything else, I'll edit this post and add it.
Offline
Harakou wrote:
An AI opponent is a pretty tough thing to do. Even in the professional world, an intelligent AI is not easy. However, there are some basic things that you should remember when creating one:
-In its simplest sense, an AI is something that reacts based on the situation, just like a person does. Try having some conditionals that tell it what to do in certain situations. For example, you might have it punch when the player is in front of it, but try to move away or dodge if they're attacking.
-Once you've got the basic AI working, you may want to introduce some randomness. People are fallible and don't always react the same way, so neither should your AI. Maybe have it pick a random number and do various different things that someone might do in that situation depending on the number chosen.
That's all I can think of right now. If I come up with anything else, I'll edit this post and add it.
Thanks again Harakou! . (Good luck on getting the Moderator job!)
Offline
An AI is usually a very complicated script made of ifs and elses but it really depends what you need it for... my police car AI has a very simple and short script
Offline
jji7skyline wrote:
An AI is usually a very complicated script made of ifs and elses but it really depends what you need it for... my police car AI has a very simple and short script
Thanks
Offline
i can so make you an ai sample for your game! the ai has to reconize what level it is, where everything is in the level, and then you just add it to do different attacks. simpler than it sounds, possible? heck yes. have 2 variables one is player x and the other player y, apply basic gravity and platformer principles have the ai take the position of the player and reconize what path to take by having it reconize the objects around it. it then checks how to get to the player by setting way point variables. these way points will be like a jump way point, forward waypoint and backwards waypoint. if its flat terrain forget the jump way point for now. the way points will be dots that are completely ghosted. once it reaches the way points it will do a command. i can make you a projrct of this and add notes to explain it. its hard to do with just text
Offline
AI scripting is literally the hardest thing to learn but once you learn it you can create amazing things, people have made 3d fps before, no one has made a perfect AI and mine won't be perfect but i promise ill get it close
Offline
Thanks for trying to help murphofly, but it is okay, I got the AI scripting down.
Offline
Let's see, AI's are different in different games. But even the least intelligent AIs have the same needs as more intelligent and complicated ones:
1. It has to react to certain things that happen in the game, similar to what Harakou pointed out.
2. A good AI is not unbeatable. For example, if you made an AI in a Pong game, you would NOT do:
{when flag clicked} [forever] [go to [[(y position) of (Ball)]] [end]
but rather have it be inaccurate by doing something like:
[go to [[((y position) of (Ball))] + (pick random (-2) to (2)]
to make it more realistic.
AIs in different games are all a little different. If you're making a Super Smash Bros game, try to set a few scripts that make it, let's say, attack (but pick a random move each time) when the human is in front of it or move (randomly) when someone tries to attack it. (This was said by Harakou too, I believe.) And, you could add a script that could make it try to regain it's "balance" when it falls off the platform. Good luck
Last edited by a1130 (2011-08-27 18:50:00)
Offline