This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2011-10-08 14:55:41

Garr8
Scratcher
Registered: 2011-08-10
Posts: 1000+

creating ai

ive had this issue for awhile, how do u make AI. Im doing 2 games with AI.
Supersmash bros and pong. How do i make AI for these games


What I scored on Pokemon Quiz: Porygon

Offline

 

#2 2011-10-08 15:40:17

LordAwesome123
Scratcher
Registered: 2011-01-18
Posts: 100+

Re: creating ai

What is AL?


http://i672.photobucket.com/albums/vv82/coke457/cooltext538978807.png
When life gives you lemons... take them... free stuff is cool  smile

Offline

 

#3 2011-10-08 17:59:14

juliabrookek
Scratcher
Registered: 2011-07-18
Posts: 100+

Re: creating ai

Artificial Intelligence i think.


smile http://dragcave.net/image/rgNE5.gif smile

Offline

 

#4 2011-10-08 18:24:13

henley
Scratcher
Registered: 2008-06-21
Posts: 1000+

Re: creating ai

LordAwesome123 wrote:

What is AL?

It’s not AL, it’s AI

not L, not i, and not l.

It stands for Artificial Intelligence.


"I've worked so hard for you and you give me nothing in return. Do you need help... Or do I?"

Offline

 

#5 2011-10-09 00:02:47

kodarr
New Scratcher
Registered: 2011-10-02
Posts: 18

Re: creating ai

For simple AI in a program just use if statements and check if certain conditions are met then the enemy responds by doing something.  Or you can even have multiple things the enemy may do depending on a random number.
Like if Monster hits a wall and player is between certain values of x then turn towards the player else change direction 180 and move away or something similar.

Offline

 

#6 2011-10-09 01:18:18

MoreGamesNow
Scratcher
Registered: 2009-10-12
Posts: 1000+

Re: creating ai

It depends entirely upon what you want to do.  Pong could be done simply by pointing up if the ball is higher than the paddle and down if it is below the paddle, and moving _ number of steps.  A Supersmash Bros  AI would be much more difficult.  I can only tell you one thing: if you want a good AI, you'll be using LOTS of if-statements and if-else-statements.


http://images2.layoutsparks.com/1/218929/rubiks-cube-animated-rotating.gif
"Cogito ergo sum" --  I think, therefore I am

Offline

 

#7 2011-10-09 08:02:23

Garr8
Scratcher
Registered: 2011-08-10
Posts: 1000+

Re: creating ai

thx


What I scored on Pokemon Quiz: Porygon

Offline

 

#8 2011-10-09 16:16:27

maxskywalker
Scratcher
Registered: 2008-01-27
Posts: 1000+

Re: creating ai

Well, it's really hard.  I've found that in turn-based games, things like 'set var to (random (1, 10)); forever if var < 6: attack; forever if var > 5 and < 9: cast spell; forever if var > 8: block;'.  I used that sort of thing in a few games (in Python, not on Scratch).  While not practical for all uses, I believe the concept is clear.  Each semicolon ( wink  marks the end of a group of blocks, in case you didn't know.

Offline

 

#9 2011-10-09 16:39:25

Garr8
Scratcher
Registered: 2011-08-10
Posts: 1000+

Re: creating ai

do you know of any games like the ones ive mentioned that has those scripts to download


What I scored on Pokemon Quiz: Porygon

Offline

 

Board footer