Author Topic: MB architecture: How do we get amoeba/fungus moving?  (Read 6496 times)

Offline Welwordion

  • Bot Destroyer
  • ***
  • Posts: 325
    • View Profile
MB architecture: How do we get amoeba/fungus moving?
« on: November 02, 2008, 08:56:48 AM »
Well I trieed myself on the old problem of multibot moving,trying for any amorphous mass of bots to learn crawling with ties, for some reason the condraction and extension does not activate most of the times, so as it would be really good for the new leagues that are in planning to have a first amoeba ready I thought why not make this a group work?
Everone who is interested write code to get the crawling working and post it here.

A basic structure would be: genes managing tie addresses, switching mechanism between those genes, genes to activate and deactivate movement , genes that regulate fixing and genes that regulate ties

As for my code:

Code: [Select]

def building 77
def suppotie 76
def tiecheck 75
def writpos 74
def inspect 73
def counter 72
def scout 89


'for tieaddresses
cond
*.tiecheck *.numties >
start
*.readtie 80 >=
*.readtie 80 *.tiecheck add <= and
*.trefnrg 0 = and
*.readtie .writpos store
*.writpos *.tiecheck =
*.writpos *.numties 1 add = and
*.numties .tiecheck store
dropbool
dropbool
80 *.inspect add * .readtie store
.inspect inc
*.inspect *.tiecheck >
0 .inspect store
stop


cond
*.tiepres *.suppotie !=
start
*.numties *.tiecheck >
*.numties .tiecheck store
*.numties .writpos store
dropbool
*.tiepres .suppotie store
*.tiepres 79 *.writpos add store
stop


' basic tie settings and switching between ties
cond
*.numties 0 >
start
50 .sharenrg store
80 *.robage *.numties mod add * .tienum store
500 .fixlen store
100 .stifftie store
*.robage 40 mod 0 =
'*.readtie .deltie store
stop

'a tieing gene
cond
*.numties 3 <
*.eyef 50 >
'*.refeye *.myeye =
start
*.numties 10 mult 9 rnd add .tie store
stop

'just a repro gene
cond
*.nrg 7000 >
start
200 .strbody store
50 .repro store
stop

' gene for movement activation fixing the bot that spots the food  for the contraction
cond
*.eyef 0 >
*.refeye *.myeye !=
*.scout 0 =
start
7 .scout store
1 .fixpos store
.scout .tieloc store
7 .tieval store
stop

'contraction
cond
*.scout 7 =
start
*.timer 10 mod 5 <
.scout inc
not
100 .fixlen store
.scout .tieloc store
7 .tieval store
dropbool
stop

'extension
cond
*.scout 8 =
start
800 .fixlen store
0 .fixpos store
*.timer 10 mod 9 =
0 .scout store
dropbool
stop

end

Offline bacillus

  • Bot Overlord
  • ****
  • Posts: 907
    • View Profile
MB architecture: How do we get amoeba/fungus moving?
« Reply #1 on: November 03, 2008, 01:04:23 AM »
IMO, there's only three good ways of moving a multibot, each of which rely on a stable info grid.
1-Traditional movements-this is more suited for linear bots, as getting bots to face the same way is a mightmare
2-Shortening and extending rigid ties-this may be easier, bots just shoot out if they're facing the right way
3-Turning moments-this is  by far the easiest to use and the hardest to coordinate. Bots just swing the ties around, like a big lasso, then fix in place and become the new center of rotation when they turned far enough.

The best way to coordinate movement is by using *.timer, especially when you have nonlinear structures.
"They laughed at Columbus, they laughed at Fulton, they laughed at the Wright brothers. But they also laughed at Bozo the Clown."
- Carl Sagan

Offline Welwordion

  • Bot Destroyer
  • ***
  • Posts: 325
    • View Profile
MB architecture: How do we get amoeba/fungus moving?
« Reply #2 on: November 03, 2008, 06:04:55 AM »
Quote from: bacillus
The best way to coordinate movement is by using *.timer, especially when you have nonlinear structures.

There is the problem I am doing that and for some reason it does not work, hell knows why.
Well I got it running at least sometimes here the sim.
bring some veggies near the orange bots and hope for the best, sometimes it works sometimes they bahave irregulary.
« Last Edit: November 03, 2008, 06:38:59 AM by Welwordion »

Offline bacillus

  • Bot Overlord
  • ****
  • Posts: 907
    • View Profile
MB architecture: How do we get amoeba/fungus moving?
« Reply #3 on: November 03, 2008, 10:54:24 PM »
Did you remember to put in a time delay for different cells?
"They laughed at Columbus, they laughed at Fulton, they laughed at the Wright brothers. But they also laughed at Bozo the Clown."
- Carl Sagan

Offline Peter

  • Bot God
  • *****
  • Posts: 1177
    • View Profile
MB architecture: How do we get amoeba/fungus moving?
« Reply #4 on: November 04, 2008, 03:43:04 AM »
Well I had a mulitibot behaving properly and moving with ties. I used a duo-bot woth contracting and extending ties. The actual movement was placed in 4 genes. And worked pretty efficient, really really efficient. Efficient like gaining maxvel with just ties. It worked with timecycles to extend and to relax for head and body.

Then I added stuff to make it behave right, and it went completely wrong.  
The bot loses control now. I'll try to shorten it up, and refactor it.
Oh my god, who the hell cares.

Offline Welwordion

  • Bot Destroyer
  • ***
  • Posts: 325
    • View Profile
MB architecture: How do we get amoeba/fungus moving?
« Reply #5 on: November 04, 2008, 06:02:29 AM »
Well doing it with two bots is not overall difficult I succeeded in doing that even though I did not reach maximum velocity or had ay mechansim to make the bots actually steer in one direction, as for that I failed completely when I tried to do movement based on  pivoting.

Offline Peter

  • Bot God
  • *****
  • Posts: 1177
    • View Profile
MB architecture: How do we get amoeba/fungus moving?
« Reply #6 on: November 05, 2008, 11:06:23 AM »
Could you briefly explain how this bot of you is supposed to work?
Oh my god, who the hell cares.

Offline Welwordion

  • Bot Destroyer
  • ***
  • Posts: 325
    • View Profile
MB architecture: How do we get amoeba/fungus moving?
« Reply #7 on: November 05, 2008, 05:19:03 PM »
The above bot? Well it alternates between ties(if that works correctly) when one bot sees food it starts  contraction and tell the bot its currently addressing to do the same (scout is set to 7) with the tiny difference that the bot who actuall sees food fixes itself(well its supposed to).
When the timer condition is met each bot that contracted, executes extension(scout is set to 8) and if the final timer condition is met it returnes to its original state(scout is set to zero).

Edit: for anyone who read that before sorry I did put the specific line in.
« Last Edit: November 06, 2008, 06:26:43 AM by Welwordion »

Offline Endy

  • Bot Overlord
  • ****
  • Posts: 852
    • View Profile
MB architecture: How do we get amoeba/fungus moving?
« Reply #8 on: November 06, 2008, 11:01:47 AM »
Will readtie is one of the issues, it's not needed anymore, only .tienum.

Not sure if it matters for your bot or not but for a species wide timer you need to set it on the first cycle. Normally I'll just use something like:

cond
start
0 .timer store
.delgene inc
stop

It seems to work once it gets to high enough numbers of joined bots, though they have to be moved around abit to make it start.

The actual code for ties seems to be working oddly. Inchworm2 still seems to be working correctly, I'm thinking it's caused by how it divides the control for the head and tail, still not sure though.
« Last Edit: November 06, 2008, 11:12:10 AM by Endy »

Offline Welwordion

  • Bot Destroyer
  • ***
  • Posts: 325
    • View Profile
MB architecture: How do we get amoeba/fungus moving?
« Reply #9 on: November 06, 2008, 07:09:37 PM »
Well it certainly seems to work better when I use tienum instead of readtie  the deltie part worked a little bit too good soIi had to deactiate it)

Offline Moonfisher

  • Bot Overlord
  • ****
  • Posts: 592
    • View Profile
MB architecture: How do we get amoeba/fungus moving?
« Reply #10 on: November 08, 2008, 04:54:36 AM »
Just a note :
.timer is a used sysvar name... I guess if you defined it then it'll probably use the location you gave it, but just thought I'd mention it.
.timer is just a global timer for the entire sim... think it counts down from 32000 then starts over at 0....

Offline abyaly

  • Bot Destroyer
  • ***
  • Posts: 363
    • View Profile
MB architecture: How do we get amoeba/fungus moving?
« Reply #11 on: November 08, 2008, 10:10:54 AM »
Quote from: Moonfisher
Just a note :
.timer is a used sysvar name... I guess if you defined it then it'll probably use the location you gave it, but just thought I'd mention it.
.timer is just a global timer for the entire sim... think it counts down from 32000 then starts over at 0....
Timer is not a global timer for the entire sim. It is a memory location inside of each bot that is automatically incremented each cycle and passed to offspring. On sim start, each bot gets a random (and IIRC, sometimes negative) value for timer.
Lancre operated on the feudal system, which was to say, everyone feuded all
the time and handed on the fight to their descendants.
        -- (Terry Pratchett, Carpe Jugulum)

Offline Peter

  • Bot God
  • *****
  • Posts: 1177
    • View Profile
MB architecture: How do we get amoeba/fungus moving?
« Reply #12 on: November 08, 2008, 10:52:33 AM »
Ah there is found one bit found wrong. A wrong timer could really give your problems. I never used timers so I didn't see it.

Still I don't see any difference with how it behaved before if I set the starter bot timer at zero.


I just looked at the timer. And t seems to give a random number at start between -32000 and 32000. So often the half of the timer is negative.
Oh my god, who the hell cares.

Offline bacillus

  • Bot Overlord
  • ****
  • Posts: 907
    • View Profile
MB architecture: How do we get amoeba/fungus moving?
« Reply #13 on: November 08, 2008, 03:34:47 PM »
It does seem to work with me, but I did notice the random start time as well. So even though it's random, each bot starts off with the same value (could be useful for a simulation-protective bot)
"They laughed at Columbus, they laughed at Fulton, they laughed at the Wright brothers. But they also laughed at Bozo the Clown."
- Carl Sagan

Offline abyaly

  • Bot Destroyer
  • ***
  • Posts: 363
    • View Profile
MB architecture: How do we get amoeba/fungus moving?
« Reply #14 on: November 08, 2008, 10:31:47 PM »
Quote from: bacillus
So even though it's random, each bot starts off with the same value
This is not the case.
Lancre operated on the feudal system, which was to say, everyone feuded all
the time and handed on the fight to their descendants.
        -- (Terry Pratchett, Carpe Jugulum)