Darwinbots Forum
Bots and Simulations => Bot Tavern => Topic started by: Gambit on April 29, 2008, 11:44:12 AM
-
I'm working on a bunch of bots that will recognize each other AND recognize what species the other bot is.
they'll work togethor accordingly.
I'm using .myeye and outs and ins for the recognition.
theres one that stores massive large amounts of food and doesnt do much with it. but loves to share it with weaker bots.
1 that sends out a self destruct virus
1 that sends out a self replicating bleeder virus
and eventually some kind of multi bot that has a scout and a warrior attached to each other. or maybe a warrior that attaches itself to the sharer bot and will give up all its resources to protect it.
it would built up slime shell poison and venom and if the sharer was attacked it would give up all its resources in a flash via a tie to save the sharer.
why make all these speperate species work togethor? the answer is simple.
TO TAKE OVER THE WORLD!
p.s. has this ever been done before?
-
You should also make a strong veggy to cooperate with them... would help a lot if you're going to release them on IM.
Dunno if it's been done before... I know I thought about it... but I think I would probably just make a bot that mates with the veggies and just addapt it's behavior to the amount of energy and body it recieves per cycle.
In the end you can always put all the different behaviors into one bot, but if you want to run an evo sim it could be interesting with several small bots that work together. See if they can stay friendly long enough for some sort of balance to form, or atleast have a base that could lead to many different outcomes...
If you're going to run an evo sim you need a strong conspec, or they'll turn into canibals in no time...
-
I'm using in/out + myeye for the conspec. I'd like a third part to it. any ideas on how custom variables can be adapted for a conspec gene?
then it'd be fool proof.
here is the "Sharer" bot (Communitus_Friendlius). I need to chagne the reproduction conditions so that it will reproduce/self destruct to keep the ratio of its species to total bots at 1:5 -finished thanks to Moonfisher-
'virus nullifyer and conspec programmer
cond
*.robage 0 =
start
7 990 store
37 .out1 store
18 .myeye store
stop
'If there is no food then look for some randomly.
cond
*.eye5 0 =
*.refeye *.myeye = or
*.in1 37 = or
*.in1 38 = or
*.in1 39 = or
start
314 rnd .aimdx store
10 .up store
stop
'peripheral vision left
cond
*.eye1 0 >
*.in1 37 !=
*.in1 38 !=
*.in1 39 !=
*.refeye *.myeye !=
start
52 .aimsx store
stop
peripheral vision right
cond
*.eye9 0 >
*.in1 37 !=
*.in1 38 !=
*.in1 39 !=
*.refeye *.myeye !=
start
52 .aimdx store
stop
'if you find something chase it
cond
*.eye5 0 >
*.refnrg 3000 >
*.in1 37 !=
*.in1 38 !=
*.in1 39 !=
*.refeye *.myeye !=
start
*.refveldx .dx store
*.refvelup 30 add .up store
stop
'Attack the food if its strong enough but dont kill it. Let it live so you can feed on it
later. Though bigger bots may accidentally kill prey.
cond
*.eye5 50 >
*.refnrg 3000 >
*.in1 37 !=
*.in1 38 !=
*.in1 39 !=
*.refeye *.myeye !=
start
16 .shootval store
-1 .shoot store
*.refvelup .up store
stop
'poop
cond
*.waste 200 >
start
.backshot inc
-4 .shoot store
*.waste .shootval store
stop
'if you find something that isnt food (a relative) heal it if it needs
cond
*.eye5 50 >
*.refeye *.myeye !=
*.in1 37 = or
*.in1 38 = or
*.in1 39 = or
*.refnrg 5000 <
*.nrg 5000 >
start
-2 .shoot store
stop
'eat body
cond
*.nrg 3 div
*.body sub dup
start
.strbody store - .fdbody store
stop
'if you get huge and there arent enough of your species reproduce
cond
*.totalbots *.totalmyspecies 6 div >
*.nrg 9000 >
start
40 .repro store
stop
end
-
okay I just tested it and the gene moonfisher gave me is defective... and he didnt give me a warrenty
so I think I may have to have 2-3 different
if totalbots equals about this AND totalmyspecies is under this THEN you should reproduce
with each one getting higher
the totalbots I'm thinking
near 100
near 500
near 1000
so like
cond
*.totalbots 1 >
*.totalbots 100 <
*.totalmyspecies 15 <
start
40 .repro store
stop
cond
*.totalbots 100 >
*.totalbots 500 <
*.totalmyspecies 100 <
start
40 .repro store
stop
cond
*.totalbots 500 >
*.totalmyspecies 200 <
start
40 .repro store
stop
I'd still like to have a more adaptive solution but if I cant come up with one I guess I'll have to use those 3...
-
start
*.totalmyspecies 100 mult *.totalbots div 10 <
40 .repro store
stop
Reproduces if the bot's population is below 10% of the total sim population.
-
cool. thank you.
-
If you're making a multibot, the best form of food I have found is stringy (ie uses ties to form clusters). This means a bot can harvest through a chain of veggies without having much difficulty searching for food.. If you're going to make a boung of species, then coordinate their tactics for shots accordingly, make larger venomous bots to slow an enemy, and the smaller ones to feed and kill.
Also it looks like you put some conditions after the start command....
-
If you use .memloc and .memval, you can use custom memory locations as conspec. A good idea when including veggies is to harvest them until they have a small amount of nrg left so they don't die and defend the veggies, and kill them when the threshold is reached so high-nrg veggies can reproduce.
-
Hmmm, never tested the gene... that'll teach you not to trust strangers !
Not sure why the gene didn't work, I guess I either messed up or maybe the boolean stack doesn't accept decimal values... (Noticed Eric scaled the values in his condition) If that's the case it would explain some bugs I've had in the past
And the condition after the start is just an inline condition... an option that was added recently...
-
Not sure why the gene didn't work, I guess I either messed up or maybe the boolean stack doesn't accept decimal values... (Noticed Eric scaled the values in his condition) If that's the case it would explain some bugs I've had in the past
The integer stack does not accept decimals. That's why its called an integer stack. Thus, if you want to do decimal arithmetic, you need to do it with whole numbers and handle the place shift yourself. Values on the stack can be large, like 20,000,000,000 but you can't put them there directly since the value of any given DNA bp that is a number must be an integer in the range -32000 to 32000.
-
To follow up Eric's post, this is actually a good thing, because it means floating point errors won't bite you in the butt. Ie: 1 10 div 10 mult wouldn't necessarily equal 1 even if the stack handled decimals.
-
Heh... integer stack... ok
But if you divide 1 by 10 and then mulitply by 10 in a stack that handles decimals... why would the result not always be 1 ???
To the best of my memmory : 1/10 = 0.1, 0.1 * 10 = 1....
And if it didn't handle decimals... wouldn't it just always be 0 ?
Just not sure what you point was ? Why is it a good thing ? (Not saying it's a bad thing... just... nevermind...)
-
See this link (http://www.parashift.com/c++-faq-lite/newbie.html#faq-29.17). Algebraically 1 10 div 10 mult should equal 1, but the realities of computers make it so this is not always the case. .1 is impossible to represent exactly using decimals on a computer. It's like 1/3 in decimal (ie: .3333333). Worse yet, the actual value of .1 will vary on different computers or programs or languages depending on all sorts of factors, some even on the hardware level.
By using integer math, the value you get will always be predictable and the same on all computers, hardware, etc. It might not always be "correct", but at least it's deterministically incorrect. You can compensate for it by doing a little fixed point math. ie: 1 1000 mult 10 div 10 mult 1000 div, which will always give you the correct answer of 1 even on different hardware, different languages, different drivers, etc.
-
Funny to see forums like these lead to conversations that have nothing to do with their title
-
We (well, I really) have never been very good at staying on topic
-
Heh didn't know that... figured a double just ment you had 2 times 32 bits for your value...
I can see that 1 3 div 3 mult could give 0.9999... instead of 1... but never figured 1 10 div 10 mult wouldn't always be 1...
It's a good thing I scaled everything in my newest Neural Network then... can't save decimals in the nodes anyway...
And it seems like we often end up only reading the topics on top (Visible from the main page), so those end up going off in random directions