Darwinbots Forum

Welcome To Darwinbots => Newbie => Topic started by: PermanentMarker on July 14, 2006, 06:51:47 PM

Title: what's a bot made off
Post by: PermanentMarker on July 14, 2006, 06:51:47 PM
The funny thing is I had programming ideas much the same like this program.
Altough some differences mainly the bots, and I'm confused about it.
I mean I've read many articles by now but it's still hocus pocus manuals.

Isn't there any good manual about first all the kind of inputs we have (and where they are located)
so .eye5 is in front (I believe) but how many eyes are there 8 9 or 10 or ????

Next there are a lot of referals to memory locations some seam to have functions too.
Well to say it simply how does the skeleton look like, what is the adres range and which adres boxes are for wel .eyex of for movement or just for calculation storage of memory valuse for own formula's.

Next part what's the instruction set or the math used here.
Simply a turn 90 degrees is like....
A turn of n degrees by a variable is notated as ....
this brings me to the math part, what functions are out there ?

And are there specialities involved like for example shielding / poisening / camouflage /sleeping  etc.
How are they notated.

I think the project lacks a bit fundamental explaining.

(the worst explain I saw someone posting a part of vb6 code only...)

If you want to get momentum (people liking this) I think a good documentation is essential.

Perhaps a little application to write down your own bot trough a GUI.
I could create such GUI but cann't do it as it a bit to much of hocus pocus currently, altough I like the idea (as I had this myself too)

so anyone out there is there a real complete explanation of this software?
As I don't want to spend a week to understand this by combining 10 articles.
Title: what's a bot made off
Post by: EricL on July 14, 2006, 11:15:46 PM
Most of the questions you are asking are well documented on the wiki (http://www.darwinbots.com/WikiManual/index.php?title=Introduction).

In breif, bots are defined by their DNA and a 1000 location integer valued state array.  Locations in the array define the world as perceived by the bot and also are the means by which bots, via the exection of their DNA, interact with the world.  Most of the intersting array locations are defined by specific Sysvars. (http://www.darwinbots.com/WikiManual/index.php?title=Sysvars)  For example, location 505, as described on the sysvar's page  (known as sysvar .eye5 - there are 9 eyes by the way) will contain "a value inversly proportional to the bot's distance from a viewed robot. Each eye views a 10 degree arc."

The tutorials (http://www.darwinbots.com/WikiManual/index.php?title=Robot_Tutorial) are particularly useful in helping to explain things.
Title: what's a bot made off
Post by: PurpleYouko on July 17, 2006, 08:47:01 AM
Why not try looking in the "Help" menu at the top of your screen?

It covers all of the basics but not some of the more recent additions (because nobody ever updates it apparently)
I went to a lot of trouble to write up all that stuff sometime around V2.3 and it still amazes me that so few people even bother to look at it.  
Title: what's a bot made off
Post by: shvarz on July 19, 2006, 02:53:45 PM
There is a couple of reasons for people not using help.  I, myself,  rarely use "help" in programs, only when I am already familiar with them and want to find a specific thing that I forgot how to do.  Also, I never expected a program made by a couple of guys to actually have anything useful in "Help" menu.  Usually all you can find there is "About" and that's it.

Maybe this info needs to be placed somewhere else?  Maybe on the splash-screen there should be written in big letters: "Look in the help menu for help with bot design!"  Something like that...
Title: what's a bot made off
Post by: PurpleYouko on July 19, 2006, 02:59:02 PM
Are you telling me that even you didn't know it was there?  

Good grief.

Well personally I always go to the help menu in every program I ever use. As you say, a lot of the time there isn't anything useful there but you never know......
Title: what's a bot made off
Post by: shvarz on July 19, 2006, 03:57:26 PM
Yes,  I mean no, I mean I did not know about it until you mentioned it some time ago (it's been awhile).

I guess users have their own preferences.  Difficult to please everyone.
Title: what's a bot made off
Post by: PurpleYouko on July 19, 2006, 04:02:16 PM
Perhaps we shold just add an extra top level menu item and call it..... I dunno... DNA Explanations or something.
Title: what's a bot made off
Post by: Numsgil on July 19, 2006, 04:08:56 PM
Part of the issue is the way the patches work.  When I first get a program like Darwinbots, I usually look around in it before I go find a patch.  That's why I missed the help menu when I first started with Darwinbots.

I think ideally we could tie in the wiki to the program at least in an artificial way.  Maybe something as simple as a button for the "virtual manual", which boots up your internet browser of choice.  It's simply too difficult to keep any help files updated unless they're easily modifiable and instantly distributable.
Title: what's a bot made off
Post by: Jorge Bucarán on July 20, 2006, 10:09:39 AM
Hi all, my first post.
 
Let me try to help you a bit <PermanentMarker>. DarwinBots is a remarkable software and we must "thank" all programmers working on it, specially the original creator Carlo Comis. However, I agree with you, the interface is not the most intuitive, but that is not a reason to turn the program down, they will get around it eventually.

Q1: Isn't there any good manual about first all the kind of inputs we have (and where they are located) so .eye5 is in front (I believe) but how many eyes are there 8 9 or 10 or ????

A1: Yes you can start reading the manual; http://www.darwinbots.com/FTP/DarwinTutorial1+2.zip (http://www.darwinbots.com/FTP/DarwinTutorial1+2.zip). Check the end of the post to read my quick-start tutorial.


Q2: Next there are a lot of referals to memory locations some seam to have functions too. Well to say it simply how does the skeleton look like, what is the address range and which address boxes are for well .eyex of for movement or just for calculation storage of memory values for own formula's.

A2: Check the sysvars.txt text file located with your binary distribution of DarwinBots (look in the DarwinBotsII folder if you managed to install the software). This file contains the memory locations for the so-called functions, something like this:

up
1
dn
2
sx
3
dx
4
aimdx
5
aimsx
6

poisoned
838
backshot
900
aimshoot
901

Notice that not all the locations are used, I have not try this yet but I assume you can store data in there.


Q3:Next part what's the instruction set or the math used here.
Simply a turn 90 degrees is like....A turn of n degrees by a variable is notated as ....
this brings me to the math part, what functions are out there ?


A3: There are logic combiners (=, >,>=,<,<=,!=), math functions (sub,add,inc, ...). Check the end of the post to read my quick-start tutorial.


Q4: "..I think the project lacks a bit fundamental explaining... so anyone out there is there a real complete explanation of this software? ..As I don't want to spend a week to understand this by combining 10 articles.."

A4: It lacks integration of explanations, but all you need is out there, you just have to be persistent. And trust me, you won't spend a week trying to understand DarwinBots.


As a final note I have to say, I understand you, many programmers (I want to think you are) we hate to read help files because we think that a program must be easy to "get" because if we'd had made it, even 6 year old kids would easily follow. But the truth is being a good programmer does not make you a "good" user. I am a average programmer but a very lousy user, so go figure!  

DarwinBots QuickStart  

A DNA is a set of genes defining a particular specie. Genes are fragments of code that tell robots how to act upon a condition. If you are a programmer, think of the DNA as a Class that specifies how all the organisms of the specie instances behave. A robot's DNA is read and executed once in a life cycle. In the cycle, the program checks the conditions of the genes and when these are met it executes the specified instruction. A gene is something like this:

cond ‘IF
5000 .nrg > ’Energy > 5000 THEN

start ‘BEGIN OF GENE
4 .up store ‘STORE 4 IN THE UP VARIABLE ACCELERATING BY 4

stop ‘END OF GENE

end ‘END OF DNA

The command <store> is very common, you use it like calling a function. For example, storing 4 in the <up> variable accelerates by 4 the robot in the current eye's direction. In this way, something like this [4 .up store] is like [AccelerateRobot(4)].

The problem with DNA is how you write the code, it uses reverse polish notation. This notation is awful to follow for a human, but it has some benefits. Scanning and parsing the code is easy using a stack approach, this makes the robot life cycle execute faster. In the future I foresee a DarwinBots compiler that will spit today’s assembly like DB-DNA code and takes as input a much better an easier conditional programming language.

Now let’s go technical. The <cond> keyword indicates the beginning of a gene it just says that the code following is a condition. The <start> keyword says that the code following is a series of instructions (or just one instruction) to execute when the condition is met. The <stop> keyword marks the end of the gene. You can put all the genes you want. The <end> keyword marks the end of the DNA. Also, you can specify no condition, that is the keyword <cond> followed by <start> with the instructions you want always to execute.

‘scarybot
cond
  *.eye5 10  > ‘if there is something approaching in the center of my vision field
start
  628 .aimdx store ‘turn to the opposite direction
  10   .up store ‘give a boost of 10 to accelerate away
stop

cond
  *.vel 30 < ‘if the speed is below 30 (the max)
start
  4 .up store ‘accelerate by 4.
stop

end

Play this bot, is very stupid and seems to be scared all time. Whenever something gets close to the center of its vision field, it turns back and runs away. Try to enhance this by checking for other directions in its vision field, adding the ability to fight and reproduce, etc.

This should help.
Title: what's a bot made off
Post by: Numsgil on July 20, 2006, 11:48:02 AM
Couldn't have said it better myself
Title: what's a bot made off
Post by: EricL on July 20, 2006, 12:18:00 PM
Ditto.  Welcome aboard to both Jorge and PM.  Any assistnace anyone wants to provide in making Wiki more intuitive and complete is very welcome.

Hey Nums, the mouse is back!  I missed that guy.
Title: what's a bot made off
Post by: Numsgil on July 20, 2006, 12:21:51 PM
Yeah, I just never felt comfortable with the monkey.  Made people think I was bald with a permanent dumbstruck look on my face

Much prefer to have people think of me as a clever mouse
Title: what's a bot made off
Post by: Jorge Bucarán on July 20, 2006, 01:45:48 PM
Hi back. Thanks Numsgil and EricL. If I may share this, I was trying to run the code yesterday, (I just downloaded), and was chaning this variable, MainDir and had so much fun reading the following comments:

  'this little snippet insures that Numsgil can run his code alright
 If Left(MDIForm1.MainDir, 15) = "C:\darwinsource" Then _
    MDIForm1.MainDir = "C:\DarwinbotsII"

   
  ' Here's another hack like the above so that EricL can run in VB
 If Left(MDIForm1.MainDir, 51) = "C:\Documents and Settings\Eric\Desktop\DB VB Source" Then _
    MDIForm1.MainDir = "C:\Program Files\DarwinBotsII"


 
Title: what's a bot made off
Post by: Testlund on July 20, 2006, 01:46:37 PM
Yeah, I like that little fella' much better too. Hehe.
Title: what's a bot made off
Post by: EricL on July 20, 2006, 03:35:39 PM
Quote from: Jorge Bucarán
I was trying to run the code yesterday, (I just downloaded), and was chaning this variable...

Gack!  Someone is looking at the source!  I guess I should write better comments than I have been!

FYI, I don't post the source for buddy drops, so the latest source is for 2.42.7.  To see the list of changes I've made, look at the appropraite topic in Bugs and Fixes.  Here is the one for the forthcoming 2.42.8 (http://www.darwinbots.com/Forum/index.php?act=ST&f=10&t=1439&st=0).  It should come out in a week or so.
Title: what's a bot made off
Post by: Jorge Doménico Bucarán Romano on July 20, 2006, 04:39:19 PM
Well yes, someone is looking at it. If you let me, I must say I'm very thrilled about this life simulation topic. I specially like DB since it allows for the creation of your own species' DNA. I wish I can sort out my time and start making a similar project of my own, but first I must follow all the way you guys been taking, you sure have a monster (written in VB   ).

Right now Im concerned with writing DNA. You can do many things and it is fun to code since it resembles assembly (so anyone who never "got" assembly well (me for the sake) can live the dream there). I should ask this in a different post, but I was thinking; Do you keep coming up with better Bots constantly or you think you have reached a state of near-perfection in what DNA-ASM humbly provides? This question is for everyone.
Title: what's a bot made off
Post by: Numsgil on July 20, 2006, 05:21:50 PM
Assembly really clicked after I learned Darwinbots.  There's some differences but they just sort of feel the same.

Bot perfection seems to be attained... only to be bested.  There's still room for growth.  Most top bots take about a weekend to write.  My first bot which more or less dominated F1 when it came out took about a week to tweek, but the base was ready very quickly.

Things have gotten a little harder now with bots that are single genes.  It's impressive, but the result is quite difficult to decode and moderately annoying to encode, which has, I think, slowed down combat bot creation a little.

To give you an idea though, Animal Minimalis is in the leagues and it's about as simple as it gets.  It's not that hard to get a bot somewhere in the leageues.
--------------------------
If you're a programmer (either VB or C++) and want to help code after you get your feet wet, you could help either Eric or me.  I'm working (slowly) on a C++ port that's hopefully a little cleaner and easier to maintain.  Eric's maintaining and adding to the VB version, which has the benefit of actually being "done"   You can look here (http://www.darwinbots.com/WikiManual/index.php?title=C_plus_plus_version) for info on the C++ port.
Title: what's a bot made off
Post by: Jorge Doménico Bucarán Romano on July 20, 2006, 06:30:38 PM
Thank you. I am definetely interested. Also, I want to learn the principles of life, evolution, reproduction, metabolism, interaction, creation and many other realted topics. I see DB as a great idea. One can get fascinated about it, and have a lot of fun with it, but ultimately, we as "scientists" must keep developing this idea, learning and trying to do new things.

I have to check the C++ info link with more calm, but I like that one of the reasons is because you know more C++ than VB. I have not check the code, hope you dont have all done. Finally, tell me, what do you (and you guys) know on genetics and biology, your source of information actually. Do not tell me you are nano-bio-tech engeneers or something. Well, share.