Author Topic: Multibot Vegetable  (Read 19569 times)

Offline Boris of Quirm

  • Bot Neophyte
  • *
  • Posts: 45
    • View Profile
Multibot Vegetable
« on: November 25, 2005, 10:02:33 AM »
I am in the process of designing a veggiebot that will grow in a similar fashion to a basic plant, but I was wondering if anyone has tried this before.

My current plan is to assign a value to a cell that determines whether it is a root, stem, leaf, flower or seed.  This will be done at birth and governed by who the parent is.  I am still working out the logic for this but will post my progress here as it developes.

The end plan is to have a multibot that passes food through it's roots and leafs into the rest of the plant.  A seed is then produced by the flower and this seed can then attach itself to a passing 'animal' where it can grow until it is big enough to become a stem, produce it's own root and start the process again.

If anyone has any suggestions/hints/tips/ideas/etc. they will be gratefully recieved.
Why do computer programmers celebrate Christmas at Halloween?

Because Dec 25 is equal to Oct 31!!

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Multibot Vegetable
« Reply #1 on: November 25, 2005, 11:27:34 AM »
Multibot programming is notoriously hard, generally because it's difficult to create the structure you need to program a bot, both in the DNA and in the structure of your multibot.

However, if you're willing to experiment in 2.4, you can use the *.timer to help bots decide what they're supposed to be.

*.timer is incremented every cycle, it's value automatically passed on to children, and modifiable by a bot.

Offline Boris of Quirm

  • Bot Neophyte
  • *
  • Posts: 45
    • View Profile
Multibot Vegetable
« Reply #2 on: November 25, 2005, 11:43:31 AM »
Thanks for that, I may give that a go.
Why do computer programmers celebrate Christmas at Halloween?

Because Dec 25 is equal to Oct 31!!

Offline PurpleYouko

  • Bot God
  • *****
  • Posts: 2556
    • View Profile
Multibot Vegetable
« Reply #3 on: November 25, 2005, 01:02:45 PM »
In 2.37 you can simulate this with any memory location you like. Just have a gene that increments the timer on each cycle.

Also use *.robage to determine the steps to take during the bot's first few cycles of life, or to tell it when to enter a new phase of development.

There are many ways to do this kind of thing and they are all complex but doable
There are 10 kinds of people in the world
Those who understand binary.
and those who don't

:D PY :D

Offline Boris of Quirm

  • Bot Neophyte
  • *
  • Posts: 45
    • View Profile
Multibot Vegetable
« Reply #4 on: November 25, 2005, 02:57:31 PM »
I have come up with a basic plan of attack for developing my plant.

It will take place over several versions each one slightly more complex than the last.  Initially I will not be concerned about how the bot reacts to attacks or reproduces.

[you]Version 1 - The Basic Plant[/you]

The bot has three cell types - a stem, a leaf and a flower.

A stem is the only part of the bot that can reproduce.  It can by tied to a maximum of 4 other cells.

A leaf is denoted by spinning to the left (anti-clockwise).

A flower is denoted by spinning to the right (clockwise).


[you]Version 2 - Defences and food distribution[/you]

As version 1 and :-

Stems now produce shell each turn.  This is similar to a tree producing bark.  The older a stem cell is the more bark it will have.

Leaves now pass some of their energy into the stem cell they are attached to.  They also produce poison each turn.  This will be a poisonous plant!

Flowers draw energy from the stem cell they are attached to.


[you]Version 3 - Reproduction[/you]

As version 2 and :-

While they are spinning, flowers now look for bots that are not part of the plant.  If they find one they attach to it and detach from the plant.  They now turn into a seed.

As a seed they remain with their host for a number of cycles after which they detach and turn themselves into a stem cell.

The whole growing process can now start again.


These versions are subject to change and other versions may be added at a later date depending how well these work.  Suggestions are welcome.

My goal is not to worry too much about what's eating me, as I am trying to develop a working model of a plant.

The pseudo code for version 1 will be posted up here once I have finished it, followed closely (hopefully ;) ) by the DNA.
Why do computer programmers celebrate Christmas at Halloween?

Because Dec 25 is equal to Oct 31!!

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Multibot Vegetable
« Reply #5 on: November 25, 2005, 03:10:31 PM »
Sounds really intriguing, I can't wait.  As your programming it, if you run across something you wish the DNA did that it doesn't (for isntance, nested conditions) take note of it.  One of my current pushes is to make the DNA language more intuitive and robust to both human programmers and evolution.

Offline PurpleYouko

  • Bot God
  • *****
  • Posts: 2556
    • View Profile
Multibot Vegetable
« Reply #6 on: November 25, 2005, 03:25:35 PM »
Bear in mind that once the ties harden then rotation will not be possible.
There are 10 kinds of people in the world
Those who understand binary.
and those who don't

:D PY :D

Offline Boris of Quirm

  • Bot Neophyte
  • *
  • Posts: 45
    • View Profile
Multibot Vegetable
« Reply #7 on: November 25, 2005, 04:21:01 PM »
Didn't know that about ties.

How long does it take for the tie to harden?
Is there a way of checking to see if the tie is hard or not?
Why do computer programmers celebrate Christmas at Halloween?

Because Dec 25 is equal to Oct 31!!

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Multibot Vegetable
« Reply #8 on: November 25, 2005, 04:57:42 PM »
*.multi is 1 if the bot is part of a multibot (and hence at least one tie has hardened), 0 otherwise.

Offline Boris of Quirm

  • Bot Neophyte
  • *
  • Posts: 45
    • View Profile
Multibot Vegetable
« Reply #9 on: November 25, 2005, 05:03:32 PM »
That should be ok.

The cells in version 1 are only rotating as a means of identification, so hardening shouldn't affect the overall performance of the plant.
Why do computer programmers celebrate Christmas at Halloween?

Because Dec 25 is equal to Oct 31!!

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Multibot Vegetable
« Reply #10 on: November 25, 2005, 05:07:30 PM »
2.4 doesn't lock bots when the ties harden, so they can still rotate.

Just FYI

Offline Boris of Quirm

  • Bot Neophyte
  • *
  • Posts: 45
    • View Profile
Multibot Vegetable
« Reply #11 on: November 25, 2005, 05:17:35 PM »
Once I have a working version, I'll compare how they react between different versions of the program.
Why do computer programmers celebrate Christmas at Halloween?

Because Dec 25 is equal to Oct 31!!

Offline PurpleYouko

  • Bot God
  • *****
  • Posts: 2556
    • View Profile
Multibot Vegetable
« Reply #12 on: November 25, 2005, 06:48:50 PM »
Ties take 20 cycles to harden.

I have been giving some thought to a command that keeps them flexible though
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
Multibot Vegetable
« Reply #13 on: November 25, 2005, 08:11:10 PM »
Tie physics is at the frontier of the simulation.  Meaning we're still working out various specifics with them.

Offline Boris of Quirm

  • Bot Neophyte
  • *
  • Posts: 45
    • View Profile
Multibot Vegetable
« Reply #14 on: November 26, 2005, 07:52:02 AM »
Here is the code for version 1.

Code: [Select]
'Plant ver_1.0
'(Multi-veggie-bot)
'
'The bot has three cell types - a stem, a leaf and a flower.
'
'A stem is the only part of the bot that can reproduce. It can

by tied to a maximum of 4 other cells.
'
'A leaf is denoted by spinning to the left (anti-clockwise).
'
'A flower is denoted by spinning to the right (clockwise).


'Declare plant specific variables

'Allocate Address 50 as the identifier for cell type
def type 50

'Allocate Address 51 as a count for the number of times a stem

cell has turned
def turn 51

'End of Declarations


'Gene 1 - Allocate cell type at birth
'
'NB - Value of type can be:-
'
'1 - Stem
'2 - Leaf
'3 - Flower

cond
*.type 1 <
start
2 rnd 1 add .type store
stop

'End of Gene 1


'Gene 2 - I am a leaf
'
'Show I am a leaf by spinning to the left

cond
*.type 2 =
start
10 .aimsx store
stop

'End of Gene 2


'Gene 3 - I am a flower
'
'Show I am a flower by spinning to the right

cond
*.type 3 =
start
10 .aimdx store
stop

'End of Gene 3


'Gene 4 - I am a stem part 1
'
'I am a stem.
'I have enough energy
'I can still turn
'I can't see anything
'
'As a result I will reproduce

cond
*.type 1 =
*.nrg 10000 >
*.turn 8 <
*.numties 4 <
*.eye5 40 <
start
20 .repro store
1 .tie store
stop

'End of Gene 4


'Gene 5 - I am a stem part 2
'
'I am a stem.
'I have enough energy
'I can still turn
'I can see something
'
'As a result I will just turn

cond
*.type 1 =
*.nrg 10000 >
*.turn 8 <
*.numties 4 <
*.eye5 40 >
start
314 .aimsx store
.turn inc
stop

'End of Gene 5


end

I have only tested this on it's own, so it hasn't faced predators yet.

When a new cell is born it chooses what type it is.  This means that when you start the test then it is likely that two thirds of the cells may be leaves and flowers and not grow at all.  This will be addressed in later version, so not worried about this for now.

The cells that are stems do start growing as expected, but ties aren't working properly yet.  So although you can see a cluster of cell that has leaves or flowers on the outside, you can't actually see how the 'plant' has grown as the ties are missing, but at least this proves that the cell typing process works!  I am currently working on this and hope to have a solution by the end of the day.

I will keep you posted as I progress.
« Last Edit: November 26, 2005, 07:52:46 AM by Boris of Quirm »
Why do computer programmers celebrate Christmas at Halloween?

Because Dec 25 is equal to Oct 31!!