Welcome To Darwinbots > Newbie
Overall Concept
Trooper5445:
Well I've been trying to create a bot for a while now and I've found I'm having a lot of trouble. To be honest what is messing me up is the fact that I am somehow lacking the "big picture." I can read others code and understand, and I know what I want my bots to do, but I don't understand the way the variables and functions interact to actually do it. Espcially for the latest version. Everytime I try the wiki I want to know something it just links me to another page until I forget what I was after in the first place.
So I suppose I'm just frustrated and looking for analysis of the variables in the latest version.
It isn't really a question but I was wondering if anyone else has had a similar experience or has some help? Thanks for whatever you can provide.
EricL:
Hi. Welcome aboard.
Happy to help, but can you give me a little more info? Do you understand the RPN notation the DNA uses? Gene structure? The difference between the DNA and the bot's memory? You should start simple, with just a few sysvars, like .up and .shoot. Get your bot to move and shoot. All else will follow.
Trooper5445:
I'm at the basic stage. I can get the thing to move but I'm not sure how to do advanced structures. Theoretically speaking I want the bot to halt all functions until a certain gene is activated which allows other genes to activate. The idea is have a bot rotates using little energy, and waits for prey to approach. It then rapidly accelerates and attacks the prey. Reproduction would be asexual and based on a high energy count. I uploaded a couple of my test organisms to the server (where they will be slaughtered in under a 100 cycles probably.)
Here is what I have so far:
--- Code: ---' L-Sesilia
' Gene 5 - Reproduce
cond
*.nrg 7500 >
start
50 .repro store
stop
' Gene 4 - Shoot the food
cond
*.eye5 40 >
start
-1 .shoot store
stop
' Gene 3 - Persue Food
cond
*.refye 5 !=
start
5 .up store
stop
' Gene 2 - Avoid Friendlies
cond
*.refeye 5 =
start
-104 .aimdx store
stop
' Gene 1 - Detect Enemies
cond
*.eye1 *.eye5 >
start
-104 .aimdx store
stop
end
--- End code ---
In case your curious about the name, it is Lazy Sesillia and the word sessile describes an organism that does not move of its own power.
But the point of this thread was that it was very general. That is what I want to do with one bot, but I just generally lack and understanding of the variables and the ways in which they can be manipulated to accomplish a task.
As to your questions I do indeed understand RPN and Gene structure. I'm a little shaky on the difference between DNA and memory. As for your questions sessilia has maxed out its population in the 30s but does move and eat and reproduce.
Shasta:
Hey don't worry its pretty confusing at first, here are some things to help you out.
[blockquote]The Operators and Sysvars pages contain the most helpful information in the wiki (to me at least) it lists all the ways you can effect anything the bot does or is in its memory
I know you said you dont want to use anyone else's code in your bots, but that is really the easiest way to learn, the Basic Bot tutorial breaks down Animal Minimalis very well. Or try modifying Animal Minimalis to use some shell or slime or shoot a virus. (the advanced shot bot tutorial covers this a bit and is a good follow up on the basic bot one.)
As for how variables work, to create a variable (w/ a name) you must type
--- Code: ---def myname location
--- End code ---
were the location is a free variable slot, 50 - ~180 is the preferred range I believe
As for how the variables and functions work to make the bot perform a task, think of it as all your math and conditions are the bot thinking, while a store command is the bot doing something, weither it has thought about it or not
so as in Animal Minimalis's first gene:
--- Code: ---<pre> *.eye5 0 >
*.refeye *.myeye !=
</pre>
--- End code ---
here the bot is deciding if it is looking at food or not
--- Code: ---*.refveldx .dx store
*.refvelup 30 add .up store
--- End code ---
and here the bot is acting upon that decision by following the food
[/blockquote]I hope that helps If I have said something wrong please correct me I really should be asleep right now.
>_< not really necessary now, yea for typing slow hope it still helps
EricL:
Okay, cool. So, what you need to do to accomplish what you want is to use a "free" memory location as a flag that you set in your enemy detection gene and use the value of the flag as a condition is the rest of the genes. By free, I mean a location that simulator does not interpret as an instruction by the bot to do something or a location where it will write something. Only about 250 of the 1000 memory locations every bot has are used by the simulaotr. The rest are totally under bot control to do with what it wants. Locations 50-175 are guarenteed to be free for the forseeable future I.e. I won;t use them for new features down the road.
So, do something like this:
'Set location 50 to 1 if I see something in eye5
cond
*.eye5 0 >
start
1 50 store
stop
'Set location 50 to 0 if I don't see anything
cond
*.eye5 0 =
start
0 50 store
stop
'Shoot if location 50 is non zero
cond
*50 0 !=
start
-1 .shoot store
stop
EDIT: Ah, Shasta beat me to it with better advice...
Navigation
[0] Message Index
[#] Next page
Go to full version