Author Topic: Darwinbots replacement/clone  (Read 18402 times)

Offline peterb

  • Bot Destroyer
  • ***
  • Posts: 148
    • View Profile
Darwinbots replacement/clone
« Reply #30 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.

Offline ashton15

  • Bot Builder
  • **
  • Posts: 99
    • View Profile
Darwinbots replacement/clone
« Reply #31 on: April 16, 2010, 12:20:32 PM »
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.

Offline peterb

  • Bot Destroyer
  • ***
  • Posts: 148
    • View Profile
Darwinbots replacement/clone
« Reply #32 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.)..





Offline Pascal666

  • Bot Neophyte
  • *
  • Posts: 25
    • View Profile
Darwinbots replacement/clone
« Reply #33 on: April 17, 2010, 02:03:11 PM »
The source code upload is temporarily uploaded here for anyone who wants it:
http://www.megaupload.com/?d=KAECTRY0

I have added expanding memory functions to my todo list.
And I will look into using directx as graphics engine.

My first priority now is fixing a freeze bug, and adding internet mode.

Edit:
For those already trying to simulate entities, and are bothered by the freeze bug I have uploaded a temporary patch... duplicategene, a mutation function is disabled since this is the cause of the bug.
http://www.megaupload.com/?d=0Y9NM7YW
« Last Edit: April 17, 2010, 02:29:00 PM by Pascal666 »

Offline Pascal666

  • Bot Neophyte
  • *
  • Posts: 25
    • View Profile
Darwinbots replacement/clone
« Reply #34 on: April 18, 2010, 07:05:31 AM »
Quote from: ashton15
Yeah i'm having problems with too few memory locations but i've worked out I can store multiple values in one location through a system like binary for instance so 1,1,0 might equal 6 or 2,1,0 with 3 bieng the highest posible value I'd have 63 (0*3 + 1*9 + 2*27) bit too complicated for my liking... also having a small bot circle allows an extra 22 memory locations using every memloc and out sysvar though it's not that practical as it just converts one memory location into another type that in most situations is less useful about twenty-five thousandish should be adequate to create a multi-cellular DB with human intelligence... and maybhe 400 out and in sysvars... is a neural net the same thing as having a web of what varibles every other varible alters? because that's the kinda thing I'm trying to make... I want a bot that can understand that shootval is log2 and changing it affects how far or how powerful a shot is and then that links to a formula somewhere that knows how much it should decrease shootval by because it knows that's what it has to do in order to hit an enemy and thus get energy... it doesn't just do things without thinking... that's the main problem I have with darwinbots. anyways I tried it and made this though it doesn't apear to work

condition
   readmybmem1 1 =
gene
   3 moveforwards
endgene

condition
   sight 999 <
   sight 1 >=
   samespecies 0 =
gene
   refvelocity + 3 moveforwards
   refangle setangle
endgene

condition
   mymass - bondmass 1 >
gene
   sharebmass
endgene

condition
   mymass bondmass >
   myenergy - bondenergy 250 >=
gene
   250 sharebenergy
endgene

condition
   sight 50 >
gene
   1 eat
endgene

condition
   totalbonds 0 =
   samespecies 0 =
gene
   1 writebmem1
   growbond
endgene

condition
   readmybmem1 0 =
   totalbonds 1 =
   myenergy 500 >
gene
   growbond
endgene

condition
   readmybmem1 0 =
   totalbonds 2 =
   myenergy 1500 >
gene
   growbond
endgene

condition
   myenergy 5000 >
gene
   reproduce
endgene

The problem you're having with feeding is in this gene:

condition
sight 50 >
gene
1 eat
endgene

The sight range is the distance it is away from the bot, you're feeding when its farther than 50, it should be closer than 50 "sight 50 <".



Offline ashton15

  • Bot Builder
  • **
  • Posts: 99
    • View Profile
Darwinbots replacement/clone
« Reply #35 on: April 18, 2010, 10:06:47 AM »
Quote from: Pascal666
The problem you're having with feeding is in this gene:

condition
sight 50 >
gene
1 eat
endgene

The sight range is the distance it is away from the bot, you're feeding when its farther than 50, it should be closer than 50 "sight 50 <".

Opps, I assumed it would be based on apparent size like in darwinbots, sounds like an improvement you made then... maybhe not entirely realistic, but lets just say they can sense using ultrasound

Offline peterb

  • Bot Destroyer
  • ***
  • Posts: 148
    • View Profile
Darwinbots replacement/clone
« Reply #36 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  


Offline Pascal666

  • Bot Neophyte
  • *
  • Posts: 25
    • View Profile
Darwinbots replacement/clone
« Reply #37 on: April 19, 2010, 01:52:33 PM »
Quote from: ashton15
Opps, I assumed it would be based on apparent size like in darwinbots, sounds like an improvement you made then... maybhe not entirely realistic, but lets just say they can sense using ultrasound

The number is just handled differently, there is still is a limited range and sight angle.

Quote from: peterb
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  

Personally I am not a big fan of vb.net, the speed difference shouldn't be that great either.
When I started programming aevolution I actually made a client using directx in c++, however my lack of experience(none) with c++ made the progress too slow, so I decided to use vb6.

But I dont know what you mean with arrays with negative values, as far as I know there arent any.

Offline Botsareus

  • Society makes it all backwards - there is a good reason for that
  • Bot God
  • *****
  • Posts: 4483
    • View Profile
Darwinbots replacement/clone
« Reply #38 on: April 19, 2010, 05:28:44 PM »
Quote
Personally I am not a big fan of vb.net,

I am not eather, but guess what? vb6 is almost a dino' by now...

I  have tried to build my own virsion of DB once called PusherBots. Did not get very far and deleted my source code out of annoyance. Big mistake. I believe one day we should look at all this open source stuff out there and implement the parts we like in to DB3...
« Last Edit: April 19, 2010, 05:30:06 PM by Botsareus »

Offline peterb

  • Bot Destroyer
  • ***
  • Posts: 148
    • View Profile
Darwinbots replacement/clone
« Reply #39 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.




Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Darwinbots replacement/clone
« Reply #40 on: April 19, 2010, 06:23:40 PM »
Quote from: peterb
Or maybe first investigate a good direct3d wrapper for vb.net.

See this for getting XNA working with VB.NET.  There is an actual wrapper around DirectX for managed projects (an abandoned official version an an open source alternative), but XNA is the future!  In that Microsoft is actively supporting it.  It's pretty similar to DirectX, anyway.

Quote
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.

It's actually pretty easy to do something like this in the .NET world, since the different languages get compiled down to the same intermediate language.  You just have separate projects in different languages, and "add reference" to the compiled bianry of one project in the other.

Offline peterb

  • Bot Destroyer
  • ***
  • Posts: 148
    • View Profile
Darwinbots replacement/clone
« Reply #41 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.


Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Darwinbots replacement/clone
« Reply #42 on: April 19, 2010, 07:07:39 PM »
Quote from: peterb
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.

Tao's also good, yes.  It wraps OpenGL, though, so if you've only done DirectX in the past it's going to be a bit of a learning curve (if you've done neither it's not a big deal).

Quote
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.

They both get converted by your graphics driver to raw hardware calls.  Though DirectX support tends to be better, especially from ATI.  NVidia does a pretty good job with OpenGL, which is why it's preferred for Linux.

Quote
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.

There is still support for basic drawing, as in VB6, through GDI.  This is relevant.  GDI will usually(?) be hardware accelerated, so you still get speed without messing with OpenGL or DirectX.  The downside is that it's not really meant for games and such that update the screen dozens of times a second (but then, the built in VB6 stuff isn't either).

Offline peterb

  • Bot Destroyer
  • ***
  • Posts: 148
    • View Profile
Darwinbots replacement/clone
« Reply #43 on: April 19, 2010, 07:41:08 PM »
Quote from: Numsgil
Quote from: peterb
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.

Tao's also good, yes.  It wraps OpenGL, though, so if you've only done DirectX in the past it's going to be a bit of a learning curve (if you've done neither it's not a big deal).

Quote
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.

They both get converted by your graphics driver to raw hardware calls.  Though DirectX support tends to be better, especially from ATI.  NVidia does a pretty good job with OpenGL, which is why it's preferred for Linux.

Quote
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.

There is still support for basic drawing, as in VB6, through GDI.  This is relevant.  GDI will usually(?) be hardware accelerated, so you still get speed without messing with OpenGL or DirectX.  The downside is that it's not really meant for games and such that update the screen dozens of times a second (but then, the built in VB6 stuff isn't either).


Well i've done neither, so i will slowly learn it i guess.
Ive seen now code to interop c++ also
Maybe a small program can be made using tao,  another wrapper to draw  with a few command only  circle / line / pixel /refresh /clrscr
and have a refresh command so its executed at once.
(or like drawing on a hidden screen part and then the video memory block is switched) , i asume such functions would exist


Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Darwinbots replacement/clone
« Reply #44 on: April 19, 2010, 07:56:52 PM »
Quote from: peterb
Well i've done neither, so i will slowly learn it i guess.

Word of warning: if you've never done any OpenGL/XNA/DirectX before, and don't have a real good understanding of how graphics cards work...  Well, it's going to be difficult.  You're pretty close to the metal.  Basically video cards don't know how to draw anything but triangles.  So for drawing circles you have to either tessellate it (divide it up into triangles) or draw a square with a circle texture.  And there are a lot of ways to do something, only some of which are fast.

Did you see the GDI link I posted at the bottom of my last post?  It's built right in to .NET and I think it'll save you a lot of effort.  It's based more on the "draw circle at x,y pixel position" paradigm you might be used to.