1
Newbie / Re: Hello! (I also need help with some code)
« on: May 25, 2012, 04:23:06 PM »
Hi Ravenplucker. Don't I know you from the algodoo forums?
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
This is for the graphics engine, actually.
And I'll probably use it for shapes in the simulation, so that bots can tunnel in to them and form ant nests.
50 *.sharenrg store
*.refxpos *.refypos add .setaim store
def head 50
def body 51
def cantie 52
cond
*.robage 0 =
start
head 0 =
body 0 =
cantie 0 =
stop
cond
*.robage 0 >
*.head 0 =
*.body 0 >
*.body 0 = or
*.numties 2 =
start
.cantie inc
.body inc
stop
cond
*.robage 0 >
start
*.head .tout5 store
*.body .tout6 store
*.cantie .out1
stop
cond
*.eye5 0 >
*.refeye *.myeye !=
*.head 0 >
*.multi 1 =
*.numties 2 =
start
*.refveldx .dx store
*.refvelup 30 add .up store
*.refxpos *.refypos angle .setaim store
stop
cond
*.eye5 50 >
*.refeye *.myeye !=
*.head 0 !=
*.multi 1 =
*.numties 2 =
start
-1 .shoot store
*.refvelup 30 add .up store
*.refxpos *.refypos angle .setaim store
stop
cond
*.multi 1 =
*.head 0 !=
*.eye5 0 =
*.refeye *.myeye = or
start
314 .aimdx store
stop
cond
*.numties 0 =
*.robage 20 >
*.head 0 =
*.tienum 3 <
start
33 .repro store
.tienum inc
.head inc
stop
cond
*.numties 1 =
*.robage 0 >
*.body 0 >
*.body 0 = or
*.tout5 0 >
start
32 .repro store
.body inc
stop
cond
*.refeye *.myeye =
*.myeye 0 =
*.numties 2 =
*.robage 0 >
*.in1 0 >
*.body 0 >
*.body 0 = or
*.head 0 =
start
.tie inc
.tienum inc
.body inc
stop
cond
*.robage 0 =
*.body 0 =
*.head 0 =
start
.body inc
.tie inc
stop
cond
*.nrg 30000 >
*.body 0 !=
*.head 0 != or
start
0 .body store
1 .head store
.tienum 0 =
.deltie inc
stop
cond
*.multi 1 =
*.head 1 = and
start
*.eye5 .tout1 store
50 .sharenrg store
3 .fixlen store
100 .stifftie store
628 .fixang store
*.aimdx .tout8 store
*.up .tout7 store
*.aim .tout2 store
*.head .tout3 store
*.tienum .tout4 store
stop
cond
*.robage 20 >
*.head 0 =
*.body 1 =
start
*.tiepres .readtie store
*.tout8 .aimdx store
*.tin7 .up store
*.tin1 .eye5 store
*.tin2 .setaim store
*.tin4 .tienum store
stop
cond
*.head 1 =
*.body 1 = or
*.numties 2 >
start
*.tiepres .deltie store
stop
end
Have you debugged if the .head and .body locations are changing values?
I didn't see anything obviously wrong but it's hard enough to debug DNA code you've written, let along DNA code someone else wrote.
You might also look at the DNA in the program and make sure it matches with the DNA text file to make sure there aren't any typos.
hmm first *.tienum < 3 --> *.tienum 3 <
Second Maybe i just overlooked it, but I have not seen anywhere where you specify the tailbot to match the heads speed.
*.tin2 .aimright store <-- direction but not speed, also aimright means turning acertain amount right based on the direction your bots currently facing its not independent of robot orientation like aim. (so bad if your tail looks elsewhere)
*.tin1 .eye5 store <-- maybe I am wrong but I think the refreshing of sensory variables is done pretty early in the turn and as this store command is almost at the end of the code is the changed eyevalue even read by something?
modified:
I think once the tie is hardened the angle might not only be fixed for the head but also the tail(again not 100% sure)
if thats so any attempt to turn would result in the tie working like a lever.
def head 50
def body 51
cond
*.eye5 0 >
*.refeye *.myeye !=
*.head 0 !=
*.multi 1 =
start
*.refveldx .dx store
*.refvelup 30 add .up store
*.refxpos *.refypos angle .setaim store
stop
cond
*.eye5 50 >
*.refeye *.myeye !=
'*.refeye *.myeye !=
*.head 0 !=
*.multi 1 =
start
-1 .shoot store
*.refvelup .up store
*.refxpos *.refypos angle .setaim store
stop
cond
*.multi 1 =
*.head 0 !=
*.eye5 0 =
*.refeye *.myeye = or
start
314 rnd .aimdx store
stop
cond
*.numties 0 =
*.numties 1 = or
*.robage 0 !=
*.head 0 =
*.tienum < 3
start
32 .repro store
.tienum inc
.head inc
stop
cond
*.robage 0 =
*.body 0 =
*.head 0 =
start
.body inc
.tie inc
stop
cond
*.nrg 30000 >
*.body 0 !=
*.head 0 != or
start
.body dec
.head inc
.tienum 0 =
.deltie inc
stop
cond
*.multi 1 =
*.head 1 = and
start
*.eye5 .tout1 store
50 .sharenrg store
3 .fixlen store
100 .stifftie store
628 .fixang store
*.aimright .tout2 store
*.head .tout3 store
*.tienum .tout4 store
stop
cond
*.head 0 =
*.body1 0 = or
start
*.tiepres .readtie store
*.tin1 .eye5 store
*.tin2 .aimright store
*.tin4 .tienum store
stop
cond
*.head 1 =
*.body 1 = or
*.numties 2 >
start
*.tiepres .deltie store
stop
end
def type 50
cond
*.type 0 =
*.nrg 4000 >
start
25 .repro store
.type inc
stop
cond
*.refeye *.myeye =
*.numties 1 <
start
.tie inc
stop
cond
*.numties 1 >
start
*.tiepres .deltie store
stop
cond
*.robage 0 =
*.type 1 <
start
200 .tout1 store
stop
cond
*.tie 0 >
*.type 0 >
*.body 800 <
start
*.tiepres .readtie store
*.tin1 .body store
stop
cond
*.eye5 0 >
*.refeye *.myeye !=
start
*.refveldx .dx store
*.refvelup 30 add .up store
stop
cond
*.eye5 50 >
*.refeye *.myeye !=
start
-1 .shoot store
*.refvelup .up store
stop
cond
*.eye5 0 =
*.refeye *.myeye = or
start
314 rnd .aimdx store
stop
'Made it have a difficult condition just so its disabled for testing
cond
*.nrg 8000 >
*.type 20000 =
start
20 .repro store
.type inc
stop
end