Darwinbots Forum

Bots and Simulations => Bot Tavern => Topic started by: Welwordion on November 02, 2008, 08:56:48 AM

Title: MB architecture: How do we get amoeba/fungus moving?
Post by: Welwordion 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
Title: MB architecture: How do we get amoeba/fungus moving?
Post by: bacillus 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.
Title: MB architecture: How do we get amoeba/fungus moving?
Post by: Welwordion 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.
Title: MB architecture: How do we get amoeba/fungus moving?
Post by: bacillus on November 03, 2008, 10:54:24 PM
Did you remember to put in a time delay for different cells?
Title: MB architecture: How do we get amoeba/fungus moving?
Post by: Peter 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.
Title: MB architecture: How do we get amoeba/fungus moving?
Post by: Welwordion 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.
Title: MB architecture: How do we get amoeba/fungus moving?
Post by: Peter on November 05, 2008, 11:06:23 AM
Could you briefly explain how this bot of you is supposed to work?
Title: MB architecture: How do we get amoeba/fungus moving?
Post by: Welwordion 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.
Title: MB architecture: How do we get amoeba/fungus moving?
Post by: Endy 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.
Title: MB architecture: How do we get amoeba/fungus moving?
Post by: Welwordion 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)
Title: MB architecture: How do we get amoeba/fungus moving?
Post by: Moonfisher 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....
Title: MB architecture: How do we get amoeba/fungus moving?
Post by: abyaly 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.
Title: MB architecture: How do we get amoeba/fungus moving?
Post by: Peter 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.
Title: MB architecture: How do we get amoeba/fungus moving?
Post by: bacillus 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)
Title: MB architecture: How do we get amoeba/fungus moving?
Post by: abyaly 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.
Title: MB architecture: How do we get amoeba/fungus moving?
Post by: Endy on November 09, 2008, 08:43:51 PM
You can use *.totalbots w/timer for setting the aim for an entire MB at once. They don't hunt very well but seeing a whole species simultaneously change directions is pretty impressive.
Title: MB architecture: How do we get amoeba/fungus moving?
Post by: bacillus on November 09, 2008, 11:20:41 PM
Strange, a timer-based conspec never worked because of every reading being identical...
Title: MB architecture: How do we get amoeba/fungus moving?
Post by: Endy on November 10, 2008, 10:04:51 AM
It starts at a random number between -32000 and 32000, different for each bot the first cycle. I think Eric changed it at some point. Still don't think it'd make a good conspec loc, be too easy to copy and automatically pass on to decendents.
Title: MB architecture: How do we get amoeba/fungus moving?
Post by: Peter on November 10, 2008, 11:16:53 AM
A good conspec is pretty easy made. The simplest could be storing a changing sysvar into an *out sysvar.

Just check *.refnrg with *.in1. And you have an strong conspec system.
Trying to fool a bad conspec-system by copying it is a pretty low tactic anyway.

Nice idea endy. *.totalbots is more powerful then you could see inmidiate. I gues a total-wide same sysvar like that could be used for multiple things, still thinking what that could be.
Title: MB architecture: How do we get amoeba/fungus moving?
Post by: d-EVO on November 25, 2008, 03:17:33 PM
This is a gene I used on one of my test amoebas, think it worked well. It als0 traveled in a way to cover most of the map.
I will download the bot to if you want to see how it works

Code: [Select]
cond
 *.eye5 0 =
 *.myeye *.refeye = or
 *.timer 35 >
start
 -1 .fixang store
 *.velup 20 <
 5 .up store
 dropbool
 *.timer 1256 mod %=
 20 .up store
 dropbool
stop
Title: MB architecture: How do we get amoeba/fungus moving?
Post by: Endy on November 25, 2008, 05:11:46 PM
Way cool  

I'd love to see that in action

Quote
Nice idea endy. *.totalbots is more powerful then you could see inmidiate. I gues a total-wide same sysvar like that could be used for multiple things, still thinking what that could be.

Mainly would use them for action co-ordination, for *.totalbots I just use it for aiming the whole MB in a single direction. As long as they're all facing the same way the move great.