Bots and Simulations > DNA - General

multibot?

<< < (3/3)

MrMound:
I think I will try a two bot line first.  I have already tried more than 2 bot and I think 2 bots will be pleanty for starters :)

MrMound:
1 thing how do you get all the bots in your multi bot to go the same direction.  mine die because they all try do go differant directions

Light:
Okay if you want both bots in a 2 cell multibot to be in the same direction, you want something like this


--- Code: ---' Child ties to parent
cond
  *.robage 0 =
  *.eye5 70 >
start
  1 .tie store
  3 950 store
stop

' Lone bot reproduces
cond
  *.numties 0 =
  *.eye5 40 <
  *.nrg 500 >
start
  50 .repro store
  2 950 store
stop

' Child aligns as LHS
cond
  *950 3 =
start
  1 .tienum store
  314 .fixang store
  240 .fixlen store
  35 .stifftie store
  1 950 store
stop

' Parent aligns as RHS
cond
  *.multi 1 =
  *950 2 =
start
  1 .tienum store
  -314 .fixang store
  0 950 store
stop
--- End code ---

with this you can also identify each bot as the LHS has 0 in 950 and the RHS has 1, this allows you to tailor genes to a specific bot.  But with both bots facing forward you have to decide how they will turn and move.

An alternative that is common is replacing

       314 .fixang store in genes 3 + 4
with
       614 .fixang store

This will make it so that both bots are facing away from each other, then have one bot doing all the moving, draging the other bot behind it.

PurpleYouko:
Check out Hexagonis
I think it is probably the most complex consistently forming MB that has been made to date. I managed to get it to form a perfect hexagon with all the robots facing outwards.

PurpleYouko:
One thing to always aim for is to define one robot as the "head".

Just use a custom variable or something.

def head 50

would work. Then use conditions with head to make sure that only the real head is able to move.

Navigation

[0] Message Index

[*] Previous page

Go to full version