Author Topic: what's a bot made off  (Read 6922 times)

Offline PermanentMarker

  • Bot Neophyte
  • *
  • Posts: 1
    • View Profile
what's a bot made off
« 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.

Offline EricL

  • Administrator
  • Bot God
  • *****
  • Posts: 2266
    • View Profile
what's a bot made off
« Reply #1 on: July 14, 2006, 11:15:46 PM »
Most of the questions you are asking are well documented on the wiki.

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.  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 are particularly useful in helping to explain things.
Many beers....

Offline PurpleYouko

  • Bot God
  • *****
  • Posts: 2556
    • View Profile
what's a bot made off
« Reply #2 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.  
There are 10 kinds of people in the world
Those who understand binary.
and those who don't

:D PY :D

Offline shvarz

  • Bot God
  • *****
  • Posts: 1341
    • View Profile
what's a bot made off
« Reply #3 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...
"Never underestimate the power of stupid things in big numbers" - Serious Sam

Offline PurpleYouko

  • Bot God
  • *****
  • Posts: 2556
    • View Profile
what's a bot made off
« Reply #4 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......
There are 10 kinds of people in the world
Those who understand binary.
and those who don't

:D PY :D

Offline shvarz

  • Bot God
  • *****
  • Posts: 1341
    • View Profile
what's a bot made off
« Reply #5 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.
"Never underestimate the power of stupid things in big numbers" - Serious Sam

Offline PurpleYouko

  • Bot God
  • *****
  • Posts: 2556
    • View Profile
what's a bot made off
« Reply #6 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.
There are 10 kinds of people in the world
Those who understand binary.
and those who don't

:D PY :D

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
what's a bot made off
« Reply #7 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.

Offline Jorge Bucarán

  • Bot Neophyte
  • *
  • Posts: 2
    • View Profile
what's a bot made off
« Reply #8 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. 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.

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
what's a bot made off
« Reply #9 on: July 20, 2006, 11:48:02 AM »
Couldn't have said it better myself

Offline EricL

  • Administrator
  • Bot God
  • *****
  • Posts: 2266
    • View Profile
what's a bot made off
« Reply #10 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.
« Last Edit: July 20, 2006, 12:18:55 PM by EricL »
Many beers....

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
what's a bot made off
« Reply #11 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

Offline Jorge Bucarán

  • Bot Neophyte
  • *
  • Posts: 2
    • View Profile
what's a bot made off
« Reply #12 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"


 

Offline Testlund

  • Bot God
  • *****
  • Posts: 1574
    • View Profile
what's a bot made off
« Reply #13 on: July 20, 2006, 01:46:37 PM »
Yeah, I like that little fella' much better too. Hehe.
The internet is corrupt and controlled by criminally minded people.

Offline EricL

  • Administrator
  • Bot God
  • *****
  • Posts: 2266
    • View Profile
what's a bot made off
« Reply #14 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.  It should come out in a week or so.
Many beers....