Author Topic: Almost working bot!  (Read 3209 times)

Offline jknilinux

  • Bot Destroyer
  • ***
  • Posts: 468
    • View Profile
Almost working bot!
« on: November 17, 2008, 12:47:23 AM »
Hi,

I'm trying to (finally) make my own bot, but I can't get OCULUS II to work in Animal Minimalis... Here's what I have so far:

[div class=\'codetop\']CODE[div class=\'codemain\' style=\'height:200px;white-space:pre;overflow:auto\']'Animal_Minimalis

'Contains everything necessary for it
'to survive and reproduce.

cond
*.eyef 0 =
start
-4 *.eye1 *.eye9 sub sgn 0 floor mult *.eye1 *.eye8 sub sgn 0 floor mult *.eye1 *.eye7 sub sgn 0 floor mult *.eye1 *.eye6 sub sgn 0 floor mult *.eye1 *.eye5 sub sgn 0 floor mult *.eye1 *.eye4 sub sgn 0 floor mult *.eye1 *.eye3 sub sgn 0 floor mult *.eye1 *.eye2 sub sgn 0 floor mult 4 *.eye9 *.eye8 sub sgn 0 floor mult *.eye9 *.eye7 sub sgn 0 floor mult *.eye9 *.eye6 sub sgn 0 floor mult
*.eye9 *.eye5 sub sgn 0 floor mult *.eye9 *.eye4 sub sgn 0 floor mult *.eye9 *.eye3 sub sgn 0 floor mult *.eye9 *.eye2 sub sgn 0 floor mult *.eye9 *.eye1 sub sgn ++ sgn mult add -3 *.eye2 *.eye9 sub sgn ++ sgn mult *.eye2 *.eye8 sub sgn 0 floor mult *.eye2 *.eye7 sub sgn 0 floor mult *.eye2 *.eye6 sub sgn 0 floor mult *.eye2 *.eye5 sub sgn 0 floor mult *.eye2 *.eye4 sub sgn 0 floor mult *.eye2 *.eye3 sub sgn 0 floor mult *.eye2 *.eye1 sub sgn ++ sgn mult add 3 *.eye8 *.eye9 sub sgn ++ sgn mult *.eye8 *.eye7 sub sgn 0 floor mult *.eye8 *.eye6 sub sgn 0 floor mult *.eye8 *.eye5 sub sgn 0 floor mult *.eye8 *.eye4 sub sgn 0 floor mult *.eye8 *.eye3 sub sgn 0 floor mult *.eye8 *.eye2 sub sgn ++ sgn mult *.eye8 *.eye1 sub sgn ++ sgn mult add -2 *.eye3 *.eye9 sub sgn ++ sgn mult *.eye3 *.eye8 sub sgn ++ sgn mult *.eye3 *.eye7 sub sgn 0 floor mult *.eye3 *.eye6 sub sgn 0 floor mult
*.eye3 *.eye5 sub sgn 0 floor mult *.eye3 *.eye4 sub sgn 0 floor mult *.eye3 *.eye2 sub sgn ++ sgn mult *.eye3 *.eye1 sub sgn ++ sgn mult add 2 *.eye7 *.eye9 sub sgn ++ sgn mult *.eye7 *.eye8 sub sgn ++ sgn mult *.eye7 *.eye7 sub sgn 0 floor mult *.eye7 *.eye6 sub sgn 0 floor mult *.eye7 *.eye5 sub sgn 0 floor mult *.eye7 *.eye4 sub sgn ++ sgn mult *.eye7 *.eye2 sub sgn ++ sgn mult *.eye7 *.eye1 sub sgn ++ sgn mult add -1 *.eye4 *.eye9 sub sgn ++ sgn mult *.eye4 *.eye8 sub sgn ++ sgn mult *.eye4 *.eye7 sub sgn ++ sgn mult *.eye4 *.eye6 sub sgn 0 floor mult *.eye4 *.eye5 sub sgn 0 floor mult *.eye4 *.eye3 sub sgn ++ sgn mult *.eye4 *.eye2 sub sgn ++ sgn mult *.eye4 *.eye1 sub sgn ++ sgn mult add 1 *.eye4 *.eye9 sub sgn ++ sgn mult *.eye4 *.eye8 sub sgn ++ sgn mult *.eye4 *.eye7 sub sgn ++ sgn mult *.eye4 *.eye6 sub sgn ++ sgn mult *.eye4 *.eye5 sub sgn 0 floor mult
*.eye4 *.eye3 sub sgn ++ sgn mult *.eye4 *.eye2 sub sgn ++ sgn mult *.eye4 *.eye1 sub sgn ++ sgn mult add 0 *.eye5 *.eye9 sub sgn ++ sgn mult *.eye5 *.eye8 sub sgn ++ sgn mult *.eye5 *.eye7 sub sgn ++ sgn mult *.eye5 *.eye6 sub sgn ++ sgn mult *.eye5 *.eye4 sub sgn ++ sgn mult *.eye5 *.eye3 sub sgn ++ sgn mult *.eye5 *.eye2 sub sgn ++ sgn mult *.eye5 *.eye1 sub sgn ++ sgn mult add .focuseye store
*.refxpos *.refypos angle .setaim 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
*.refveldx .dx store
*.refvelup .up store
stop

cond
*.refeye *.myeye =
start
-2 .shoot store
314 rnd .aimdx store
stop

cond
*.nrg 20000 >
start
10 .repro store
stop
end

Any help? Thanks!
« Last Edit: November 17, 2008, 01:57:16 AM by jknilinux »

Offline peterb

  • Bot Destroyer
  • ***
  • Posts: 148
    • View Profile
Almost working bot!
« Reply #1 on: November 17, 2008, 05:35:13 PM »
okay, I cannt check the huge vison command line.
But basicly I think the problem is there no reason for it to go upward.
Unless it detects something.

So you do good on energy reservation, but I gues you rather like to see it moving.
you might add a gene
for example

Cond
start
10 .up store
stop

Thats right no condition check this always runs.
If you dont want that you might put in a condition to stop let gowing it up.
For example

Cond
*.myeye *.refeye !=
start
10 .up store
else
300 rnd .aim store
stop

   this will move forward unless it sees family, then it wil do a a small random rotation adjustment.



You know some 1G bots here can do everything with no conditions set.
But its up to you to invent conditions to get intresting bots and to let us now

Offline bacillus

  • Bot Overlord
  • ****
  • Posts: 907
    • View Profile
Almost working bot!
« Reply #2 on: November 17, 2008, 06:46:55 PM »
I could imagine the *.refeye *.myeye = gene not working, as it does not check from which eye the data is coming from. Remember that OCULUS tells the bot which eye to focus on, it does not focus the eye itself, so there's a 1-cycle lag. Irritating isn't it?
"They laughed at Columbus, they laughed at Fulton, they laughed at the Wright brothers. But they also laughed at Bozo the Clown."
- Carl Sagan

Offline abyaly

  • Bot Destroyer
  • ***
  • Posts: 363
    • View Profile
Almost working bot!
« Reply #3 on: November 20, 2008, 06:59:27 PM »
While oculus may be an efficient eye algorithm, I think it's more important to use something simple so that you can understand as much of your code as possible when debugging your bot. When I make new bots, I usually use just eye5 vision and have them rotate to look for food at first. Then I swap that for more complicated behavior once I have a working model.
Lancre operated on the feudal system, which was to say, everyone feuded all
the time and handed on the fight to their descendants.
        -- (Terry Pratchett, Carpe Jugulum)

Offline jknilinux

  • Bot Destroyer
  • ***
  • Posts: 468
    • View Profile
Almost working bot!
« Reply #4 on: November 20, 2008, 07:38:26 PM »
Thanks for the help!
I'll get back to this once I finish my pollinator.