Author Topic: Make your own MultiBot  (Read 4915 times)

Offline Shen

  • Bot Destroyer
  • ***
  • Posts: 111
    • View Profile
Make your own MultiBot
« on: April 18, 2005, 10:11:51 PM »
Code: [Select]
' - MultiBot Reproduction Genes -
'
' These genes will give you a 2 cell MB
' with one defined as the head and the
' other the tail. Its very basic with
' plenty of possibility for improvement.

' - The Way it Works -
'
' When a MultiBot gains enough energy to reproduce (*.nrg 5000 >), Gene 4 activates and deletes its tie.
' Now that it has no ties (*.numties 0 =), Gene 3 activates making the bot reproduce and define itself as the unfixed Tail.
' The child (*.robage 0 =) makes itself the unfixed Head and ties to its Tail.
' When the tie has hardened (*.multi 1 =), both bots align their ties.

' - Custom Variables -
' *.job is the job of that MB cell
' 1 is Head, 2 is Tail
'
' *.fixtie used for straightening the tie.
' 0 is fixed, 1 is unfixed

def job 50
def fixtie 51

' - Gene 1 -
' Fix the Tie
cond
    *.multi 1 =
    *.fixtie 1 =
start
  1 .tienum store
  628 .fixang store
  150 .fixlen store
  30 .stifftie store
  0 .fixtie store
stop

' - Gene 2 -
' Head ties to Tail and gets ready for fixing
cond
    *.robage 0 =
start
  1 .tie store
  1 .job store
  1 .fixtie store
stop

' - Gene 3 -
' Lone bot repros the Head bot and gets ready for fixing
cond
    *.numties 0 =
    *.robage 0 !=
start
  50 .repro store
  2 .job store
  1 .fixtie store
stop

' - Gene 4 -
' Start Repro Loop
cond
    *.nrg 5000 >
    *.multi 1 =
start
  1 .deltie store
stop

end
« Last Edit: September 08, 2005, 02:22:16 PM by Numsgil »

Offline Shen

  • Bot Destroyer
  • ***
  • Posts: 111
    • View Profile
Make your own MultiBot
« Reply #1 on: April 28, 2005, 03:33:46 AM »
Just an addition to the first post. This repro loop is only three genes but is more complex in the way it works and could be of less use in a real bot. But nevertheless its pretty nifty. :)

Code: [Select]
' - MultiBot Reproduction Genes -
'
' These genes will give you a 2 cell MB
' with one defined as the head and the
' other the tail. Its very basic with
' plenty of possibility for improvement.

' - The Way it Works -
'
' When a MultiBot gains enough energy to reproduce (*.nrg 5000 >), Gene 3 activates and deletes its tie.
' Now that it has no ties (*.numties 0 =), Gene 2 activates making the bot reproduce and define itself as unfixed.
' Next cycle Gene2 activates again because *.numties 0 = takes a cycle to detect the birthtie. This causes the parent to tie and program child
' When the tie has hardened (*.multi 1 =) both bots align their ties and define there jobs.

' *.job is the job of that MB cell
' 1 is Head, 2 is Tail
' -1 and -2 are used to fix the tie

def job 50

' - Gene 1 -
' Fix tie and assign jobs
cond
    *.multi 1 =
    *.job 0 <
start
  1 .tienum store
  628 .fixang store
  150 .fixlen store
  30 .stifftie store
  *.job abs .job store
stop

' - Gene 2 -
' Lone bot repros the Head and gets ready for fixing
cond
    *.numties 0 =
    *.robage 0 !=
start
  50 .repro store
  1 .tie store
  1 .tienum store
  .job .tieloc store
  -1 .tieval store
  -2 .job store
stop

' - Gene 3 -
' Start Repro Loop
cond
    *.nrg 5000 >
    *.multi 1 =
start
  1 .deltie store
stop

end
« Last Edit: September 08, 2005, 02:22:02 PM by Numsgil »

Offline spoonkiny

  • Bot Neophyte
  • *
  • Posts: 8
    • View Profile
Make your own MultiBot
« Reply #2 on: September 07, 2005, 06:53:02 PM »
huh make the coding in a different color please I cant tell what is talking and what is coding :blink:

Offline PurpleYouko

  • Bot God
  • *****
  • Posts: 2556
    • View Profile
Make your own MultiBot
« Reply #3 on: September 07, 2005, 07:04:01 PM »
Dude. It's all code apart from the first 2 lines.

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

:D PY :D

Offline Botsareus

  • Society makes it all backwards - there is a good reason for that
  • Bot God
  • *****
  • Posts: 4483
    • View Profile
Make your own MultiBot
« Reply #4 on: September 07, 2005, 07:48:41 PM »
wow, no really , the first time I was introduced to code I knew right away code is NOT ENGLISH. Everything that looks like MATH is code. Welcome anyway.

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Make your own MultiBot
« Reply #5 on: September 08, 2005, 02:21:50 PM »
Of course Bots' posts always seem like not-English to me :D