Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - peterb

Pages: 1 2 3 [4] 5 6 ... 10
46
DNA - General / working with relative pointers inside DNA !
« on: April 09, 2010, 05:29:01 PM »
Hey

In program languages you see often something like ^P+
  • , the pointer to variable p and x offset of that memory adress (basically arrays work like that)

after reading the wiki i came to the conclusion that it should work also inside darwin bots genes

Maybe its something for the wiki page

Here is my sample code which explains it:



def temp0 60
def temp1 61
cond
*.eye5 0 >
start

'Have some code to move
'So that *.up has some valeu, put it in .temp0

*.up .temp0 store
'Now if it is a multibot, get that remote bots speed store it in temp1
*.refvelup .temp1 store
'Depending on multibot or not add 1 or zero to the addres of mem1  (not the valeu stored there but the addres of where it is)
'Then the single * tells the engine to get the previous number as an adres to get value from, and put that in store.

.temp0 *.refmultibot add * .up store
'so here .temp0 acts as a root pointer,  refmultibot acts as a relative position and * gets from there the value
stop


47
DNA - General / Anti bigberta gene..
« on: April 09, 2010, 02:33:40 PM »
Something fun against large enemy cells..
Since a lot of bots get stronger when they are big, how could a small bot win from such larger one ?
Here is a surprising way, how about forcing the stronger one to do a repro 50% size  
So here i'm presenting a viagra shooting gene  

I used this code.
With a sneaky parameter which is reset to zero if the bot doesnt see anything.
Now it forces biger cells to repro smaller, every 5 cycles as long as it is insight.  
So other shots can be normal shots, and i use it as the last gene.


cond
*.body *.refbody <
*.sneaky 20 <
*.robage 5 mod 0 =
start
.repro .shoot store
50 .shootval store
*.sneaky 1 add .sneaky store
stop



I've included the gene in Evolve-2C  who got a nice repro system itself (shoots it's offspring around in a circle).
Well that is unless it is attacked by its own kind, this cell is cannibal cell, and so above gene would fire on its own kind too.
But being small is not such a big problem now as it has this gene above...

48
Darwinbots3 / Numsgil, What is happin'n with DB3?
« on: April 09, 2010, 08:33:50 AM »
profile sharp url : http://download.cnet.com/ProfileSharp-Deve...4-10453690.html

( i odnt have anye experience with the program).

49
Untagged bots / Evolve II
« on: April 08, 2010, 12:00:34 PM »
Slightly improved... but what a difference it beats my strong bot called w6 now.

Improvement is in the repro system, it gets multiple offsprings first one, in later cycles more..
Hmm you got to see it in actioin, i think.


Also the boesnt use any dirty trick, no poison, no virus, ...  no tricky shots, doesnt even release its own waste...
Its nice to see with other bots, as larger bots will in the end get balanced to produce ofspring more.



[div class=\'codetop\']CODE[div class=\'codemain\' style=\'height:200px;white-space:pre;overflow:auto\']'Évolve  II b
'
'(improved repro system)
'
' Gain or pain >> eat or not, and always shoot target

' the nice thing about this bot is that it tries to shoot
' But each shot increases a counter also pain increases this counter
' To much of this and it does a fixpos or turn  (first fixpos later turn)
'
' The repro system lets young bots escape, from parent
' And also when it ages it gets more ofspring at once.
'
'

' simple repro gene more advances will be added later
' first other parts need to be tuned. (gain pain mechanics)
'
def direction 52
def etarget 53
def eyetemp 54     'left or right or not (1|-1|0)
def shootnow 55
def shootdist 56
def temp 60
def pleased 61
def borring 62
def missed 63
def detect 64
def nogain 65
def wait 66

'GENE EAT ============================================
'
'Note this bot always tries to eat
'It checks (still to improve) if eating was succesfull
'Is it a Gain or Pain ?
'So it wont keep shooting runing & spinning, if its out of reach
'Or if it doesnt contain enough food.


cond
*.robage 30 >
*.eye5 0 >


' *.in1 *.reproval !%=
' *.in2 *.bigsmall !%=
' *.refeye *.myeye !=

start

'
'*.refxpos *.refypos dist .edist store
'*.eye5 30 sub sgn 1 add sgn .shootnow store

*.wait sgn 1 add sgn .temp store
'-30    -1    0
'  0     0    1
'  4     1    2


-32 *.eye5 div .shootval store
-1 .shoot store


*.refxpos *.refypos angle .setaim store
-1 *.temp mult .shoot store
 
0 .fixpos store

 'positive longer
 'negative smaller



'after shooting move
*.refvelup 20 add *.temp mult .up store
*.refveldx 7 div *.temp mult .dx store
*.wait 1 add .wait store

'____________________________________________________________________________
___
' pain is more then gain counts as 1 times missed. ???..

*.pain *.pleas sub sgn 1 add sgn 1 sub abs 3 mult *.missed add .missed store
'  0      0     0   0     1   1    0    0    0
'  7      0    -7  -1     0   0   -1    1    3
'  0      7     7   1     2   1    0    0    0

'no pain no gain missed + 1  
*.pain sgn 1 sub abs .nogain store
*.please sgn 1 sub abs *.nogain add sgn *.missed add .missed store

'out of reach tried long enough now (150..??) .....


*.missed 150 mod sgn 1 sub -628 mult .aimdx store
*.missed 150 mod sgn 1 sub -1 mult .fixpos store



'____________________________________________________________________________
___
stop




'GENE MOVE====================================================================

cond
*.eye5 0 =
*.robage 30 >
start
*.eye9 *.eye1 sub sgn .eyetemp store
*.eyetemp 130 mult .aimdx store
*.eyetemp abs -1 add abs 5 mult .up store
*.eyetemp abs -1 add *.mass mult .dn store

*.dx -2 div .dx store
10 .up store

'if eye eye4 or 6 see something fixpos turn
*.eye6 *.eye4 sub sgn .borring store
*.borring 35 mult .aimdx store
*.eye6 *.eye4 add sgn abs .fixpos store
   
*.pain 1 sub abs .pain store


*.eyetemp abs .detect store
*.borring abs *.detect add sgn .detect store
*.detect *.missed mult .missed store
*.wait 1 add .wait store
stop


cond
*.nrg 32000 mod 0 =
*.mass 5 mod 2 >
start
1 .repro store
-700 .aimdx store
10 .strbody store
10 .mkshell store
-40 .wait store
stop

cond
*.robage 30 <
start
*.tiepres .deltie store

500 .dx store
*.robage 5 sub sgn 1 add sgn 500 mult .dn store
'1                 -1    0   0
'5                  0    1   1
'10                 1    2

*.robage 20 sub 0 floor 9 mult .aimdx store
'
'
'
1 .strbody store
stop

50
Untagged bots / Evolve II
« on: April 07, 2010, 11:57:36 AM »
This bot is opportunistic, it tries to shoot.
But each missed shot counts as a bad shot.
To much bad shots or pain, result in a fixed pos and later later even a turn away.
Based on that the following behaviors could be seen :

  • It will not endlessly hunt to fast bots, it gives up after a while (give up
  • It will not circulate around a veggy forever (fixpos re-orientate and attack
  • Hard to get targets will not be hunt forever (give up

its not the greatest danger this bot, but its i think an intresting behaviour bot.
Also the reproduction isnt that complex, i was mainly designing a bot that wouldnt circle around forever and that had some kind of gain and pain system, on which it acted.


51
Bot Tavern / A Cosine function, with no tablebase usage.
« on: April 04, 2010, 09:29:34 PM »
cosine (from +100 to -100) , based on the 1256 darwinbots  x degrees

notice i kept the value of e inside here since there might be different ways to optimize this math into to darwinbots.
e is about 2.71828182845904523536  (source wikipedia)

the function cos(x)*100  as  f(x) =  

      100.336
      + 1.55527e-015*x*x*x*x*x*x
      + 6.72543e-009*x*x*x*x
      - 1.48672e-006*x*x*x
      - 5.86017e-012*x*x*x*x*x
      - 0.000986079*x*x
      - 0.0193941*x
__________________________(sum)


PS
I don't deserve big credits for it, I'm just playing with my new math toy and giving it some tests.
Still it might be useful for those who want to play with sin and cos   sin (x) = cos (x-324)
So we can create Spiro-graphic effects  
Notice i let result from -100 to 100 for integer rounding reasons    true cos should have a final 100 div after it.
I'm not sure how precise it will be these function inside the integer universe of darwin bots.
My mechanical turk , is going to keep number crunching on the data set so maybe i have a better function tomorrow.
But i doubt it as this is pretty near to the real thing..
Note this function might require mod function for its input 1256 mod

hmm and it might be that *x*x*x*x*x*x  results in overflow...

52
DNA - General / shootval and distance for -1 shots
« on: April 04, 2010, 08:57:14 PM »
Quote from: abyaly
peterb-
You should test shot lifetimes with various shootvals.
Then with various body sizes, because that's also a factor. Once you know shot lifetime, multiply by 40 to get distance.

I remember I did this at some point and the results were not what the formula in the wiki predicted. I'm not sure if I posted a chart of my results somewhere, but you can easily do the experiments in half an hour or so.


I think for the moment -32 *.eye5 div .valshoot store    (works for starting robots)..
i got to admit not tested it against all sizes

Getting good data is the biggest problem here and it does take a long time to get it, not a half hour i'm afraid

if you still have the data i would be happy to synthesize a math formula on it

53
DNA - General / shootval and distance for -1 shots
« on: April 04, 2010, 10:11:05 AM »
Quote from: ashton15
Quote from: Houshalter
Well it does have an awful lot of stores in it. You do know that those use up energy? Anyway to eliminate them?

Only one activates at any one time, I used conditionless logic which multiplies the location to be stored by 0, that resulsts in trying to store something into location 0 which is impossible and thus costs no energy. Alos they only activate when they see something and stuff like that, I used conditionless loggic because each normak condition costs about a tenth of a store command whilst conditionless logic is free. Therefore in theory minimal energy should be used... at least it worked when I tested it, when unactivated has a smaller energy consumption rate than alga_minimalis. Most of the gene is repetitive, one store for each eyewidth (negative, 0 and positive) multiplied by the ammount of eyes, so ultimately the 27 stores are in place for examining a range of possibilities in various eyes.

ehm i've written them too in the past, i think all bots could be written like it, see the beasteary 1G bots, some of mine must be there as well

54
DNA - General / shootval and distance for -1 shots
« on: April 03, 2010, 03:30:02 PM »
Quote
...hmmm for some reason its not ok,
did i make an error here above ?, i do believe the math retrieved from eureqa was ok 25.0438 / (0.217382 -e5)

hmm the same program reminds me to  

-32 / *.eye5 .shootval store  

Since it sugested -30 / eye5.. i have to say this was one of the simplest forms of the formula and might not be correct.
There are more precize versions like  -22.0415/(*.eye5 - 0.285701) - 1.14216 .shootval store

The point is my data set contains errors..  its not based on the exact values but the nearest values i could get..
it results in the longshots.. but not the short powerful ones, but i neither could retrieve those values for shot shots in my data collection earlier..



bot added again it has no repro, (and sadly it spins again around targets... sometimes)

55
DNA - General / shootval and distance for -1 shots
« on: April 03, 2010, 01:56:11 PM »
Quote from: peterb
got to keep integers under <32000
so

25.0438 / (0.217382 -e5)

3200 /25.0438 = ~1277

so it equals >  (25.0438 *1277) / ((0.217382 *1277)-e5 *1277)

= 31980 / ( 278 -( e5 * 1277)  

----------------------------------------------
In DB language that is   (using clacula as a temp)

278 - *.eye5 .calcula store
31980 *.calcula div .shootval store


 i will attach a bot with this forumula contained   (but remove the last gene of that bot dont let it repro, thats still crap inside this bot).


...hmmm for some reason its not ok, did i make an error here above ?, i do believe the math retrieved from eureqa was ok 25.0438 / (0.217382 -e5)

56
DNA - General / shootval and distance for -1 shots
« on: April 03, 2010, 07:52:51 AM »
got to keep integers under <32000
so

25.0438 / (0.217382 -e5)

3200 /25.0438 = ~1277

so it equals >  (25.0438 *1277) / ((0.217382 *1277)-e5 *1277)

= 31980 / ( 278 -( e5 * 1277)  

----------------------------------------------
In DB language that is   (using clacula as a temp)

278 - *.eye5 .calcula store
31980 *.calcula div .shootval store


 i will attach a bot with this forumula contained   (but remove the last gene of that bot dont let it repro, thats still crap inside this bot).

57
DNA - General / shootval and distance for -1 shots
« on: April 03, 2010, 07:09:11 AM »
i test usualy in phases, trying to exploit new ideas and then later combine them
i had to do the aiming to zero degrees, just for testing the ranges to get the valeus for eye5 and shootval
Aiming can be restored this way :

*.refxpos *.refypos angle .setaim store



58
DNA - General / shootval and distance for -1 shots
« on: April 02, 2010, 09:57:23 PM »
I was thinking...
Since the dist command does require a lot of complex calculations, is it the right thing to do ?
Or maybe use eye5 as its results isn't neither straightforward too  (the closer the faster the number increases)
Well I'm not sure but i got these values from a starting cell   
Still i got the problem of growing size of cells.. well eye5 grows with it maybe it solves it.

I collected from a test bot, using a lot of my time the following results
They are as abest as i could get it but I'm sure its not 100% correct. (90% at best)

Code: [Select]
dist eye5 shootval
1600    1 -32
1375    2 -14
1034    3 -9
989    4 -7
904    5 -6
830    6 -5
Then I found Eureqa some kind of free math formula finding program
It really is amazing it can find formulas behind data sets...   (so we require less scientists ??)
It does not have als darwinbots calculation options, no binary operators but a lot of others, so i had to limit it down.
Aldo couldn't use cos and sin functions.

It turned out that eye5 had a more easy relation to this then the distance value, resulting formula's looked better.
Now based on the eye5 valeu it found the folowing relation between shootval :
A lot depend on how accurate my values are .. and thats a bit of problem i just tried to do my best here.
Well the program found these relations between eye5 :

Code: [Select]
]f(v) = 21.6136/(0.298103 - eye5) - 1.21081
or

Code: [Select]
f(v) = 25.0438/(0.217382 - eye5)

But now i wonder, can i type these numbers into darwinbots?
Or does it only work wit rounded integer valeus ?????

59
DNA - General / shootval and distance for -1 shots
« on: April 02, 2010, 06:57:45 PM »
Quote from: ashton15
Just realized I was a bit silly... rather than doing

sub sgn ++

(which returns 1 if the two past values are >= to each other and 0 if they aren't)  I wrote

sub abs sub sgn ++

However that still doesn't cure the problem (it does however remove another one from apearing), I tried this code which didn't seem to store any values (?) but still shoot a far range. That's annoying as I can't check to see wether this is working or not.

 *.refxpos *.refypos dist *.XXX >= -2 .shootval store
 *.refxpos *.refypos dist *.XXX 2 mult >= -4 .shootval store
 *.refxpos *.refypos dist *.XXX 3 mult >= -8 .shootval store
 *.refxpos *.refypos dist *.XXX 4 mult >= -16 .shootval store
 *.refxpos *.refypos dist *.XXX 5 mult >= -32 .shootval store

also I checked the locations by putting

-2  *.refxpos *.refypos dist *.XXX sub sgn ++ sgn mult .101 store

and

 *.refxpos *.refypos dist *.XXX >= -2 .shootval store .101 store

no values were stored again... I'm really confudled by this one... I checked over the code multiple times and don't understand why it won't work... are you sure *.refxpos *.refypos dist works?

P.S. I think I've worked on this to long...  




Hmmm i think your close to something... i have also not figured it out yet.

the problem of distance and strange valeus for it..
And check against it and then to set valeu to (32 /16 /8 /4 /2 ....-2 -8 -16)...

Maybe something based on this :  ?

-6000 + distanse add 0 floor sgn 32 mult store .shootval store


i'm not sure because it got to work against multiple distances and multiple valeus
Maybe each line that passes ok sould add or substract to something until you reach 24 /16/.../.../... etc.
A nice thing of it is that short shots (when you bump into someone) become more powerfull.
The long shots cost more, but on the otherside sometimes you can hun a faster bot that way.

Also the both grows its shooting range changes.. hmm maybe 6000 + or mult a factor ? the factor is not that clear to me.. its inside shots.bas in the code, but its strange looking.
I wonder why shootval works that complex, why has it been made to such a complexity level















60
DNA - General / shootval and distance for -1 shots
« on: April 02, 2010, 11:16:42 AM »
Quote from: ashton15
Ok, i worked on this for a little bit, scraped edist as it's a waste of energy and used unconditional logic also for effciency, basically if something is just past the range of the bot or equal to it doubles the value of .shootval starting at -2 (it is possible to store 0) it shots at things which are up to five times the distance of a base shot length though I don't know what that is... anyways hope this helps  

def XXX 100

'XXX = how far a shot goes at shootval 0, you will have to work this out yourself

start
*.eyef 0 !=
*.refxpos *.refypos angle .setaim store

-2 *.refxpos *.refypos dist *.XXX       sub abs sub sgn ++ sgn mult
-2  *.refxpos *.refypos dist *.XXX 2 mult    sub abs sub sgn ++ sgn mult add
-4  *.refxpos *.refypos dist *.XXX 3 mult    sub abs sub sgn ++ sgn mult add
-8  *.refxpos *.refypos dist *.XXX 4 mult    sub abs sub sgn ++ sgn mult add
-16  *.refxpos *.refypos dist *.XXX 5 mult    sub abs sub sgn ++ sgn mult add
.shootval store

'btw -32 is the lowest which can be stored in shootval

.shoot dec

stop



doesnt seam to do the trick,
I created a simple test bot, used some test valeus for xxx
And tried to feed it some vegie in front to see when it starts shooting at the vegie
You used a lot of complex code in the math can you clarify it simply is it a if x > then rule ?

hmm myabe directly edit a veggie to investigate how shootval works



'test

def etarget 60
def edist 61
def XXX 100

cond
*.eye5 0 >
start



*.refxpos *.refypos dist .edist store
*.refxpos *.refypos angle .setaim store

 'positive longer
 'negative smaller



'XXX = how far a shot goes at shootval 0, you will have to work this out yourself

1 .xxx store

-2 *.refxpos *.refypos dist *.XXX sub abs sub sgn ++ sgn mult
-2 *.refxpos *.refypos dist *.XXX 2 mult sub abs sub sgn ++ sgn mult add
-4 *.refxpos *.refypos dist *.XXX 3 mult sub abs sub sgn ++ sgn mult add
-8 *.refxpos *.refypos dist *.XXX 4 mult sub abs sub sgn ++ sgn mult add
-16 *.refxpos *.refypos dist *.XXX 5 mult sub abs sub sgn ++ sgn mult add
.shootval store


'btw -32 is the lowest which can be stored in shootval

.shoot dec

stop

Pages: 1 2 3 [4] 5 6 ... 10