Author Topic: Tutorial: Harvasting bot collective canibals.. :)  (Read 1370 times)

Offline peterb

  • Bot Destroyer
  • ***
  • Posts: 148
    • View Profile
Tutorial: Harvasting bot collective canibals.. :)
« on: November 01, 2008, 09:55:21 PM »
'An explained bot, like a manual inside a bot, by peterB as a starter bot to learn from.
'The bot in the end became a bit more advanced then I had planned.
'Its a result of playing with all the inner valleus
'I still dont understand it all, but this bot allready defeats lots of other bots, like C-Filanse and I-flamma.
'Its not that smart I thnk but reproduces with not that much energy
'As a canibal its stable alone for quite a while, but as a group of pirhana's its also a feeder.
'Tough in such a group it not realy kills it's prey fast so as a group it has food storage...
'In a group environment it has time to create ofspring, as sexual reproduction from a group.
'
'
' As this was my first bot I took lots of readable notes in it.
' In a way this bot is a manual too, I tried to explain it myself
' And maybe to others.
' So I kept the explaining language close to the topic of programing these bots.
'
' And is therefore verry easy to adjust, or to understand
'
'
'SENSORS and variables
'============================================================================
=============
' A basic sensor is an eye
' There are multiple eyes but lets focus at the most important one, the forward looking eye5
' To get info from an eyse5 you need to read it out, this is done by the command:
'    *.eye5    
' Its reads from the fronteye (number 5 is front)  
' Its the same as reading from memory location *505  (dough thats harder to understand).
' Its value 'll be greater then 0 if it sees something
' The more nearby the higher the valeu (max is 100 I asume)
' There are more type of sensors.
'  for age etc etc, you'll see them later.
'
' Moving a simple
'============================================================================
=============
' *.up                my own up speed.
'                     note to add 30 up to my own speed use:  *.up 30 add .up store
'
' *.dx                my rotation value
'
'  Often remote sensed bots start with ref, and local sensors with my like:
'
' *.refeye   *.myeye   (counts number of eyes often used for species comparison)
' *.refvelup           (relative bots speed from your eyevector)
'
'
'
'CONDITONAL COMPARISON
'============================================================================
==============
' =   equals
' %=  almost equal, whitin 10%
' !=  notequal
' > greather then
' < smaller then
'
'
'
' What in basic languaga would be:
'   IF EYE = 10 THEN..  
'     ...
'      END IF
'
'
' Is in darwin bots genetics
'    cond
'     *eye5 10 =      (note type of comaprison comes last).
'
'
' Other type of sensors
' *.refeye *.myeye !=     ( count other bots number of eyes, and compare it to my number of eyes) if not equal..
'                         ( this is often used to detect friend or foe, by counting eyes.
'                         ( dough what if the enemy has the same amount of eyes ???
'
' MOVEMENT
'============================================================================
=================
' *.refveldx .dx store         (move at otherbots, sideway motion speed )
' *.refvelup 30 add .up store  (compared to my bot's eyte direction the other bots speed + 30)
'
'


' So lets move forward with our manual and our first little cel.
' And lets us do something when there is nothing big nearby..
' the valeu of an eye seams to get higher when its more nearby
' so 100 is when your eye bumps into something and 10 is something far away.
' Wel I dont want to go to fast if something gets nearby.
' Like using my carbrakes for a piza nearby.
' so I check for a cond (condition) in which the eye hasnt anithing nearby as close as 40
' Then I start what I want to do in this condition
' That is go forward 8 by storing 8 in the upwards engine
' Thats the end of comands for this gene so this gene comands ends with a stop
' GENE 1

cond
*.eye5 40 <
start
8 .up store
stop



'GENE 2
' Gene 2 Food Finder and eater
' is food nearby?
' But altough its a killer cell it wouldnt eat young childs younger then 300 cycli
' A remote cells age can be questioned with *.refage
' Such child could be our own children, or my enemy or even young plankton.
' But well plankton childs or enemy childs will not be eaten.
' Dough older cells I will eat them. So I shoot them, here simple shooting = eating.
' this is done by storing a negative value -1  in .shoot memory
'
' The next 2 lines align us better with our target for a possible next shoot.
' refveldx (targets orientation, store it in local orientation
' And now for our engine store there a relative speed 10 higher as our targets speed

cond
 *.eye5 40 >
 *.refage 300 >
start
 -1 .shoot store
 *.refveldx .dx store
 *.refvelup 10 add .up store
stop



'GENE 3
' If I remember one thing of bioligy lessons in fact my only lesson
' That it had all to do with reproction, DarwinBots can reproduce too
' The question is when should we do this, and how does it work.
' Wel most cell in darwinbots devide asexual, only based on their energy reserve
' Energie level can be retrieved trough sensor *.nrg
' most of the times I saw    *.nrg 5000 >
' but I will use a lower value  2500 in this one just for fun...(life is like go and multiply)
' Also the question is how much energy would you like to give to your child mostly I see
' 50 .repro store
' will result in a child with 50% of the energy stored it is commonly used.
' But just for the fun of it, the parents will only give 30% (childs are weaker then parents)
' After givin birth the parent runs fast away, yup that can happen in nature.

cond
*.nrg 1500 >
start
30 .repro store
'10 .up store
100 .dn store
stop



'GENE 4
' if it doesnt see anything every hunderst cycle then turn
' This helps us getting away from walls or empty spaces, its called random walks.
' then perform a command .aimdx (clockwise turn)
' oh btw.. for the other counter-direction use aimsx
' A total turn in DarwinBots = 1256 units
' so 1256 = 360 degrees or 2pi  
'     628 = 180             pi
'     314 =  90             pi/2
' lets add a random valeu of such degrees to the current direction.


cond
*.eye5 0 =
*.robage 100 mod 0 =
start
628 rnd *.aimdx add .aimdx store
stop



'GENE 5
' This gene realy is programing evolution at work..
' What I tried to do first was remove a child's birth tye, if also he had clear runaway path.
' Dough I didnt clearly understood how that worked.
' For some reason a tie kept alive
' So I started up mixing code from the website, and then it turned into something else
' I left this killer bot keep his tye's, till it has more then 1500 energy (adulthood)
' Now my first tought was to run away forward
' Hmm.. but if runned backward and not to fast
' Then it would probaply gonna eat from something it had catched before.
' I still regulary see some of them break free, like a spore thats nice.
' Dough since also a single bot could could activate this gene but should not runaway from its food..
' so lets dont walk that fast backwards just say 5 or so.

cond
' *.robage 1
  *.eye5 60 <
  *.nrg 1000 >
start
 .tie inc
'*.tiepres .deltie store
5 .dn store
stop



'GENE 6
' I actualy found from the website
' it eats the others bot energy (plankton here we go...)
' but also dumps waste in the other bot.
' it took 99 % of energy, but hey lets be a little bit fair here and take 16%
' that sounds small, but keep in mind we dont break the tye..
'
' note when not using any conditionar and changing this valeu to 5 10 15 25 etc
' gives nice side efects in ofspring creatures
' soms might be able to live together with 1 plankton.
' Its questioning of balancing this valeu.
'
' However in the end I took a different aprouch I wont eat others energy all the time.
' So there will be differences in a group (to let others be able to get energy offspring).
' This is also balanced a cingle plankton and a single canibal will also grow slowly.


cond
*.robage 20 mod 0 =
start
50 .sharenrg *.multi mult store
.sharewaste *.multi mult inc
stop



end


' So that was the whole genome, it ends with the word end,
' But wait there is much more then this writing above here.
' A lot of other function vars and commands can be found here at this site:
'  http://www.darwinbots.com/WikiManual/index.php?title=Sysvars

Offline Peter

  • Bot God
  • *****
  • Posts: 1177
    • View Profile
Harvasting bot collective canibals.. :)
« Reply #1 on: November 02, 2008, 06:14:22 AM »
Nice fully explained. Maybe something for a wiki tutorial.
A simple batterybot, it works well, you can also suck the energie out of the other bot without hardening the ties first, that works a little faster.

It lacks a body-gene. The bots will take more and more nrg and body will become smaller and smaller. Or was that the purpose.

Anyway, a simple body gene. This will keep your body higher then 100.
Code: [Select]
cond
*.body 100 <
*.nrg 500 >
start
100 .strbody store
stop
« Last Edit: November 02, 2008, 06:15:40 AM by Peter »
Oh my god, who the hell cares.

Offline peterb

  • Bot Destroyer
  • ***
  • Posts: 148
    • View Profile
Harvasting bot collective canibals.. :)
« Reply #2 on: November 03, 2008, 02:41:33 PM »
Quote from: Peter
Nice fully explained. Maybe something for a wiki tutorial.
A simple batterybot, it works well, you can also suck the energie out of the other bot without hardening the ties first, that works a little faster.

It lacks a body-gene. The bots will take more and more nrg and body will become smaller and smaller. Or was that the purpose.

Anyway, a simple body gene. This will keep your body higher then 100.
Code: [Select]
cond
*.body 100 <
*.nrg 500 >
start
100 .strbody store
stop

Ok thats intresting the body size grows, but as a result it seams to move slower and be less effective.
I have tried now various small changes and rules to let it grow in body size.
However growing costs energy (so reproduction rate becomes slower)
In result it seams then to become weaker in spreading, and as a species become weak.

On the other hand it shouldnt shrink forever (by reproduction), maybe someone finds a nice small adjustment to also let it grow, and still be effective.


Offline Peter

  • Bot God
  • *****
  • Posts: 1177
    • View Profile
Harvasting bot collective canibals.. :)
« Reply #3 on: November 03, 2008, 05:15:47 PM »
Well it is all about priority's. You can't have cheap body. Body is expensive, one body costs 10 nrg. But valuable too.

You could also get the body elsewhere. You could by using body shots. Look under here, body shots are -6. I changed the -1 in a -6. If it hits veggies it should grow a little.

cond
*.eye5 40 >
*.refage 300 >
start
-6 .shoot store 'changed dna.
'-1 .shoot store your dna
*.refveldx .dx store
*.refvelup 10 add .up store
stop
Oh my god, who the hell cares.

Offline bacillus

  • Bot Overlord
  • ****
  • Posts: 907
    • View Profile
Harvasting bot collective canibals.. :)
« Reply #4 on: November 03, 2008, 10:44:50 PM »
Actually, the main reason to make lots of body is that it makes shots way more powerful. You'll find this critical in situations where you're facing a bot and exchanging shots. You don't want to waste time and nrg combating him, so body can give the critical edge.
"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 peterb

  • Bot Destroyer
  • ***
  • Posts: 148
    • View Profile
Harvasting bot collective canibals.. :)
« Reply #5 on: November 07, 2008, 05:58:05 PM »
Quote from: Peter
Nice fully explained. Maybe something for a wiki tutorial.
A simple batterybot, it works well, you can also suck the energie out of the other bot without hardening the ties first, that works a little faster.

It lacks a body-gene. The bots will take more and more nrg and body will become smaller and smaller. Or was that the purpose.

Anyway, a simple body gene. This will keep your body higher then 100.
Code: [Select]
cond
*.body 100 <
*.nrg 500 >
start
100 .strbody store
stop

I dont seam to be allowed to add pages to the wiki site, I'm a member there but cannt create pages.
Perhaps someone else can add it perhaps?
I think as a starting bot manual inside a bot text can function as a jumpstart to learn this language quickly and also to get one thinking about this topic.


Offline Peter

  • Bot God
  • *****
  • Posts: 1177
    • View Profile
Harvasting bot collective canibals.. :)
« Reply #6 on: November 08, 2008, 02:16:49 PM »
Quote from: peterb
I dont seam to be allowed to add pages to the wiki site, I'm a member there but cannt create pages.
Perhaps someone else can add it perhaps?
I think as a starting bot manual inside a bot text can function as a jumpstart to learn this language quickly and also to get one thinking about this topic.
Strange, I could make a page, as far I know I haven't got any special powers.

And I don't know if this should really add much more then the already existing tutorials.

Anyway, I just copy pasted it. I hope you can change the page now.
Harvesting bots collective cannibals
Oh my god, who the hell cares.

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7715
    • View Profile
Harvasting bot collective canibals.. :)
« Reply #7 on: November 17, 2008, 10:39:19 PM »
You should be able to create pages.  If you can't, double check that you're logged in to the wiki.  If you still can't, let me know and I'll look in to it.