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

#1 2008-06-29 23:11:40

deatheater
Scratcher
Registered: 2008-04-11
Posts: 1000+

can you program a learning artificial intelligence in scratch

can you program a learning artificial intelligence in scratch, couse that would be cool  smile

Offline

 

#2 2008-06-30 05:58:38

s_federici
Scratcher
Registered: 2007-12-18
Posts: 500+

Re: can you program a learning artificial intelligence in scratch

Sure you can. AI is something that works at several different levels. A simple level of (built-in) AI can be reached by using scripts and variables to store both behaviours of "intelligent" agents and things to be learned by them. A complex level of AI does instead require the possibility of storing a lot (and not pre-determined) amount of learned information. To do this you need arrays/lists and input/output to files. So... you have just to go and download the beatiful Jens' ListAndFiles hack (http://www.chirp.scratchr.org/blog/)

Offline

 

#3 2008-06-30 11:37:42

bigB
Scratcher
Registered: 2007-06-09
Posts: 100+

Re: can you program a learning artificial intelligence in scratch

an interesting learning AI would be a car that learns the best way around a track.  If it understeers it goes slower around that corner next lap etc.
i might give that a try actually.
i have a gallery for projects with AI's if you make a successful AI.

Last edited by bigB (2008-06-30 11:38:20)


http://scratch.mit.edu/projects/bigB/260981 Draw to Text
http://scratch.mit.edu/projects/bigB/181829 3D Stunt Flyer

Offline

 

#4 2008-06-30 12:57:20

fullmoon
Retired Community Moderator
Registered: 2007-06-04
Posts: 1000+

Re: can you program a learning artificial intelligence in scratch

This project has some racing AI, check it out!


http://i302.photobucket.com/albums/nn100/fullmoon32/wow.jpg

Offline

 

#5 2008-06-30 19:07:38

deatheater
Scratcher
Registered: 2008-04-11
Posts: 1000+

Re: can you program a learning artificial intelligence in scratch

fullmoon wrote:

This project has some racing AI, check it out!

hmmm... this is ok but I want a learning ai, not one that guesses  smile

Offline

 

#6 2008-07-01 04:46:02

s_federici
Scratcher
Registered: 2007-12-18
Posts: 500+

Re: can you program a learning artificial intelligence in scratch

What kind of learning were you thinking of deatheater? As I said, a complex one could need arrays (that I guess are coming with the next version, as the translation table now contains strings such as "insert %s at %i of %L" and others). But if you explaing the sort of learning you need, it may be possible to get it by just using a few variables.

Offline

 

#7 2008-07-03 17:47:29

Mayhem
Scratcher
Registered: 2007-05-26
Posts: 1000+

Re: can you program a learning artificial intelligence in scratch

In order to create this, you will need:

A random action generator
A means of telling whether a sequence of actions was successful
A means of "saving"  a sequence of succesful actions.

There was a nice AI simulator in an old robotics book I used to read, in which you simulated the learning AI of a robot "rabbit" trying to avoid a dumb robot "fox" using a pack of cards as the programmig and storage... wonder if I can remember it fully..


Web-spinning Spider:  http://scratch.mit.edu/projects/Mayhem/18456
3D Dungeon Adventure:  http://scratch.mit.edu/projects/Mayhem/23570
Starfighter X: http://scratch.mit.edu/projects/Mayhem/21825
Wandering Knight: http://scratch.mit.edu/projects/Mayhem/28484

Offline

 

#8 2008-07-08 13:29:40

Lucario621
Community Moderator
Registered: 2007-10-03
Posts: 1000+

Re: can you program a learning artificial intelligence in scratch

Mayhem wrote:

In order to create this, you will need:

A random action generator
A means of telling whether a sequence of actions was successful
A means of "saving"  a sequence of succesful actions.

There was a nice AI simulator in an old robotics book I used to read, in which you simulated the learning AI of a robot "rabbit" trying to avoid a dumb robot "fox" using a pack of cards as the programmig and storage... wonder if I can remember it fully..

I see what you mean...maybe when it did the right action, it would store it as one BIG number variable, and when the time was right to do the action, it would read the instructions in the number with http://scratch.mit.edu/projects/Mayhem/99866 , and it would repeat, getting smarter as it goes.


http://i.imgur.com/WBkM2QQ.png

Offline

 

#9 2008-07-08 14:39:59

newareagle
Scratcher
Registered: 2008-06-10
Posts: 100+

Re: can you program a learning artificial intelligence in scratch

Mayhem wrote:

In order to create this, you will need:

A random action generator
A means of telling whether a sequence of actions was successful
A means of "saving"  a sequence of succesful actions.

There was a nice AI simulator in an old robotics book I used to read, in which you simulated the learning AI of a robot "rabbit" trying to avoid a dumb robot "fox" using a pack of cards as the programmig and storage... wonder if I can remember it fully..

I made a little AI simulation that is extremely simple but still may be able to be morphed into a marter AI. I will put up the project shortly.


My Guitar Hero Game.
8/9 Projects on the Front Page at Once!

Offline

 

#10 2008-07-08 15:15:07

F18
Scratcher
Registered: 2008-07-08
Posts: 16

Re: can you program a learning artificial intelligence in scratch

Ok I just uploaded it, but its pretty simple so odn't complain  tongue  Heres the link: http://scratch.mit.edu/projects/F18/208912

Offline

 

#11 2008-07-13 23:30:11

F18
Scratcher
Registered: 2008-07-08
Posts: 16

Re: can you program a learning artificial intelligence in scratch

I just uploaded a slightly more complicated Ai. Heres the link: http://scratch.mit.edu/projects/F18/213652

Offline

 

#12 2008-07-14 01:32:45

deatheater
Scratcher
Registered: 2008-04-11
Posts: 1000+

Re: can you program a learning artificial intelligence in scratch

no offence but the second one isn't learning.

Offline

 

#13 2008-07-14 13:58:50

newareagle
Scratcher
Registered: 2008-06-10
Posts: 100+

Re: can you program a learning artificial intelligence in scratch

deatheater wrote:

no offence but the second one isn't learning.

Yes, it doesnt learn, it just knows what to do when, and then attacks you when you attack it, or you get to close. Artificial intelligence doesn't exactly mean it learns i believe, but that it has the ability to respond to its surroundings.


My Guitar Hero Game.
8/9 Projects on the Front Page at Once!

Offline

 

#14 2008-07-14 17:25:03

deatheater
Scratcher
Registered: 2008-04-11
Posts: 1000+

Re: can you program a learning artificial intelligence in scratch

newareagle wrote:

deatheater wrote:

no offence but the second one isn't learning.

Yes, it doesnt learn, it just knows what to do when, and then attacks you when you attack it, or you get to close. Artificial intelligence doesn't exactly mean it learns i believe, but that it has the ability to respond to its surroundings.

yes but the name of this topic, can u program a learning ai in scratch  smile

Offline

 

#15 2008-08-11 12:31:29

Greatdane
Scratcher
Registered: 2007-06-05
Posts: 1000+

Re: can you program a learning artificial intelligence in scratch

I was thinking of an artificial intelligence that has a preset number of codes. When it does these codes, if (in a battle game for instance) that it gets hurt, it overwrites it and writes random code again. If it sort of sucseeds, then it figures out how it died, and when, and overwrites the code again. I might make a project about it.


The future belongs to those who believe in the beauty of their dreams.
        ~ Eleanor Roosevelt

Offline

 

#16 2008-08-11 13:57:07

Bobby500
Scratcher
Registered: 2008-04-19
Posts: 1000+

Re: can you program a learning artificial intelligence in scratch

I am going to try and program a learning A1 in scratch. Lets see if I can.  smile

Offline

 

#17 2008-08-11 15:18:09

bigB
Scratcher
Registered: 2007-06-09
Posts: 100+

Re: can you program a learning artificial intelligence in scratch

Heres a learning AI I have created. http://scratch.mit.edu/projects/bigB/222253
It is a car that learns to drive around a track.


http://scratch.mit.edu/projects/bigB/260981 Draw to Text
http://scratch.mit.edu/projects/bigB/181829 3D Stunt Flyer

Offline

 

#18 2008-08-11 18:02:23

Bobby500
Scratcher
Registered: 2008-04-19
Posts: 1000+

Re: can you program a learning artificial intelligence in scratch

bigB wrote:

Heres a learning AI I have created. http://scratch.mit.edu/projects/bigB/222253
It is a car that learns to drive around a track.

I am going for a person that avoids you and the walls in a semi maze.

Offline

 

#19 2008-08-12 13:53:54

Bobby500
Scratcher
Registered: 2008-04-19
Posts: 1000+

Re: can you program a learning artificial intelligence in scratch

I made a basic mouse get to cheese and through a maze Ai. Take a look! http://scratch.mit.edu/projects/Bobby500/239173

Offline

 

Board footer