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 ... 10
31
Newbie / Darwinbots replacement/clone
« on: April 19, 2010, 06:43:29 PM »

i found some examples here http://nio.astronomy.cz/vb/opengl.html  (which seams fast for a basic aplication),
they use openGL and a wrapper called Tao, which seams to be updated recently
And it doesnt require to install a huge SDK from microsoft, these working demos are pretty small coded.

OpenGL exists in windows since i think NT3.51 so its pretty stable, and you can upgrade it like directx.
speed diffrences are not huge, so its mainly about how easy it would be to draw lines and circles.
That was easier in vb6 and earlier versions of basic like
screen 12
circle(90,90) 10, 4  


but thats was before the graphic cards became smart ..

Hmm if I only could have a picturebox and have it ehmmm like assigned a such openGL power (or directx).
Then I could do all the drawings I want and fast, and then a refresh of the object to show it.
but such a could.. still is a mistery to me.
Its kind of strange we want to draw verry simple, but that seams to require a lot of knowledge these days.


32
Newbie / Darwinbots replacement/clone
« on: April 19, 2010, 05:42:23 PM »


I didnt have vb6 anymore installed somewhere, so i went to vb.net
I think i'm going to strip, al lot from it, to get a 'naked app'.
Or maybe first investigate a good direct3d wrapper for vb.net.
I also wonder if it should be possible to include other code inside vb.net
So having a c#.net draw tool, which could run the output (drawing circles and lines in color)
So to split the main routine and the graphics routine.
But i've never done something with any kind of graphical engines, and combined code.


oh btw maybe a tip
You do a lot of 180/pi  and pi/180  try make it a constant


    Const Rad2grad As Double = 180 / PI
    Const Grad2rad As Double = PI / 180

so you have less calculation for each movement.
And maybe even you could speedup sin/cos, with a array of 90 degrees and a simple function for the rest based on mod.
Small ideas to speed it up.




33
Newbie / Darwinbots replacement/clone
« on: April 19, 2010, 05:59:29 AM »

i'm trying to convert the code to vb.net
but its a bit complex if you dont know the exact inner working of the program.
I lack the general view.

i see seperated "subjects", there is a graphical part (wich might be translatable to some different kind output > directx9 or something else) and physics and DNA,
And there must be a data structure
hmm besides that there is some complex species loop,
which doesnt convert well to vb.net...
hmm vbnet doesnt accept arrays with negative values hmmmm

Basicly i think i could be written in vb.net, the things in which vb6 is more easy is perhaps file access, but thats about it.
There is a trick however to include vbscript runtime (so you get the easy script commands) and another option is to make to 'right' file dialog calls, which (i forgot them a bit) but they endup with complete finished dialogs like the file load/safe dialogs of word / excel / ...


hmmm thinking thinking  


34
Newbie / Darwinbots replacement/clone
« on: April 16, 2010, 01:16:28 PM »
Quote from: ashton15
Quote from: peterb
Quote
And do you really think you can simulate human intellegince in darwinbots? That would be weird.


If it scales, currently cats are simulated.. see link
But i'm rather into smaller networks, first try XOR in a neural net for example, thats a good starter.

Aye, afterall what is a human human brain and nervous system: a giant neural net, of course there are some chemicals involved as well for things like hormones but I'm sure a neural net can easily match those kinds of capabilities, I'm more than ceratin that a computer has the potential to be more intelligent than any human who has been born narually and ever will be born for once a robot can learn it can become more inteligent than a human in theory, and better intelligence, is better at making even more improved inteligence and so on in a cycle until you have an indefinitetly inteligent machine, if you look on wikipedia there's a tonne of stuff on it... it's also been suggested as a solution to the fermi paradox, as for the reading code what i wrote does roughly that change ++ to 1 sub and it'll read the location stored last 2 sub will look at whatever was put in 2 cycles ago, it's pretty shaky though and could use some expansion but it's simple enough to do yourself I'm sure.

hmm yes but the point doing the required math based on the current integers -32000 to +32000, is almost not possible; i've been scanning the net now for a while for different interpretations of the math on integers but they are real hard to find. (i found one which was a writing of a DRs. and you had to buy his copyrighted work..), which was designed for some basic electronics (no mentioning of c# or Vb) pretty low level, just imagine input [0..100] value, with a weight [0..100] 100x100 10.000 (thats one neuron connection) not an arry (and using 0..100 is allready a translation because this math usualy uses valeus from +1 to -1, and all real type numbers between. (0.00230405..  etc). >> so with [0..100] you have basically 2 digit precision which is i think to small for this to work.


I cannt wait to see this new code of DB, maybe port it to vb.net (the speed difference between vb.net, and c# is minimal).
And normally one does not recode a program to be just in another language.
Its more likely to do so for only some routines (by inline assembler or, or other languages referal routines.)..





35
Newbie / Darwinbots replacement/clone
« on: April 16, 2010, 11:57:01 AM »
Quote
And do you really think you can simulate human intellegince in darwinbots? That would be weird.


If it scales, currently cats are simulated.. see link
But i'm rather into smaller networks, first try XOR in a neural net for example, thats a good starter.

36
Newbie / Darwinbots replacement/clone
« on: April 15, 2010, 03:36:09 PM »
Quote
As for your neural net, what about things that are related, but don't happen in the same cycle. For example, if you shoot, you get -2 shots back in the future, not instantly.
Quote
Simple the neural net computes like computer RAM and functions with information stored on the "hard drive" which knows things like which synapses connect which to things and then it also has space just for memory that can be written to, somewhere in the unconditional tutorial thing it talks about some other way to use memory which might be helpful. Didn't entirely understand though.


It doesnt matter if for a neural net something doesnt happen within the same cycle.
Put simple, if you shoot you can count up a total shots   (*.shot 1 add .shot store )
if you get food back, you can reset the shot counter.
As long as shots don't go to high a neural net doesnt trigger an action.
If shots value get to high and can choose to abandon shooting, or go faster forward.
Basicly this is way neural nets use a sigmoid function, because it switches after a "certain" treshold, in which the "certain"part adepts by a reward system.
reward would simply be gain food, or succesfully do something.

i was just thinking what if the firt memory byte (zero) was reserved for cell type and thus memory amount.
In such case less memory types would be fixed and reserved, its possible to minimize memory if you dont use eyes,
(8 types  eye, shell, nrg body, str body, movement) or if we use 2 bytes we got 16 options 4 bytes 32...
Hmm maybe i better just wait for the code before doing these suggestions.

37
Newbie / Darwinbots replacement/clone
« on: April 15, 2010, 07:26:31 AM »
It was a long write; because its not possible in DB2, so i only liked to give what should be about needed for it more memory of different type.
As some people like run like 10.000 bots then the best option is to have cell differences.
So a simple cell should contain less memory, also thats new for DB in which every cell can do all, smarter would be to have cells for specific tasks, so a multibot execution is quicker.
But also since i'm thinking of multibots here, since their 'genomic' is simpler a new way should be thought of for reproduction.
A specialized repro cell might do the trick, in it some new DNA commands to have a bleuprint of a species.
Specialized cells is a different new concept, but could be nice, in terms of memory usage and in terms of evolution.
All the special command in DB2 we could think of as special cells (store nrg, eye, stpoison, shell, repro,shoot,... etc).

 

(1 head connects to a neck joint ,to a body cell, then a mirror split of 2 arms, to hands, to fingers, to keyboard, to my latop..heheheh..)


if there is enough memory for (some) bots we can later make it, and the right type like an array of var type int. ( a bit more then +32000 -32000)
To activate such code some more math commands are needed like some a sigmoid functions, some 'more precize calculations are needed.
Or evenmore complete neural math function  (sum array with weights).
I think for the moment its better to finish the clone, and i realy hope it would become readable code (with not to many magic variables); the old DB is not easy to read.
If we got clear code then it becomes possible to extend it, and maybe by more people.


These things are not worked on in DB3 as far as i know, i'm not sure how far DB3 is currently
This is maybe DB4 stuff i talk about, but if we got a good skelleton of the basic program, then a next version would be more easy to create.
And what ive seen sofar from it, seams to be better readable. (maybe not that fast?).. but promising



Oh also another answer i forgot in my earlier email, neural nets dont program the rest of the DNA to build usefull DNA to create a LOG(x) function to shoot.
It would rather become that a neural net would emulate the log function itself and give itself a shoot command. (connect the output to a shooting cell..)
(but i dont realy think that LOG(x) is required to shoot, but givven time it might improve perhaps to something like that...)
The improvement would be caused by having offspring (genetic reproduction) while advanced functioning (combining of eyes and shooting) would be a result of a small neural net.
The results might be impressive, since in current DB we create 'static' creatures, who by random noice (DNA mutations) change behavior.
In contrast nueral nets are adaptive by nature, not static
** there is a problem of learning for these bots, by i think thats much the same as zero bots problems >> Just start with enough variation and use elimination until you get some usefull Neuralnet.
Still we could use genetics as in DB, or random DNA mutations, if we can later build in a neural net then it would become much more realistic.
Most animals have brains... or at least have a concept of neurons.

Only the real small creatures dont have it, but often are so advanced allready that i'm not sure which rules aply to them ( slime can emulate the network connections between cities.. (new scientist article))


38
Newbie / Darwinbots replacement/clone
« on: April 14, 2010, 03:49:16 PM »
in simple neural nets can be seen as a layer of dots (memory locations)
most often you see 3 layers of just a few dots
draw lines between dots and call them weights.

so a single dot on the second row does do (sum each dot in the row above (and for each dot .multiply its input with its weight line).
Depending on the results of single a neuron it adjusts the weights. (is it always wrong, then they become close to zero, is it oposite they become negative).
In the beginning the neural net is randomly seeded with random numbers, sigmoid calculations are done to balance the network.
And then with some hope and some clever thinking we might get it into DB  (currently i've seen no sample of a bots using sigmoid functions, some claim to have but i doubt them)
here a not to complex read http://arxiv.org/ftp/cs/papers/0308/0308031.pdf

There are several ways how it can work (and this would be something we have figure out (comparable to evolving zerobots)..
As you can imagine all weights and all dots can compare lots of memory, so to keep the program fast i think not all cells do require such large amounts of memory.


Back to neural nets.
Normally  this math works wit real numbers (maybe floats) and rarely with short integers (maybe an int type is enough). ..
 types >>

As you might notice this requires some memory so it would be better to have another cell type (so not all of the cells would require large amount of memories)
So a brain cell can contain more code, and process more advanced commands.
Also eye cells and movement cells, shooting cells, posion storage, shell cells.. could be smaller (and simply have input or output, and some energy demands and a connection(location?).
I know thats radical different from DB in which a single cell can do everything, and has potentially all kind of information even if it doesn't process them.

Note for all the things that could be done with 1 or 0 you can use binary math (XOR OR AND etc) and so limit memory usage of them.
Although one bit can store only on /of 2 bits can store (00 01 10 11) for states (4 =  2^2  and 3 bits can store  2^3 = 2*2*2 = 8 states.
By us


In DB there areas are like the *.970 area (given to child by birth). (to keep children learn), something like that should also apply i think (so you get spock like brain transfers at birth).
The easist way might perhaps be to have a cell type wit a double adres range, one that is not poluted with all kind of commands



Note the math required actualy for doing this and the training of the neural net, is something which is another topic and a chalange like numsgill chalange for a zerobot using conditional behaviour.

But once we got a small neural network working, it can be exanded..>effectivly becoming smarter.
At ofcoure higher energy costs, as our brains consume the most our bodies energy..

Dont think of to complex neural networks for a starter a single bot with 3 layers and 20 dots  totall, a minimum would be i think about (maybe first layer 5 next 3 next 4   >> 12 dots)
It doesnt require like 50 dots, because also the braincells could be connected to other brain cells.

Another method could be single neuron cells, but then we would require something like a species editor, to connect each cell correctly to make a neural network.
That way they consume less memory but bot creation becomes a new topic of discusion i mean how to do it in DNA, or do it without DNA ?..string discription of species maybe... ??..

39
Newbie / Darwinbots replacement/clone
« on: April 14, 2010, 02:07:59 PM »
i think your using vb6 drawing routines (based on the patern fill), these are slow, you might take a look at opengl slimDX or directX.
The fasted method might even be to not draw circles, but XOR bitmap of circles (having a few bitmap sizes in cash doesnt take much memory, or simply stretch)
Faster drawing methods will improve the speed even more.

But i dont think it works for me, not much happens when i load it.
Still i hope your code is more transparent i have given up trying to understand the original code, to much hidden variables for me to keep track off.

If your program is good structured and clear to read.
Then that would be promising.

If possible i would request more memory slots per cell, so we might later introduce real neural networks, and add some extra bot DNA math for that (sigmoid summAll etc, summWeighted).
A multibot editor (to create bots without defining complexly their shape trough DNA) would be nice too.

40
Bot Tavern / Bots with Feelings
« on: April 12, 2010, 05:56:52 PM »
basically my evolve series of bots use simple 'feelings', it is not neural programming.
Still it does result in intresting behaviour, in the first series evolve-2 the aiming was simple
So you cold spot this behaviour easily.

But i write it down in normal english, this bot shoots a bit longer shots (actually based on distance).
But every shot costs him something, the cost is reset when nothing is in eye5 (so the move gene runs)
If the eye5 gene is not running then the move gene is running
The move gene resets the missed shots (you could also write it to count them down).
Back to the eye5 gene,  if there are to many shots missed then it will perform a fixpos, and if even more shots are missed then it turns away from this difficult to get prey.
Also while in gene5 execution if it was under pain, then that counted for 3 shots (which is i think a bit low, but well that's easily changeable).

Later bots evolve series had better aiming techniques but still sometimes made use of the fixpos, or of the givingup option tricks.
As a result of that behaviour the bots didnt endlessly shoot at bots they cant get, they stop the hunt after a while.
the better aiming was gained by also moving like   *.refdx 2 div .dx store   besides the .up moves.

the code is an early version without the .dx adjustments
So its better to spot this behaviour, SIM sohuld be F1 no friction (so we get aiming problems for this bot).



[div class=\'codetop\']CODE[div class=\'codemain\' style=\'height:200px;white-space:pre;overflow:auto\']'Évolve  II
'
'Advanced shooting and aiming
'
'mainly 2 gene bot with new mechinisms
'
' Gain or pain >> eat or not, and always shoot target if insight
' simple repro gene more advaces 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 sneaky

'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



-32 *.eye5 div .shootval store
-1 .shoot store
*.sx 2 div .dx store


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

 'positive longer
 'negative smaller



'after shooting move
*.refvelup 20 add .up store


'____________________________________________________________________________
___
' pain is more then gain counts as 3 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

0 .sneaky store
stop


cond
*.nrg 30000 >

start
10 .repro store
-700 .aimdx store
7 .strbody store
11 .mkshell 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           0
'    5                  0     1    1          500
'   10                 1     2    1          500

1 .aimdx store
1 .strbody store
stop

cond
*.body *.refbody <
*.refeye *.myeye !=
*.sneaky 0 =
start
.repro .shoot store
50 .shootval store

stop

I know its a real old topic, but since i just made them (just a week ago)
And it answers this post i thought lets post it, its a basic principle, and could be used in other more advanced bots too
So if someone else gets into this thread he would get an answer.
(i came here looking for neuron based bots)



41
Mutations / Mutation: from evolve-2(x) series
« on: April 12, 2010, 08:40:41 AM »
Quote from: ashton15
Look at fish, there eyes are to the side so they can see more things such as predators or maybhe food but less likely where it doesn't disepear after a few seconds like in darwin bots... I think part of it is because dawrinbots are tremoundsly short-sighted when you think about it, they can only see the width of about 20 cells whilst we see accuratly for about quarter of a kilometer, thus darwinbots have to make the most of the little we can see, the only reason our eyes point forwards is it means we can focus eyes on a single object and I guess at some point in our brain we do some trigonometry or some other thing to work out how far away anything is, bots bieng as short-sighted as they are it's also not as important to judge distances, maybhe if you allow bots to develop longer-ranged sight (maybhe longer range costs more energy like shootval) and delete the ability to know where exactly something is (x & y co-ords) so that a bot can only judge distance on apparent size and calculations then encourage complex MBs I don't think it would be long until you get some complex solutions to sight...

Maybe your onto something, your right their eye sight is short, most bots run forward, without looking around.
Better might me adjusted vision (maybe just as narrow as an eye5) but over a longer range using eyewidth.
Then create some kind of a multibot, with a few of such good eyes, maybe 2 or or more, maybe 2 forward and a few rotating eyes.
Hmm this indeed could become a complex bots, i wonder who will be first to create such bots.

I'm trying to get a grip on neural networks, so combined withe such a bot it would be real cool

42
Bot Tavern / A Cosine function, with no tablebase usage.
« on: April 10, 2010, 08:41:25 PM »
it is scaled up from -100 to +100

43
Suggestions / Elo rating + league + bots
« on: April 10, 2010, 08:39:34 PM »
will the bots play chess then ?

 

44
Mutations / Mutation: from evolve-2(x) series
« on: April 10, 2010, 08:37:53 PM »
yes i can imagine changing eye directions and width does improve what you see.
It still is a bit strange to me as to why side moving can be so good.
its contra of what i think, i mean you design eyes so it folows a path, and now it turns out the path isnt that important.

Maybe the eye system is nothing more then a scoope  or fishnet system.
Not realy moving but a bigger mouth, as basicly in DB we dont get realy a lot of info from eyes
Mainly there is something there and we shoot eat it..
Sometimes we add extra rules to not eat it when it is one of our kind but thats about it.

45
Mutations / Mutation: from evolve-2(x) series
« on: April 09, 2010, 07:24:06 PM »
I was a bit amazed by this bot, the main movement gene was mutated to move sideways ???.
We almost never design bots to move like crabs, but apparently its not so bad.
the eyes acted more like ehmm a fishnet, the robot didn't move to fast, but still was pretty reproductive.
Only when it sees something it moves forward to eat to eat it, otherwise it walks sidewards.
I never would think it would work, but it was pretty good actually.
It had lots of offspring, and .... it seamed to catch better !!,  but why ??

Hmm maybe the side walk of a crabs in nature, does have a benefit ??

What i can think of is that the catching, although more difficult,
has less chance of chasing long, resulting, in giving up, 'out of reach targets' earlier,
and getting the ones nearby more easily...???
well its a gues.



Code: [Select]
''''''''''''''''''''''''  Gene:  1 Begins at position  1  '''''''''''''''''''''''
 cond
 *.robage 30 >
 *.eye5 0 >
 *68 0 =
 start
 *67 sgn 1 add sgn 60 store
 -32 *.eye5 div .shootval store
 -1 .shoot store
 *.refxpos *.refypos angle .setaim store
 -1 *60 mult .shoot store
 0 .fixpos store
 *.refvelup 20 add *60 mult .up store
 *.refveldx 7 div *60 mult .dx store
 *67 1 add 67 store
 *.pain *.pleas sub sgn 1 add sgn 1 sub abs 3 mult *64 add 64 store
 *.pain sgn 1 sub abs 66 store
 *0 sgn 1 sub abs *66 add sgn *64 add 64 store
 *64 150 mod sgn 1 sub -628 mult .aimright store
 *64 150 mod sgn 1 sub -1 mult .fixpos store
 *.slime 50 sub sgn 1 sub sgn -7 mult 60 store
 *.refmulti *60 mult .mkslime store
 *.eye5 40 sub sgn 1 sub sgn -1 mult *.refvelup 61 store
 *.up 60 store
 60 *0 add * .up store
 stop
''''''''''''''''''''''''  Gene:  1 Ends at position  151  '''''''''''''''''''''''

''''''''''''''''''''''''  Gene:  2 Begins at position  152  '''''''''''''''''''''''
 cond
 *.eye5 0 =
 *.robage 30 >
 *68 0 =
 start
 *.eye9 *.eye1 sub sgn 54 store
 *54 130 mult .aimright store
 *54 abs -1 add abs 5 mult .up store
 *54 abs -1 add *.mass mult .dn store
 *.robage -2 div .dx store
 10 .up store
 *.eye6 *.eye4 sub sgn 63 store
 *63 35 mult .aimright store
 *.eye6 *.eye4 add sgn abs .fixpos store
 *.pain 1 sub abs .pain store
 *54 abs 65 store
 *63 add *65 abs sgn 65 store
 *65 *64 mult 64 store
 *67 1 add 67 store
 stop
''''''''''''''''''''''''  Gene:  2 Ends at position  244  '''''''''''''''''''''''

''''''''''''''''''''''''  Gene:  3 Begins at position  245  '''''''''''''''''''''''
 cond
 *.nrg 16000 mod 0 =
 *.mass 2 >
 start
 -4 .shoot store
 *.waste .shootval store
 20 .strbody store
 20 .mkshell store
 -40 67 store
 30 68 store
 stop
''''''''''''''''''''''''  Gene:  3 Ends at position  273  '''''''''''''''''''''''

''''''''''''''''''''''''  Gene:  4 Begins at position  274  '''''''''''''''''''''''
 cond
 *.robage 30 <
 start
 *.tiepres .deltie store
 500 .dx store
 *.robage 5 sub sgn 1 add sgn 500 mult .dn store
 *.robage 20 sub 0 floor 9 mult .aimright store
 stop
''''''''''''''''''''''''  Gene:  4 Ends at position  305  '''''''''''''''''''''''

''''''''''''''''''''''''  Gene:  5 Begins at position  306  '''''''''''''''''''''''
 cond
 *68 0 >
 start
 41 .aimright store
 4 .repro store
 *68 1 sub 68 store
 stop
''''''''''''''''''''''''  Gene:  5 Ends at position  322  '''''''''''''''''''''''

''''''''''''''''''''''''  Gene:  6 Begins at position  323  '''''''''''''''''''''''
 cond
 *.body *.refbody <
 *69 20 <
 *.robage 5 mod 0 =
 start
 300 .shoot store
 50 .shootval store
 *69 1 add 69 store
 stop
''''''''''''''''''''''''  Gene:  6 Ends at position  347  '''''''''''''''''''''''

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