Darwinbots Forum
Bots and Simulations => DNA - General => Topic started by: havingphun on October 18, 2011, 08:51:11 PM
-
Well i made a bot and all i was doing was testing communication between them. But it isn't working the way i want. Could you look at it and see whats wrong. What it does is if the type is 0 it is the cell that sends a message and if it is above 0 then it receives it. Bots can only have one tie at a time for now. I used tout1 and tin1 for the communication could you please see what is wrong with this.
def type 0
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
-1 .tout1 store
stop
cond
*.tie 0 >
*.type 0 >
*.body 800 <
start
*.tiepres .readtie store
*.tin1 .shoot store
stop
cond
*.multi 1 = or
start
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
cond
*.nrg 8000 >
*.type 20000 =
start
20 .repro store
.type inc
stop
end
-
You're setting type to 0, which isn't really a valid memory location to store things into. Try setting it to, say, 50. eg: def type 50
-
Ok thanks! Ill tell you if it works.
-
I changed it to this:
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
And the other bot doesn't get bigger. Whats wrong?