Author Topic: Ambitious MB project  (Read 15881 times)

Offline bacillus

  • Bot Overlord
  • ****
  • Posts: 907
    • View Profile
Ambitious MB project
« Reply #30 on: January 14, 2010, 10:53:36 PM »
Sweet as, you do that.
"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 Houshalter

  • Bot Destroyer
  • ***
  • Posts: 312
    • View Profile
Ambitious MB project
« Reply #31 on: January 18, 2010, 09:58:44 PM »
Heres what I got so far. sorry its not much, my computer I had it saved on went down for a while. I now have it saved to a gmail account just in case.
[div class=\'codetop\']CODE[div class=\'codemain\' style=\'height:200px;white-space:pre;overflow:auto\']def botnumber 70 'what number I am in the tentacle chain
def lasttienum 71 'last tienumber (nessasary for comunication) I found out you
                  'can use .tiepres. May have to change this
def agewhentied 72 'what age was I when I tied to my first bot (or got tied to)
def whichside 73 'which side of the tentacle will I search for food?
def clock 74 'turn clockwise or counter clockwise?
def foundveg 75



'========================================================================
'touts and outs and ins tins etc.
'   out1 = numties
'   tout1 = my botnumber
'   out2 = botnumber
'   tout2 = which side of the bot my search pattern is assigned
'   tout3 = refxpos
'   tout4 = refypos
'   tout5 = communication state
'========================================================================

'reproduce to form a new tentacle
'NOTE: this is temporary to test the performance of the tentacle, my idea
'      is that the tentacle will grow longer over time when theres nrg.
cond
*.foundveg 1 !=
*.botnumber 20 !=
*.robage 20 >
*.eye5 0 =
start
*.nrg 20 *.botnumber sub div 100 >
*.nrg 20 *.botnumber sub div *.nrg div 100 mult .repro store
stop

'what to do when I see my new offspring
cond
*.numties 1 =
*.multi 1 =
*.refeye *.myeye =
*.reftie *.myties =
*.refmulti 0 =
*.in1 0 =
start
*.lasttienum 1 =
.tie inc
not
.tie inc inc
stop

'set my out1 (can change if nessacary) to show if im part of the main bot yet
'so when im a new cell I won't be tied to two tentacles instead of just one
cond
*.out1 *.numties !=
start
*.out1 *.numties store
stop

'store a value in .lasttienum to find what tie connects to the bot behind me
cond
*.multi 1 =
*.lasttienum 0 =
start
*.tiepres .lasttienum store
stop

'Find out what cell number I am etc, once im a multibot
cond
*.multi 1 =
*.botnumber 0 =
start
*.readtie *.tiepres != 'this makes sure it stores .tieread before it does
                       'anything
*.tiepres .readtie store
not
*.tin1 1 add .botnumber store
stop

'store .botnumber in tout1
cond
*.tout1 *.botnumber !=
start
*.botnumber .tout1 store
stop

'find age when tied
cond
*.multi 1 =
.agewhentied 0 =
start
*.robage .agewhentied store
stop

'store my bot number in my out2
cond
*.botnumber *.out2 !=
start
*.botnumber .out2 store
stop

'search for food
Cond
*.foundveg 1 !=
*.multi 1 =
start
*.clock 0 = and
100 .aimdx store
*.clock 1 = and
-100 .aimdx store
stop

'check the bot behind me if I should be searching on the left or the right
cond
*.whichside 0 =
*.readtie *.lasttienum =
start
*.tin2 1 =
.whichside inc inc
.tout2 inc inc
*.tin2 2 =
.whichside inc
.tout2 inc
stop

'turn untill I see bot next to me
cond
*.eye5 0 >
*.refeye *.myeye =
*.reftie *.myties =
*.numties 2 =
start
*.in2 *.botnumber 1 sub =
*.whichside 1 = and
*.in2 *.botnumber 1 add =
*.whichside 2 = and or
*.clock 0 = and
.clock inc
*.in2 *.botnumber 1 add =
*.whichside 1 = and
*.in2 *.botnumber 1 sub
*whichside 2 = and or
*.clock 1 = and
.clock dec
stop

'if I have one tie then just turn untill I see bot behind me
cond
*.eye5 0 >
*.numties 1 =
*.refeye *.myeye =
*.reftie *.myties =
*.in2 *.botnumber 1 sub
start
*.clock 1 =
.clock dec
*.clock 0 =
.clock inc
stop

'when I see food I?  (should I put a refshell/slime condition here?)
cond
*.eye5 0 >
*.refshoot 0 =
*.reftie 0 =
*.refkills 0 =
start
*.refxpos *.refypox angle .setaim store
.tie inc inc inc 'I only want to shoot one tie but this might shoot untill it hits
*.foundveg 0 =
*.foundveg inc
*.tout3 *.refxpos !=
*.refxpos .tout3 store
*.tout4 *.refypos !=
*.refypos .tout4 store
*.tout5 1 !=
.tout5 1 store
stop



Please note that its only half complete. I just wanted to show the direction I was going in and ask if anyone has any suggestions. Right now my problem is trying to get the bots to pass the veggies on. I want the bot to calculate the diference between itself and the veggie, then set an angle between that and the bot next to it and use tieloc/tieval to set the veggies aim toward the bot next to at while firing memory shots at it to make it move. It will comunicate its refxpos refypos through the tie and the next bot will set its aim toward the veggie and fire a tie at it when it sees it, overiding the previous tie. I think I can make it compatible with the main bot but I'll have to add a gene to every bot that only activates when its a tentacle cell.

Offline bacillus

  • Bot Overlord
  • ****
  • Posts: 907
    • View Profile
Ambitious MB project
« Reply #32 on: January 18, 2010, 11:01:57 PM »
I'll be away for a week, but I'll have a look at the code when I get back  
"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 Houshalter

  • Bot Destroyer
  • ***
  • Posts: 312
    • View Profile
Ambitious MB project
« Reply #33 on: January 18, 2010, 11:05:56 PM »
well hopefully I'll have it working by then   .

Offline bacillus

  • Bot Overlord
  • ****
  • Posts: 907
    • View Profile
Ambitious MB project
« Reply #34 on: January 23, 2010, 11:19:38 PM »
I think I see where you're going, but just to clarify a few things:

X inc inc will increment location X, then increment zero. you have to implicitly say X inc X inc or X dup inc inc.

The repro gene should multiply by 100 first, not last, otherwise rounding means you either end up with zero or 100. (No fractions or decimals!)

Code: [Select]
cond
*.out1 *.numties !=
start
*.out1 *.numties store
stop

make that second *.numties simply .numties and it should be sweet.

*.lasttienum seems to refer to the first, not last, tie, so should probably be left seperate from .tiepres, which refers to the most recent tie. Other than that, the code seems pretty good. You may want to look into taking advantage of OCULUS, I'll be using it here and there anyway...


I was thinking that using 31999 rnd ++ .tie store to make a virtually unique tie ID could be helpful for organizing ties. Do you think this would be a good idea to implement?
« Last Edit: January 23, 2010, 11:20:29 PM by bacillus »
"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 Houshalter

  • Bot Destroyer
  • ***
  • Posts: 312
    • View Profile
Ambitious MB project
« Reply #35 on: January 23, 2010, 11:38:56 PM »
Quote
X inc inc will increment location X, then increment zero. you have to implicitly say X inc X inc or X dup inc inc.
Really? this might explain many errors in bots i've made in the past.

Quote
make that second *.numties simply .numties and it should be sweet.
oops.  

Quote
*.lasttienum seems to refer to the first, not last, tie, so should probably be left seperate from .tiepres, which refers to the most recent tie. Other than that, the code seems pretty good. You may want to look into taking advantage of OCULUS, I'll be using it here and there anyway...
I'll rename it. I started with the concept that you had to reproduce then shoot a tie at your offspring but maybe you can just harden your birth tie. Also i completely left out tie angles and hardness and the like. If it becomes a problem and it probably will, i'll have to come back to it. can't you just store a negative number in one of the tie angle sysvars to make your bots free rotating.?

Quote
I was thinking that using 31999 rnd ++ .tie store to make a virtually unique tie ID could be helpful for organizing ties. Do you think this would be a good idea to implement?
Im not that familiar with the bitwise commands yet. But whats the point of having unique tie ids. You might be able to eliminate unique bot ids, and have every bot be identified by its ties, but that just makes it even more unessacarly complicated. If you plan on creating a new cell type, like a brain (that would be really, really cool), where the cells are connected to as many neighboring cells as possible, it could be usefull. You could set aside a memory range for every tie and when it made it and access it like an array. I suppose the advantage to a brain would be you could take advangtage of a lot of bots collective memory and processing power and combine it into one. it would be taxing on the bot though. Maybe you could make it run intirely on incs and decs to save nrg.

Offline bacillus

  • Bot Overlord
  • ****
  • Posts: 907
    • View Profile
Ambitious MB project
« Reply #36 on: January 24, 2010, 04:03:12 PM »
The tie ID is not that complicated really. It creates a random number between 0 and 31999, then increments it as 0 would not form a tie. The point of doing so is that a bot can remember which tie formed when, and allows the child to form the tie on birth without having to read parent info, which seems kind of suspect (the only other option is static tie ID, which disables tie switching completely). The parent can't bond on the birth cycle, and you'll be surprised how often they fail to bond after the birth cycle, becuase they move out of alignment or one of them turns or another bot gets in the way, etc...

Quote
Maybe you could make it run intirely on incs and decs to save nrg.
The trouble with this is that until loops are implemented in DB3 (and that's not looking remotely close to being likely), inc/dec commands allow only a fixed variation. Increasing 50 to 100, for example, could be better done with *.X 50 add .X store than X inc X inc X inc etc. (fixed) or X inc over 50 cycles (way too slow).
« Last Edit: January 24, 2010, 05:01:43 PM by bacillus »
"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 Houshalter

  • Bot Destroyer
  • ***
  • Posts: 312
    • View Profile
Ambitious MB project
« Reply #37 on: January 24, 2010, 05:40:31 PM »
Quote
The parent can't bond on the birth cycle, and you'll be surprised how often they fail to bond after the birth cycle, becuase they move out of alignment or one of them turns or another bot gets in the way, etc...

I know. Im trying to avoid systems that are set in stone and require precise timing and coordination. If a parent fails to tie to the child the first time it sees it then it will just try again the next time it sees it and if some random factor makes the child drift away and breaks its birth tie then it will just not do anything and die or get attached to by another tentacle on another bot.

Quote
The trouble with this is that until loops are implemented in DB3 (and that's not looking remotely close to being likely), inc/dec commands allow only a fixed variation. Increasing 50 to 100, for example, could be better done with *.X 50 add .X store than X inc X inc X inc etc. (fixed) or X inc over 50 cycles (way too slow).
10 incs/decs is equal in cost to 1 store. Im not sure how a brain would work though. I suppose you could have it simulate a neural network, randomly tieing to other bots and changing their wieghts and stuff. Maybe you could put boolean logic in there to and allow the bots to use an array of memory as, well memmory. Im not sure how you would get it to learn though.

Offline abyaly

  • Bot Destroyer
  • ***
  • Posts: 363
    • View Profile
Ambitious MB project
« Reply #38 on: January 25, 2010, 01:23:49 AM »
Quote from: bacillus
Code: [Select]
cond
*.out1 *.numties !=
start
*.out1 *.numties store
stop

make that second *.numties simply .numties and it should be sweet.
.numties is intended as a read location. If you store info there it will just be reset next cycle. Why are you doing this?
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 bacillus

  • Bot Overlord
  • ****
  • Posts: 907
    • View Profile
Ambitious MB project
« Reply #39 on: January 25, 2010, 02:10:57 AM »
An inadvertent reversal of commands perhaps?

I think that it would actually be a great idea to implement a backup gene like your tie former...
"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 Houshalter

  • Bot Destroyer
  • ***
  • Posts: 312
    • View Profile
Ambitious MB project
« Reply #40 on: January 25, 2010, 06:44:00 AM »
Ya, it was a typo  .

Offline bacillus

  • Bot Overlord
  • ****
  • Posts: 907
    • View Profile
Ambitious MB project
« Reply #41 on: January 25, 2010, 09:11:12 PM »
Has the piece of code you posted vanished, or has the madness finally descended?  
"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 Houshalter

  • Bot Destroyer
  • ***
  • Posts: 312
    • View Profile
Ambitious MB project
« Reply #42 on: January 25, 2010, 10:10:58 PM »
umm... both?

Offline Ta-183

  • Bot Destroyer
  • ***
  • Posts: 105
    • View Profile
Ambitious MB project
« Reply #43 on: February 22, 2010, 06:08:58 PM »
This sounds incredibly interesting. While I'm not doing anything remotely related to DB at the moment, come June I will find myself with boatloads of free time until I decide to enroll in some place of higher education, and I'm planning to finally give a crack at SF2.2 (the easier route though. I'm not even going to try to finish the far more complicated behaviors), so I may lend some sort of assistance here.

And I'll start with conceptual advice, one of my best skills.

A thought on the 'brain' cells. In a brain, there are processing centers that carry out the calculations and logical decisions dictated to it. Then, there are cells which serve strictly as memory. A 'brain' would require both, say, a veritable 'frontal lobe' and memory cortex. The frontal lobe would perform the actual 'thinking' of the bot, while the memory cortex would simply serve as a memory bus, storing jack in its memvars except what its told to. When the memory cortex grows large enough, it may be of benefit to design a 'memory bus', a middleman between the frontal lobe and the memory that could possibly help reduce processing time (in DB cycles, of course) by dynamically creating and allocating memory arrays for different kinds of data. Of course, storing different 'memories' would require an entirely new metasystem in DNA assembly to equal something of a filesystem and filetypes, but that is another discussion entirely. Read and write times would be measured in multiple cycles, so the memory cortex would be used more like a hard drive than RAM, or, more akin to microprocessors, RAM as opposed to registers. It would be wise to devote different cells of the brain to memory read/write tasks, reading and writing 'memories' to and from storage as required, such as part of the brain deciding to pass the time by performing a statistical analysis of past veggie growth and colony size.

Persistent memory storage alone, as well as any kind of statistical system, not to mention the concept of 'memories' (idea- try and implement some kind of system as used in Dwarf Fortress, where significant events, such as mass deaths, attacks, veggie surplus, etc, are stored as 'memories'.) absolutely REQUIRES the use of auxiliary cells as memory cells. 1000 integer slots is far from enough to store this kind of data when there are other things to be done. If anyone would care to try, it would be nice to see a proof-of-concept bot that would create and maintain "dead-weight" memory cells that it ties to and stores and retrieves data, such as veggie positions and densities over time, its health over time, what enemies it sees, how easy/hard they are to kill, ect. This could lead the way to a bot that can truly learn about, and react to, its surroundings, rather than simply simulating the effect of it through simple forced mutation and adaptation a-la Fruitflies. It would also be good to do so in order to lay the groundwork for memory filetypes and a crude filesystem to be used in later bots. Some kind of interpreter working through a higher level language (I.E., Pybot) would be HIGHLY recommended. Even more so, working from conceptual ideas down through rough logic flowcharts through pseudocode and finally down to DB-DNA is highly recommended as well, if nothing more than to preserve order in the code itself and make sure it stays highly modular.

Offline Houshalter

  • Bot Destroyer
  • ***
  • Posts: 312
    • View Profile
Ambitious MB project
« Reply #44 on: February 23, 2010, 04:00:07 PM »
Awesome if you could get it to work. Im not sure how a file system would work or how a bot would utimatley use it. Would my tentacle cells be of any use? Their memory is mostly dead space anyways.