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 - Jorge Bucarán

Pages: [1]
1
Newbie / what's a bot made off
« 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"


 

2
Newbie / what's a bot made off
« 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.

Pages: [1]