I'm making a program where the key object "Learns", I'm unsure of how I should make it do that. It's already got the AI wandering, and collision where the object turns away when it hits an object, but It would be better if it could hit an object once, and then avoid the object after it knows that it's there, sort of like a baby!
I'd be grateful if you could give me any advice on how to do this, and maybe other ideas for what it should learn!
Here's the code:
hide mouse
randomize timer()
make object sphere 1,50
make object sphere 2,100
make matrix 1,5000,5000,20,20
position object 2,2600,0,2600
position object 1,2500,0,2500
make object box 3,5000,500,20
position object 3,2500,250,0
make object box 4,5000,500,20
position object 4,2500,250,5000
make object box 5,20,500,5000
position object 5,0,250,2500
make object box 6,20,500,5000
position object 6,5000,250,2500
make object cube 7,200
position object 7,3000,0,2600
make object cube 8,100
position object 8,3300,0,2300
make object cube 9,300
position object 9,2400,0,3500
make object cube 10,200
position object 10,3700,0,2900
make object cube 11,100
position object 11,3800,0,2000
make object cube 12,300
position object 12,3700,0,3900
make object cube 13,200
position object 13,1700,0,2900
make object cube 14,400
position object 14,1500,0,1900
make object cube 15,500
position object 15,3700,0,1500
close=0
hit=0
hit2=0
hit3=0
hit4=0
hit5=0
hit6=0
hit7=0
hit8=0
hit9=0
hit10=0
hit11=0
hit12=0
hit13=0
hit14=0
cubeq=0
set camera range 1,9999999999999999999999999999999999999999
position camera 2400,300,2400
do
hit=object hit(1,2)
if hit=1 then turn object left 1,-5
hit2=object hit(1,3)
if hit2=1 then turn object left 1,-5
hit3=object hit(1,4)
if hit3=1 then turn object left 1,-5
hit4=object hit(1,5)
if hit4=1 then turn object left 1,-5
hit5=object hit(1,6)
if hit5=1 then turn object left 1,-5
hit6=object hit(1,7)
if hit6=1 then turn object left 1,-5
hit7=object hit(1,8)
if hit7=1 then turn object left 1,-5
hit8=object hit(1,9)
if hit8=1 then turn object left 1,-5
hit9=object hit(1,10)
if hit9=1 then turn object left 1,-5
hit10=object hit(1,11)
if hit10=1 then turn object left 1,-5
hit11=object hit(1,12)
if hit11=1 then turn object left 1,-5
hit12=object hit(1,13)
if hit12=1 then turn object left 1,-5
hit13=object hit(1,14)
if hit13=1 then turn object left 1,-5
hit14=object hit(1,15)
if hit14=1 then turn object left 1,-5
move=rnd(3000)
if move=<1000 then move object 1,0.2
if move=<2000 and move=>1000 then turn object right 1,2.5
if move=<3000 and move=>2000 then turn object left 1,2.5
point camera object position x(1),object position y(1),object position z(1)
position camera object position x(1),object position y(1)+300,object position z(1)-300
cy#=wrapvalue(cy#+mousemovex()*0.08)
acy#=curveangle(cy#,acy#,1)
yrotate camera acy#
cx#=wrapvalue(cx#+mousemovey()*0.08)
acx#=curveangle(cx#,acx#,1)
xrotate camera acx#
loop
Thanks!