Welcome To Darwinbots > Newbie
Daunted newbie on the killer bot making tour
Endy:
If your curious, I made a tutorial going over how to use math for conditions in Single Gene bots. These aren't really the best bots to begin trying to code, though.
Playing with the dna of an existing relativly simple bot is probably your best bet. Animal_minimalis is a decent one for that.
spiceant:
so far I'v made the simplest of bots ie one that makes shell, body and slime and if I take a look at the energy it appears to work as it looses energy when above 3000 untill it has full shell/body or whatever which works completely ok, however is it possible to see if a bot has made shell or slime directly?
also I dont quite get another thing, how to for example make an action that will use (a+b)*c= body -> energy or a/(b+(c*d)) or for that matter anything that goes beyond a+b. single variables are ok but I dont quite get it from staring at any other bots.
is it possible to combine booleans (assuming true =1 false=0) into it, ie. [booleanA]*200+2000?
how can I expect math to occur here? I dont suppose div and mult go before add or sub, considdering the code nature of bots in DB.
one of the ant bots I downloaded (basicly made up of queen's and workers) works perfectly (makes big queen cells and active worker cells) in 2.4.A but rather odd under 2.37.6
PurpleYouko:
Hi Spiceant. Welcome to DB.
--- Quote ---how can I expect math to occur here? I dont suppose div and mult go before add or sub, considdering the code nature of bots in DB.
--- End quote ---
Math in DB is similar to assembly language. It uses a stack system with 20 compartments. Whenever the program encounters a "sysvar" such as .up or a number like 26, it "pushes" the value onto the stack so that it fills up like a pile of pancakes.
Mathematical operators normally only act on the top two values in the stack so there is no hierarchy of math commands like you get in a calculator or in Excel.
Let's say the top of your stack looks like this..
Stack position...Value
* 1
* 56
* 0
* 2You can only access the top two values. here are a few ways that the code will use them.
store
this will totally remove the top two values, then store the value in position 2 into the memory location stored in position 1. In this case it will store 56 into .up (memory position 1) and make your bot accelerete forward.
add
This will remove the top two values, then add them together and finally return them to the top of the stack. Top value will now be 57.
add mult
This will first do the same as add did but then it will again remove the top two values (now 57 and 0) and multiply them together, placing the result back on top of the stack. The stack will now only have two values, 0 and 2. Mult is very useful command to remove unwanted junk from the stack.
Does that make any more sense now or am I just digging a deeper hole?
spiceant:
if I replace a number of <500> everywhere in a DNA will it always be the same if I replace those with <200 300 add> (without the <>)?
when I use the tie functions that do not specificy that they affect other tied up bots (like fixlen or fixang which adjust tie length and angle) will they limit their effects to the bot executing the functions? (so that adjusting angle doesnt make any or a 2nd bot swing somewhere as if it were hit by a bat)
if I want to change the angle of a bot's eye (in a multibot with hardened ties) do I have to use tie functions to make it happen?
do functions that involve angles always refer to the bots eye´s angle (in which direction its looking)?
how do I find values like venom, poison, slimy, shell, body or nrg points while a sim runs?
how do I get DB to always turn the 1rst bot I load turn yellow the 2nd blue 3rd purple and 4th red? or do I have to manually change the colors if they are similar to the color of other bots or DB's background, each time I load them? <-- suggestion :boing:
anyway iv been improving the tutorial bot to increase its body size according to a 5:1 ratio with nrg (5nrg=1body), it also wanders around if it doesnt see alien life and it also makes a bit of shell when it has a body and nrg surpluss. (it increases body/shell before repro-ing at 20K nrg)
league runs (50 each) showed each new gene improved performance compared to its ancestor, before I accepted it and moved on to another improvement.
edit: ill change the bot to considder variables more so it doesnt just depend on fixed values (like I did with the 5nrg/body ratio)
I also think of making it a battery bot that will in one or another way make the veggy a shell (and later slime to) so the bots ancestors cant hurt it bad enough.
regards and goodnight everything :sleep2:
Numsgil:
--- Quote ---if I replace a number of <500> everywhere in a DNA will it always be the same if I replace those with <200 300 add> (without the <>)?
--- End quote ---
yep
--- Quote ---when I use the tie functions that do not specificy that they affect other tied up bots (like fixlen or fixang which adjust tie length and angle) will they limit their effects to the bot executing the functions? (so that adjusting angle doesnt make any or a 2nd bot swing somewhere as if it were hit by a bat)
if I want to change the angle of a bot's eye (in a multibot with hardened ties) do I have to use tie functions to make it happen?
--- End quote ---
This sort of stuff is really unpredictable. The physics engine in 2.37 is seriously incapable of handling this in a smooth and repeatable fashion.
--- Quote ---do functions that involve angles always refer to the bots eye´s angle (in which direction its looking)?
--- End quote ---
Most do, yes. I beleive .setaim and .aim are the exception (which measure angles from ---->)
--- Quote ---how do I find values like venom, poison, slimy, shell, body or nrg points while a sim runs?
--- End quote ---
Open the console (by right clicking the bot and selecting that command).
Type ? .somesysvar to read back the value of that sysvar.
? .venom
I may be a bit off on syntax though, feel free to read the console help.
--- Quote ---how do I get DB to always turn the 1rst bot I load turn yellow the 2nd blue 3rd purple and 4th red? or do I have to manually change the colors if they are similar to the color of other bots or DB's background, each time I load them? <-- suggestion :boing:
--- End quote ---
Manually, yes. When you first load in a species a random color is assigned. Be grateful, it sued to just assign black to all of them. :P
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version