Author Topic: Multi-bot help  (Read 8109 times)

Offline i5524168957340

  • Bot Neophyte
  • *
  • Posts: 6
    • View Profile
Multi-bot help
« on: February 24, 2005, 11:05:34 AM »
Hi this is my first post, and I need help. Im trying to get a line of robots all tied together   where the ends reproduce and the bots in between are facing ither to the left or the right. So far I have just had them fire a tie at birth and then had them change the tie ang but I always end up with a clump of bots rather than a line. I dont think im using the tie orientation call right. I dont have any code worth improving I am just looking for suggestions on how to go about this.  I already tryed to take some ideas from bots like inch worm but it didnt work to well.

Offline PurpleYouko

  • Bot God
  • *****
  • Posts: 2556
    • View Profile
Multi-bot help
« Reply #1 on: February 24, 2005, 11:38:41 AM »
Hi and welcom to DarwinBots. I presume that you must have been around the game for some time as you are trying to create MBs.

The secret is to time everything using *.robage.

In your case you would want to start off with a gene that fires a tie at age zero, then work from there.

At age one you need to rotate your robot 180 degrees by placing a value of 628 into eithe aimsx or aimdx.

At age 2 make it reproduce

At age 3 (Or later. See notes further down) we now need it to turn either left or right. This is the tricky bit. The questions you need to ask yourself are
1 how does the robot know which way to go?
2 Is it random?
3 do you want alternating left/right?

The best way to make a random left right 90 degree spin is to make a gene that activates at age 3 to store a random value (1 or 2) into a memory location. You can then use this value to determine left or right in another gene

If you want alternate left/right then you have to use the mother robot to physically place a value into the baby robot's memory via the tie. let's say if (mother's) memory location 60 contains zero (default at start of game) then she will program the baby with a one at position 60 while she is at age 4 or 5 (to give the young one long enough to make his tie)
If mem(60) = 1 then program the young with zero (or don't do anything. Has the same effect)

This way the young  can rotate either left or right depending on the value in his mem(60)

remember to make sure that the young one has recieved his programming before he rotates.

90 degree rotation = aimsx/aimdx value of 314.

Hope this helps. Let me know if you are still having trouble and I will write you up a brief DNA file to do this.

 :D  PY  :D
There are 10 kinds of people in the world
Those who understand binary.
and those who don't

:D PY :D

Offline i5524168957340

  • Bot Neophyte
  • *
  • Posts: 6
    • View Profile
Multi-bot help
« Reply #2 on: February 24, 2005, 11:40:40 AM »
ok I have some code that relates to my problem in an idirect way its only about 1/3 done. my plan is creating a bot that swims around eating and when it reproduces drops of "sinkers" that fall to the bottom. Ok I have that done. He sometimes makes sinkers sometimes makes swimmers. NOW what im trying to do is have all the sinkers reproduce "floaters" that are linked to the sinker base and reach upward. Im hoping to make the floaters a feeding arms or something. My goal is to create something like a half plant half animal. The swimmers swimaround dropping seeds for stalks to grow and comsume. Right now the seeds just sink.  OK here is the code.

' sink or swim
'by i55-Peter

'determine your place
cond
*.robage 0 =
start
1 rnd 55 store
stop

'sink
cond
*.rdboy -2000 !=
*55 0 =
start
-2000 .setboy store
stop

'search
cond
*55 1 =
*.refeye *.myeye !=
*.eye4 *.eye6 !=
start
*.eye6 *.eye4 sub .aimdx store
stop

'turn from edge
cond
*55 1 =
*.edge 1 =
start
120 .aimdx store
stop

'avoid cons
cond
*55 1 =
*.refeye *.myeye =
*.eye5 30 >
start
120 .aimdx store
stop

'swim
cond
*55 1 =
*.vel 40 <
*.eye5 70 <
start
0 .fixpos store
40 *.vel sub .up store
stop

'attack
cond
*55 1 =
*.eye5 30 >
*.refeye *.myeye !=
start
-1 .shoot store
stop

'stop and feed- borrowed from
'Bot reproductio
' by Henk

cond
*55 1 =
*.eye5 38 >
*.refeye *.myeye !=
*.fixed 0 =
start
.fixpos inc
stop

'had a problem with sinkers fixing...bug?
cond
*55 0 =
*.fixpos 0 !=
start
0 .fixpos store
stop

'repro
cond
*55 1 =
*.nrg 3000 >
start
50 .repro store
stop

end

Offline PurpleYouko

  • Bot God
  • *****
  • Posts: 2556
    • View Profile
Multi-bot help
« Reply #3 on: February 24, 2005, 11:43:49 AM »
Very ambitious.

Good luck. It will be great if you succeed.

I will check it out when I have the chance. Bit busy right now.

 :D  PY  :D
There are 10 kinds of people in the world
Those who understand binary.
and those who don't

:D PY :D

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Multi-bot help
« Reply #4 on: February 24, 2005, 02:25:19 PM »
Gotta love your name, I[several thousand digits].

 :lol:

Can you post a picture of what you want your bot to do?  I'm a visual learner.  (You can use image shack to host it).

Offline PurpleYouko

  • Bot God
  • *****
  • Posts: 2556
    • View Profile
Multi-bot help
« Reply #5 on: February 24, 2005, 02:28:33 PM »
Prob'ly would have posted as a guest if they were allowed to start threads.

There is reason in my madness  :blink:

More members this way and not so many anonymous lurkers.

 :D  PY  :D
There are 10 kinds of people in the world
Those who understand binary.
and those who don't

:D PY :D

Offline PurpleYouko

  • Bot God
  • *****
  • Posts: 2556
    • View Profile
Multi-bot help
« Reply #6 on: February 24, 2005, 02:32:56 PM »
Just had a thought.

I suppose this robot is designed for PondMode, Right?

Can't very well sink in a torroidal sim can we?

 :rolleyes:  PY  :rolleyes:
There are 10 kinds of people in the world
Those who understand binary.
and those who don't

:D PY :D

Offline i5524168957340

  • Bot Neophyte
  • *
  • Posts: 6
    • View Profile
Multi-bot help
« Reply #7 on: February 24, 2005, 05:53:05 PM »
it needs the pond otherwise its compleatly usless.

Offline i5524168957340

  • Bot Neophyte
  • *
  • Posts: 6
    • View Profile
Multi-bot help
« Reply #8 on: February 24, 2005, 06:09:09 PM »


here is an image as you can see it is the best picture ever

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Multi-bot help
« Reply #9 on: February 24, 2005, 06:35:45 PM »
Awesome.

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Multi-bot help
« Reply #10 on: February 24, 2005, 11:19:59 PM »
This is another example of where chromosomes that can be turned on/off would come in handy.

I might just yet get around to it all.

Offline i5524168957340

  • Bot Neophyte
  • *
  • Posts: 6
    • View Profile
Multi-bot help
« Reply #11 on: February 25, 2005, 10:07:05 AM »
why would chromosomes be any better than just using the various memory locations?

Offline PurpleYouko

  • Bot God
  • *****
  • Posts: 2556
    • View Profile
Multi-bot help
« Reply #12 on: February 25, 2005, 10:24:18 AM »
The chromosomes would be used as separators so that each block of DNA can be contained in a separate chromosome.

For example, all the rotation commands could be in one and all the reproductive stuff in another.
Then we can simply disable a particular chromosome as a part of a Multi-Bot attempts to specialize in a certain function, thus saving it a lot of wasted energy.

It has nothing to do with memory locations.

 :D  PY  :D
There are 10 kinds of people in the world
Those who understand binary.
and those who don't

:D PY :D

Offline i5524168957340

  • Bot Neophyte
  • *
  • Posts: 6
    • View Profile
Multi-bot help
« Reply #13 on: February 25, 2005, 10:30:26 AM »
ahhh ok... well what you could do is just delete the genes that your not using once you've detrmined the bots function.  Also isnt their a command that gives back a value based on the angle to the top of the screen or did I just imagine that? Because it would be usfull...

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Multi-bot help
« Reply #14 on: February 25, 2005, 11:34:40 AM »
*.aim -314 add

That should give you angle from the top.