Bots and Simulations > DNA - General

Multi-bot help

(1/4) > >>

i5524168957340:
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.

PurpleYouko:
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

i5524168957340:
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

PurpleYouko:
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

Numsgil:
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).

Navigation

[0] Message Index

[#] Next page

Go to full version