Darwinbots Forum

Welcome To Darwinbots => Newbie => Topic started by: southpointingchariot on June 28, 2012, 12:25:13 PM

Title: Best thing ever
Post by: southpointingchariot on June 28, 2012, 12:25:13 PM
After looking at various programming game/organic things, I ran into this, and have been extremely excited so far. I have no real experience with stack languages, so I'm trying to piece together an understanding from the Wiki - is there a more cohesive step-by-step tutorial? I've been running a simulation for about 4 hours now - whoever made Callidus apparently knew what they were doing.
Title: Re: Best thing ever
Post by: Numsgil on June 28, 2012, 12:34:07 PM
You'd be hard pressed to find anything more comprehensive than the wiki.  Have you looked at the tutorials (http://wiki.darwinbots.com/w/Robot_Tutorial) yet?

But really it won't make sense until you try to write a bot and debug it.
Title: Re: Best thing ever
Post by: southpointingchariot on June 28, 2012, 01:25:03 PM
You'd be hard pressed to find anything more comprehensive than the wiki.  Have you looked at the tutorials (http://wiki.darwinbots.com/w/Robot_Tutorial) yet?

But really it won't make sense until you try to write a bot and debug it.

It's not really a lack of information - clearly a lot of work has been put in - it's just a bit tricky to figure out what to do in what order to learn. Obviously, its an encyclopedia, not a tutorial. The bot tutorials are very helpful, and what I'm trying to go through. But I'm not totally sure what the next step should be.

Maybe I should outline what I'm thinking and get advice. The two ideas that have popped into my head watching sims are:

1. I'd like to do some experiments with sustainability. Using default levels of photosynthesis, develop a way for a population of very basic veggies and single bots to start with random values and through mutation reach a sustainable level of consumption as quickly as possible.

2. Just try and get meaningful evolution as quickly as possible.

That's not terribly specific, but they're the projects I'd like to work on. Any thoughts?
Title: Re: Best thing ever
Post by: Numsgil on June 28, 2012, 01:55:05 PM
If you're looking to create a stable ecosystem your best bet is to write a bot that will also cannibalize other bots.  That's a great way to have the population be self limiting, and it's an evolutionarily stable strategy.  Try starting with animal minimalis and start tweaking it's conspec code.  The easiest is just to have no conspec check at all.  But you could also try more sophisticated strategies such as not trying to feed from children or parents.  (You could use in/out pairs to broadcast unique IDs for parents and children).
Title: Re: Best thing ever
Post by: southpointingchariot on June 28, 2012, 02:10:37 PM
If you're looking to create a stable ecosystem your best bet is to write a bot that will also cannibalize other bots.  That's a great way to have the population be self limiting, and it's an evolutionarily stable strategy.  Try starting with animal minimalis and start tweaking it's conspec code.  The easiest is just to have no conspec check at all.  But you could also try more sophisticated strategies such as not trying to feed from children or parents.  (You could use in/out pairs to broadcast unique IDs for parents and children).

Thank you very much! What exactly does conspec stand for? Is there a way to run two simulations at once?
Title: Re: Best thing ever
Post by: Numsgil on June 28, 2012, 02:18:28 PM
It's short for conspecies (http://www.talktalk.co.uk/reference/dictionaries/difficultwords/data/d0003803.html).  Or more specifically, conspec recognition (http://wiki.darwinbots.com/w/Conspec_recognition).

You'll need to run two instances of Darwinbots at the same time, but yeah, you can run more than one simulation at the same time.  That's actually the only way to use more than one core if you have a multicore machine.
Title: Re: Best thing ever
Post by: southpointingchariot on June 28, 2012, 03:06:28 PM
It's short for conspecies (http://www.talktalk.co.uk/reference/dictionaries/difficultwords/data/d0003803.html).  Or more specifically, conspec recognition (http://wiki.darwinbots.com/w/Conspec_recognition).

You'll need to run two instances of Darwinbots at the same time, but yeah, you can run more than one simulation at the same time.  That's actually the only way to use more than one core if you have a multicore machine.

Again, thank you. A few more random questions:

1. After a simulation has been running for a while, how do you copy the code of an evolved bot?
2. Veggies are spontaneously appearing - how do you turn that off? Veggies can reproduce right?
3. Is there any methodology that allows bots to mix their code to form an offspring?
Title: Re: Best thing ever
Post by: Numsgil on June 28, 2012, 04:29:58 PM
It's short for conspecies (http://www.talktalk.co.uk/reference/dictionaries/difficultwords/data/d0003803.html).  Or more specifically, conspec recognition (http://wiki.darwinbots.com/w/Conspec_recognition).

You'll need to run two instances of Darwinbots at the same time, but yeah, you can run more than one simulation at the same time.  That's actually the only way to use more than one core if you have a multicore machine.

Again, thank you. A few more random questions:

1. After a simulation has been running for a while, how do you copy the code of an evolved bot?

If you double click on a bot in the sim, you can open up a properties page and view its DNA.  From that I usually just copy+paste.

Quote
2. Veggies are spontaneously appearing - how do you turn that off? Veggies can reproduce right?

Look for "veggy repop" in the options.  There's a whole slew of ways to tweak it.

Quote
3. Is there any methodology that allows bots to mix their code to form an offspring?

There's a form of sexual reproduction, but I don't know if it's currently working.  Here's the article on it (http://wiki.darwinbots.com/w/.sexrepro).  It's not very well described beyond that, unfortunately.
Title: Re: Best thing ever
Post by: ikke on June 28, 2012, 04:41:08 PM
After looking at various programming game/organic things, I ran into this, and have been extremely excited so far. I have no real experience with stack languages, so I'm trying to piece together an understanding from the Wiki - is there a more cohesive step-by-step tutorial? I've been running a simulation for about 4 hours now - whoever made Callidus apparently knew what they were doing.
for programming look up de bots in this F3 thread: http://forum.darwinbots.com/index.php/topic,2969.0.html (http://forum.darwinbots.com/index.php/topic,2969.0.html)
in the zipfile look for shoot, defence etc.
I used these to start Gimmick, my F3 /F2 bot
Title: Re: Best thing ever
Post by: Tilthanseco on June 28, 2012, 05:29:34 PM
Quote
3. Is there any methodology that allows bots to mix their code to form an offspring?

Like Nums said.
You could have it shoot sperm randomly when it sees something, and then .sexrepro when it is fertilized.

Code: [Select]
'Put this after your -1 .shoot store gene
cond
*.eye5 40 >
20 rnd 1 =
start
-8 .shoot store
stop

cond
*.nrg 10000 >
*.fertilized 0 >
start
30 .sexrepro store
stop

This would work for a cannibot also.  ;)

Quote
2. Just try and get meaningful evolution as quickly as possible.

An advanced way of evolving fast is to have only important values in the bot change as it reproduces.  You can do this by using Racial Memory that lets the bots pass down the values they used with a chance to change them. http://wiki.darwinbots.com/w/Racial_memory (http://wiki.darwinbots.com/w/Racial_memory)

Code: [Select]
'Define names for the variables
def repronrg 971
def distance 972

'How far away to start shooting
cond
*.eye5 *.distance >
start
-1 .shoot store
stop

'How much nrg for repro
cond
*.nrg *.repronrg >
start
30 .repro store
stop

'Randomly change the values when young
cond
*.robage 100 <
10000 rnd 1 =
start
'Randomly add subtract up to 5 from value
*.distance -5 10 rnd add add .distance store
*.repronrg -5 10 rnd add add .repronrg store
stop

'Set the first values
cond
*.distance 0 =
*.repronrg 0 =
start
50 .distance store
10000 .repronrg store
stop

For that ^ you should have mutations disabled (in options).  Then when they get better, you look at the best bot's memory at 971 and 972.  :happy:

Quote
Is there a way to run two simulations at once?
Page 5 here has a nice tutorial on how to set up connect sims. (I havent had a chance to try it though) http://forum.darwinbots.com/index.php/topic,486.60.html (http://forum.darwinbots.com/index.php/topic,486.60.html)

p.s. Hope I wrote the code right nums.
Title: Re: Best thing ever
Post by: southpointingchariot on June 28, 2012, 05:38:23 PM
For the last time I will thank you for your excellent and generous help.

I'm having trouble getting my plants to reproduce. I built a vegetable that will run away slowly:
Code: [Select]
' Rolling Moss
' by: southpointingchariot
' Vegetable
'
' A scared plant

cond
  *.nrg
  6000
  >
start
  50
  .repro
  store
  15
  .aimdx
  store
stop

' Gene 1 Food Finder
cond
 *.eye5 0 >
start
 *.refveldx .dx store
 *.refvelup -5 add .up store
stop

' Gene 3 Avoiding Family
cond
 *.eye5 0 =
start
 314 rnd .aimdx store
stop

' Gene 4 Reproduce
cond
 *.nrg 1000 >
start
 10 .repro store
stop
end

But often bots with 32000 will just sit there and not reproduce. What can I do to fix this?
Title: Re: Best thing ever
Post by: Numsgil on June 28, 2012, 05:58:14 PM
Can you tell if there's anything in front of the veggy?  That's the most common cause of a bot not being able to reproduce.
Title: Re: Best thing ever
Post by: Tilthanseco on June 28, 2012, 06:07:28 PM
Quote
' Gene 4 Reproduce
cond
 *.nrg 1000 >
start
 10 .repro store
stop
end

 FYI You have two reproduce genes, the first needs 6000 nrg but the second only needs 1000, so the first will not turn on.
The first turns the bot to make sure it has room.

I agree with Nums, there probably are bots in the way.

You could have it turn it the gene you want to use. Most likely the second repro gene.

Edit: Your moss is very interesting to watch, it forms little clumps that run away/follow at a distance predators.
Title: Re: Best thing ever
Post by: southpointingchariot on June 28, 2012, 06:13:30 PM
I seemed to have fixed my earlier problem - I had to deactive the veggy repopulation effect. I'm now working on:

1. Telling the Taxxons not to eat their parents or children.
2. Introducing sexual reproduction.
3. Maximizing adaptation.
Title: Re: Best thing ever
Post by: southpointingchariot on June 28, 2012, 06:24:51 PM
FYI You have two reproduce genes, the first needs 6000 nrg but the second only needs 1000, so the first will not turn on.
The first turns the bot to make sure it has room.
Yeah, I just stole a couple methods and forgot to take one out.
Quote
Edit: Your moss is very interesting to watch, it forms little clumps that run away/follow at a distance predators.

Thanks :). I think it makes the process a good bit more interesting.
Title: Re: Best thing ever
Post by: southpointingchariot on June 28, 2012, 06:56:38 PM
This process is truly amazing and awesome!

I've been having the same problem over and over again. After a while, a Rolling Moss bot mutates, and causes an massive explosion of birth, slowing things down to the point of unusable. (http://i.imgur.com/GFJmk.gif)

Here is the original code:
Code: [Select]
' Rolling Moss
' by: southpointingchariot
' Vegetable
'
' A scared plant

cond
  *.nrg  30000  >
start
  50  .repro  store
  15  .aimdx  store
stop

' Gene 1 Food Finder
cond
 *.eye5 0 >
start
 *.refveldx .dx store
 *.refvelup -10 add .up store
stop

end

And the mutated code:
Code: [Select]
''''''''''''''''''''''''  Gene:  1 Begins at position  1  '''''''''''''''''''''''
 cond
 *.nrg 30000 >
 else
 50 .repro store
 15 .aimright store
 stop
''''''''''''''''''''''''  Gene:  1 Ends at position  12  '''''''''''''''''''''''

''''''''''''''''''''''''  Gene:  2 Begins at position  13  '''''''''''''''''''''''
 cond
 *.eye5 0 >
 start
 *.refveldx .dx store
 *.refvelup -10 add .up store
 stop
''''''''''''''''''''''''  Gene:  2 Ends at position  26  '''''''''''''''''''''''
It would seem that the problem arises when .aimdx becomes .aimright. Any suggestions on how to prevent this from becoming disastrous?
Title: Re: Best thing ever
Post by: Tilthanseco on June 28, 2012, 07:20:58 PM
Quote
It would seem that the problem arises when .aimdx becomes .aimright

Aimdx means aimright. For some reason in the program it lists it as that.

The problem really is that the veggies got "cancerous" by sticking an "else" in the repro gene. The bot reproduces unless it has more than 30000 nrg now.

Cancerous veggies are a very very very common mutation with veggies. Cancer bots aren't because they just die...

Edit: I still don't know of a good way to make veggies not cancerous... Try setting the veggy energy option to "kilobody point" That makes it so small veggies don't get as much nrg as big plants. (and cancer plants start out small) Also try lowering the nrg they get.
Title: Re: Best thing ever
Post by: southpointingchariot on June 28, 2012, 08:57:54 PM
Edit: I still don't know of a good way to make veggies not cancerous... Try setting the veggy energy option to "kilobody point" That makes it so small veggies don't get as much nrg as big plants. (and cancer plants start out small) Also try lowering the nrg they get.

I was just about to come post that kilobody worked :). Things seem quite stable now. I just had a system break down because only non reproducing bots survived - this is actually a good thing, as all the changes I want to make will help fix that. Can you tell me precisely how toroidal works? Also, do veggies not mutate?
Title: Re: Best thing ever
Post by: Tilthanseco on June 28, 2012, 10:25:01 PM
Toroidal means that the world loops around both east west and north south. The bots go up and come out the bottom, go right and come out the left. It's default for F1 conditions.

Veggies will mutate if "disable mutations" is unchecked (1).  You can also change the species and different rate of mutations in "mutations rates" (2).
I circled the stuff in the attached screen shot.

Title: Re: Best thing ever
Post by: southpointingchariot on June 28, 2012, 10:37:45 PM
Thank you so much Tilthanseco! It seems I just wasn't being patient enough, as mutations have occurred. I've already had my first meaningful permanent mutation - changing the first gene in some way concerning when it decides to move that I don't fully understand - looks kinda like random movement, but I don't think it is. It definitely helps with searching for those elusive rollers:

Taxxon (Initial)
Code: [Select]
'Taxxon
'By: southpointingchariot
'Eat each other, yo.

' Gene 1 Food Finder
cond
 *.eye5 0 >
 start
 *.refveldx .dx store
 *.refvelup 30 add .up store
 stop

' Gene 2 Eat Food
cond
 *.eye5 50 >
 start
 -1 .shoot store
 *.refvelup .up store
 stop

' Gene 3 Avoiding Family
cond
 *.eye5 0 =
 start
 314 rnd .aimright store
 stop

' Gene 4 Reproduce
cond
 *.nrg 30000 >
 start
 10 .repro store
 stop

end

Rando (Mutated)
Code: [Select]
''''''''''''''''''''''''  Gene:  1 Begins at position  1  '''''''''''''''''''''''
 cond
 *.eye5 -10 >
 start
 *.refveldx .dx store
 *.refvelup 30 add .up store
 stop
''''''''''''''''''''''''  Gene:  1 Ends at position  14  '''''''''''''''''''''''

''''''''''''''''''''''''  Gene:  2 Begins at position  15  '''''''''''''''''''''''
 cond
 *.eye5 50 >
 start
 -1 .shoot store
 *.refvelup .up store
 stop
''''''''''''''''''''''''  Gene:  2 Ends at position  26  '''''''''''''''''''''''

''''''''''''''''''''''''  Gene:  3 Begins at position  27  '''''''''''''''''''''''
 cond
 *.eye5 0 =
 start
 314 rnd .aimright store
 stop
''''''''''''''''''''''''  Gene:  3 Ends at position  36  '''''''''''''''''''''''

''''''''''''''''''''''''  Gene:  4 Begins at position  37  '''''''''''''''''''''''
 cond
 *.nrg 30000 >
 start
 10 .repro store
 stop
''''''''''''''''''''''''  Gene:  4 Ends at position  45  '''''''''''''''''''''''
Title: Re: Best thing ever
Post by: Tilthanseco on June 29, 2012, 12:02:57 AM
Quote
cond
 *.eye5 -10 >

That makes it so the bot always does that gene even when it doesn't see something. (because eye5 is always at least 0 which is > -10)

As a result, the bot stops moving to the side and starts accelerating 30 when it doesn't see a bot, because the refvel resets to 0.

If you have this as a plant, then it probably helped it run away from predators because it always moves now.
Title: Re: Best thing ever
Post by: ikke on June 29, 2012, 01:20:35 AM
If you have per kilobody energy, and set it low, the mutation to watch for is a change in the .repro condition from nrg to body
Title: Re: Best thing ever
Post by: southpointingchariot on June 29, 2012, 02:22:52 PM
Can anyone tell me what "Objects > Speciation does?"
Title: Re: Best thing ever
Post by: Tilthanseco on June 29, 2012, 03:43:44 PM
I think it is broken now, but it sounds like it made an awesome looking graph. And it was supposed to split species in 2.
 http://forum.darwinbots.com/index.php/topic,2910.msg1377954.html#msg1377954 (http://forum.darwinbots.com/index.php/topic,2910.msg1377954.html#msg1377954)

The genetic distance and generation distance graphs are also broken.
Title: Re: Best thing ever
Post by: southpointingchariot on June 29, 2012, 06:19:03 PM
I think it is broken now, but it sounds like it made an awesome looking graph. And it was supposed to split species in 2.
 http://forum.darwinbots.com/index.php/topic,2910.msg1377954.html#msg1377954 (http://forum.darwinbots.com/index.php/topic,2910.msg1377954.html#msg1377954)

The genetic distance and generation distance graphs are also broken.

Too bad!

I'm now working on getting them not to shoot their parents or children. My first actual coding! The wiki lists some methods to prevent a bot from attacking its own species, but I only want to prevent them from attacking their parents and children. Any advice?

I'm also having trouble figuring how to structure the sexrepro and .fertilized code. I'm now trying to figure how to tell a bot not to fertilize a bot that's already fertilized. Are there any prominent examples of sexual bots or other suggestions? Here's the code I have:
Code: [Select]
cond
 *.eye5 0 >
 start
 *.refveldx .dx store
 *.refvelup 30 add .up store
 stop

cond
 *.eye5 50 >
 start
 -1 .shoot store
 *.refvelup .up store
 stop

cond
 *.eye5 0 =
 start
 314 rnd .aimright store
 stop

cond
*.eye5 50 >
*.refeye *.myeye =
start
-8 .shoot store
stop

cond
*.fertilized 0 >
*.nrg 10000 >
start
50 .sexrepro store
stop

 cond
 *.nrg 30000 >
 start
 10 .repro store
 stop
Title: Re: Best thing ever
Post by: ikke on June 30, 2012, 02:15:05 AM
The easiest way to signal fertilisation is setting .out1 and and reading with .in1. If I may request a feature for your bot: add sexual selection: something like *.refkills *.mykills > as condition for accepting sperm. My theory is that sexual reproduction will break down without proper sexual selection in a evo sim
Title: Re: Best thing ever
Post by: southpointingchariot on June 30, 2012, 02:02:12 PM
The easiest way to signal fertilisation is setting .out1 and and reading with .in1. If I may request a feature for your bot: add sexual selection: something like *.refkills *.mykills > as condition for accepting sperm. My theory is that sexual reproduction will break down without proper sexual selection in a evo sim

Thanks for the input - alas, my lack of familiarity with the coding makes me not really sure how to implement this.
Title: Re: Best thing ever
Post by: Tilthanseco on July 01, 2012, 12:13:29 AM
For whate ikke said:

Code: [Select]
' Show I'm fertilized
cond
*.fertilized 0 >
start
' Display my fertilize status
*.fertilized .out1 store
stop

' Sex with unfertilized only
cond
*.eye5 50 >
*.refeye *.myeye =
' Are they fertilized?
*.in1 0 =
start
-8 .shoot store
stop

The in/out pairs are a nice way to communicate for many different things.

For attacking parents and children, you can put in *.robage conditions in the shoot and follow genes. Like shoot and follow only *.refage 10 >
And only shoot and follow when I'm *.robage 10 >

I like ikke's suggestion of making them only sexrepro with sperm they have more kills with.

You probably saw it by now, but the Sysvar page is the best page on the wiki in my opinion. http://wiki.darwinbots.com/w/Sysvar (http://wiki.darwinbots.com/w/Sysvar)
Title: Re: Best thing ever
Post by: southpointingchariot on July 01, 2012, 03:52:31 PM
For whate ikke said:

Code: [Select]
' Show I'm fertilized
cond
*.fertilized 0 >
start
' Display my fertilize status
*.fertilized .out1 store
stop

' Sex with unfertilized only
cond
*.eye5 50 >
*.refeye *.myeye =
' Are they fertilized?
*.in1 0 =
start
-8 .shoot store
stop

The in/out pairs are a nice way to communicate for many different things.

For attacking parents and children, you can put in *.robage conditions in the shoot and follow genes. Like shoot and follow only *.refage 10 >
And only shoot and follow when I'm *.robage 10 >

I like ikke's suggestion of making them only sexrepro with sperm they have more kills with.

You probably saw it by now, but the Sysvar page is the best page on the wiki in my opinion. http://wiki.darwinbots.com/w/Sysvar (http://wiki.darwinbots.com/w/Sysvar)

Thanks for the help! It seems to be working great.

Your robage idea is interesting - but how would that stop children from attackign parents?
Title: Re: Best thing ever
Post by: Tilthanseco on July 02, 2012, 01:32:04 PM
Have the shooting and following gene make sure that it's old enough. That would still let them attack each other in the future.

Maybe for not attack children and parents ever, have them pass down a code.

Have them make a code and put it in 971 (Racial memory)
Code: [Select]
cond
*971 0 =
start
32000 rnd 971 store
stop

Broadcast the code
Code: [Select]
cond
*971 *.out1 !=
start
*971 .out1 store
stop

Then have them check to see if others have that code and if they do, don't shoot or follow.
Code: [Select]
cond
*.eye5 40 >
*.in1 *971 !=
start
'Shoot
stop

That should keep them from killing their children and mom's.

You can probably also use memval and memloc, but I don't have experience with those.
Title: Re: Best thing ever
Post by: southpointingchariot on July 02, 2012, 02:41:11 PM
Have the shooting and following gene make sure that it's old enough. That would still let them attack each other in the future.

Maybe for not attack children and parents ever, have them pass down a code.

Have them make a code and put it in 971 (Racial memory)
Code: [Select]
cond
*971 0 =
start
32000 rnd 971 store
stop

Broadcast the code
Code: [Select]
cond
*971 *.out1 !=
start
*971 .out1 store
stop

Then have them check to see if others have that code and if they do, don't shoot or follow.
Code: [Select]
cond
*.eye5 40 >
*.in1 *971 !=
start
'Shoot
stop

That should keep them from killing their children and mom's.

You can probably also use memval and memloc, but I don't have experience with those.

Wow! Thank you! Testing it out, it seems that this causes the bots not to attack anyone with shared parentage, not just the last or next generation. This makes one "family" take over and stop cannibalizing. Any thoughts? Is there a way to say "971++?"
Title: Re: Best thing ever
Post by: Tilthanseco on July 02, 2012, 03:29:53 PM
Ya I figured.

You could have the code randomly change, that will have the families become a random size.

Code: [Select]
cond
32000 rnd 1 =
start
32000 rnd 971 store
stop

For a lower chance you could put this as the cond:
Code: [Select]
cond
32000 rnd 10000 rnd mult 1 =
That^ takes a random number and multiplies it by another random number and it has to equal one.

Another way might be to have 971 increase (or decrease (dec)) every generation, then if 971 is too high its treated as an enemy.
Code: [Select]
cond
*.robage 1 =
start
971 inc
stop
Take the difference then the absolute value to see if it's close to the family number.
Code: [Select]
cond
*.in1 *971 sub abs 2 >
start
'Shoot
stop

See if that works. For the second option, the 2 controls how many generations are friends. I think 2 would be grand, parent, and child.

Also, if you have the number increase every generation there is a small chance it will reach the limit of 32000 so either make the code with a smaller number i.e. 10000 rnd.
Or make it negative i.e. 32000 rnd - 971 store ( "123 -" makes it -123)
Title: Re: Best thing ever
Post by: southpointingchariot on July 02, 2012, 04:09:25 PM
Ya I figured.

You could have the code randomly change, that will have the families become a random size.

Code: [Select]
cond
32000 rnd 1 =
start
32000 rnd 971 store
stop

For a lower chance you could put this as the cond:
Code: [Select]
cond
32000 rnd 10000 rnd mult 1 =
That^ takes a random number and multiplies it by another random number and it has to equal one.

Another way might be to have 971 increase (or decrease (dec)) every generation, then if 971 is too high its treated as an enemy.
Code: [Select]
cond
*.robage 1 =
start
971 inc
stop
Take the difference then the absolute value to see if it's close to the family number.
Code: [Select]
cond
*.in1 *971 sub abs 2 >
start
'Shoot
stop

See if that works. For the second option, the 2 controls how many generations are friends. I think 2 would be grand, parent, and child.

Also, if you have the number increase every generation there is a small chance it will reach the limit of 32000 so either make the code with a smaller number i.e. 10000 rnd.
Or make it negative i.e. 32000 rnd - 971 store ( "123 -" makes it -123)

Your second option sounds perfect - now I just have to figure out how to attach it my code ;). Here's what I have:
Code: [Select]
'Taxxon
'By: southpointingchariot
'Eat each other, yo.

' Gene 1 Food Finder
cond
 *.eye5 -10 >
 start
 *.refveldx .dx store
 *.refvelup 30 add .up store
 stop

' Gene 2 Eat Food
cond
 *.eye5 50 >
 *.in1 *971 sub abs 2 >
 start
 -1 .shoot store
 *.refvelup .up store
 stop

' Gene 3 Avoiding Family
cond
 *.eye5 50 >
 *.in1 *971 sub abs 2 <
 start
 314 rnd .aimright store
 stop

 'Am I Fertilized
cond
*.fertilized 0 >
start
' Display my fertilize status
*.fertilized .out2 store
stop
 
'Sperm shooter
cond
*.eye5 50 >
*.refeye *.myeye =
*.in1 *971 sub abs 2 >
start
-8 .shoot store
stop

'Sexual Reproduction
cond
*.fertilized 0 >
*.nrg 29999 >
start
50 .sexrepro store
stop

'Reproduction
 cond
 *.nrg 30000 >
 start
 50 .repro store
 stop
 
cond
*.robage 1 =
start
971 inc
stop

'Here's who I am
cond
*971 *.out1 !=
start
*971 .out1 store
stop

But unfortunately, it seems to lead to them not eating anything.
Title: Re: Best thing ever
Post by: Tilthanseco on July 02, 2012, 08:41:43 PM
First, I found that they start off thinking plants are friends because their 971 is only 1. I would add back in a code generator.
Code: [Select]
cond
*971 0 =
start
10000 rnd 971 store
' 4 971 store
'or ^that^ if you want them not to eat each other in the beginning

stop

Second, they don't kill each other because all they do is sperm each other to death. I would add a limiter on sperm, easyest to me is
Code: [Select]
cond
*.eye5 50 >
*.refeye *.myeye =
*.in1 *971 sub abs 2 >
'Now it only shoots roughly every 25 shots
25 rnd 1 =
start
-8 .shoot store
stop

Third, if you want them to sexrepro, I would space out the conditions, right now it says it needs 29,999 for sex and only 30,000 for repro. I tested it and they will randomly pick either one when it is fertilized. Which leaves a very unlikely chance of sexrepro. I would change it to 20 or 25 thousand.
Title: Re: Best thing ever
Post by: southpointingchariot on July 02, 2012, 09:55:15 PM
First, I found that they start off thinking plants are friends because their 971 is only 1. I would add back in a code generator.
Code: [Select]
cond
*971 0 =
start
10000 rnd 971 store
' 4 971 store
'or ^that^ if you want them not to eat each other in the beginning

stop

Second, they don't kill each other because all they do is sperm each other to death. I would add a limiter on sperm, easyest to me is
Code: [Select]
cond
*.eye5 50 >
*.refeye *.myeye =
*.in1 *971 sub abs 2 >
'Now it only shoots roughly every 25 shots
25 rnd 1 =
start
-8 .shoot store
stop

Third, if you want them to sexrepro, I would space out the conditions, right now it says it needs 29,999 for sex and only 30,000 for repro. I tested it and they will randomly pick either one when it is fertilized. Which leaves a very unlikely chance of sexrepro. I would change it to 20 or 25 thousand.

I think the problem is that a generational protection is to strong. I turned of the sperm shooter and they still were not attacking eachother enough. The goal was to make it so they only didn't attack their mother or child - it seems they aren't attacking anyone roughly their own age. I've cleaned things up a little - here's what I have:
Code: [Select]
'Taxxon
'By: southpointingchariot
'Eat each other, yo.

'Hunting

'Food Finder
cond
 *.eye5 -10 >
 *.in1 *971 sub abs 1 >
 start
 *.refveldx .dx store
 *.refvelup 30 add .up store
 stop

'Eat Food
cond
 *.eye5 50 >
 *.in1 *971 sub abs 1 >
 start
 -1 .shoot store
 *.refvelup .up store
 stop

'Turn around
cond
 *.eye5 0 =
 *.in1 *971 sub abs 1 <
start
 314 rnd .aimdx store
stop

'Generation

'Who Am I?
cond
*971 0 =
start
10000 rnd 971 store
stop

'Here's who I am
cond
*971 *.out1 !=
start
*971 .out1 store
stop

'Reproduction

'Am I Fertilized?
cond
*.fertilized 0 >
start
*.fertilized .out2 store
stop
 
'Sperm shooter
'cond
'*.eye5 50 >
'*.refeye *.myeye =
'*.in1 *971 sub abs 2 >
'*.in2 0 =
'start
'-8 .shoot store
'stop

'Sexual Reproduction
cond
*.fertilized 0 >
*.nrg 25000 >
start
50 .sexrepro store
stop

'Reproduction
 cond
 *.nrg 30000 >
 start
 50 .repro store
 stop

Here's one way I would do it it a much more more liberal system - not sure if it's possible here:

Each bot has 4 variables:

A. Personal identifier.
B. The identifier it will give to its next child.
C. The identifier it's parent had.
D. The "no shoot" array.

At Birth:
Add C to D

During Reproduction:
Add B to D
Tell new child to make A it's C
Randomly determine a new B

Title: Re: Best thing ever
Post by: Tilthanseco on July 03, 2012, 12:01:53 AM
Quote
Code: [Select]
'Turn around
cond
 *.eye5 0 =
 *.in1 *971 sub abs 1 <
start
 314 rnd .aimdx store
stop
I would change the eye5 0 = to 0 >
and the  abs 1 < to  abs 1 =

That way its when it sees a conspec and includes 1 difference. With those changes the bots don't sit and stare.

Also, the sperm shooter works with what you have.

The generation protection strength was fixed with the code generator for me.

It's funny that this bot is getting such sophisticated cannibalism and sex genes when it doesn't even know how to aim. ("*.refxpos *.refypos angle .setaim store" would work)
Although adding aiming would greatly increase the number of deaths by cannibalism...
Title: Re: Best thing ever
Post by: southpointingchariot on July 03, 2012, 12:16:01 AM
Quote
Code: [Select]
'Turn around
cond
 *.eye5 0 =
 *.in1 *971 sub abs 1 <
start
 314 rnd .aimdx store
stop
I would change the eye5 0 = to 0 >
and the  abs 1 < to  abs 1 =

That way its when it sees a conspec and includes 1 difference. With those changes the bots don't sit and stare.

Also, the sperm shooter works with what you have.

The generation protection strength was fixed with the code generator for me.

It's funny that this bot is getting such sophisticated cannibalism and sex genes when it doesn't even know how to aim. ("*.refxpos *.refypos angle .setaim store" would work)
Although adding aiming would greatly increase the number of deaths by cannibalism...

This is very strange - making the changes I think you're suggesting, the bots just stare at eachother. Here's what I have:
Code: [Select]
'Taxxon
'By: southpointingchariot
'Eat each other, yo.

'Hunting

'Food Finder
cond
 *.eye5 -10 >
 *.in1 *971 sub abs 1 >
 start
 *.refveldx .dx store
 *.refvelup 30 add .up store
 stop

'Eat Food
cond
 *.eye5 50 >
 *.in1 *971 sub abs 1 >
 start
 -1 .shoot store
 *.refvelup .up store
 stop

'Turn around
cond
 *.eye5 0 >
 *.in1 *971 sub abs 1 =
start
 314 rnd .aimdx store
stop

'Generation

'Who Am I?
cond
*971 0 =
start
10000 rnd 971 store
stop

'Here's who I am
cond
*971 *.out1 !=
start
*971 .out1 store
stop

'Reproduction

'Am I Fertilized?
cond
*.fertilized 0 >
start
*.fertilized .out2 store
stop
 
Sperm shooter
cond
*.eye5 50 >
*.refeye *.myeye =
*.in1 *971 sub abs 2 >
*.in2 0 =
start
-8 .shoot store
stop

'Sexual Reproduction
cond
*.fertilized 0 >
*.nrg 25000 >
start
50 .sexrepro store
stop

'Reproduction
 cond
 *.nrg 30000 >
 start
 50 .repro store
 stop

I'm certainly open to suggestions for other things - I don't really understand a lot (obviously), and my goal is to get the basics of reproduction and generation control working and then start evo-simming and making small changes as I understand things. If you want to suggest any coding layout, I certainly wouldn't complain (it might help me stop coming back over and over again if there was a way to have each bit of code explained how it actually works, as I don't really understand what's happening for much of it - but I'm guessing there isn't a "stack to english" translator program out there ;) . I'm still not totally sure what "*" means). 

Is there any way to utilize the type of methodology I outlined in my earlier post? I could write in javascript, but feel quite lost here.
Title: Re: Best thing ever
Post by: Tilthanseco on July 03, 2012, 02:34:18 AM
It's ok, I like helping.

I found the new problem, 971 wasn't increasing with each generation. That should fix it.
Code: [Select]
cond
*.robage 1 =
start
971 inc
stop
I didn't even see this...

Here's one way I would do it it a much more more liberal system - not sure if it's possible here:

Each bot has 4 variables:

A. Personal identifier.
B. The identifier it will give to its next child.
C. The identifier it's parent had.
D. The "no shoot" array.

At Birth:
Add C to D

During Reproduction:
Add B to D
Tell new child to make A it's C
Randomly determine a new B
A. Could just have it store a random number in a memory location, 50-150 are the safest "free" memory locations. So just 9999 rnd 50 store
B. Give the child the number so put a number in 971 - 990, 9999 rnd 973 store.
C. Have the parent post its A in another hand-me-down like 974. Or in out3
D. I have no clue how to implement arrays in dna.  :blink: Could just have the offspring code be in a fixed range. Like +- 100 from parent ID.
I think what you have going on now would be far less complicated, we already have it coded anyways...

On a whole different topic... (Tutorial Mode) you can ask me what ever questions you have. Sorry if I confuse you.
Code: [Select]
'You can define custom names for memory locations and you can make constants.
' Just put def followed by a name then memory number to name a location
def count 51
' That names the memory location 51, count
def age 100
' Here I set the constant "age" to 100
' Use custom names like any other sysvar, *.variable .variable
' Only refer to constants by .constant (else you'll get errors with *.constant)
' Example
cond
' When bot age is greater than the constant age(100) (use .age to refer to the 100)
' (*.robage 100 >)
*.robage .age >
start
' Look at the variable count(51) add 3, then store that back into count(51)
' (*51 3 add 51 store)
*.count 3 add .count store
stop

To help with debugging, you can click on a bot and open up it's console, here you can see what genes activate, set the energy, and look at the eyes.
You can also look at the bot's memory by opening the info panel and pressing memory, and looking over the dna in the dna panel will show you if you make a typo by usually saying "0" instead of ".aimdx" ect. You can also move bots around in the sim window.

For coding, I have found that looking at other non-complex and preferably commented bot code helps. Also, commenting someone else's bot dna is a good way to see how things work.
Try figuring out how "SexBot" by d-EVO works. http://forum.darwinbots.com/index.php/topic,3037.0.html (http://forum.darwinbots.com/index.php/topic,3037.0.html)

In bot dna, the bot's controls and senses are operated by referring to 1000 memory addresses. Storing a number in one makes the bot do something.
The * tells the dna what is currently in that memory address. The words on the sysvar page are just for us humans. Saying .up means use memory location 7.
Saying *.up says look at what is in memory location 7. That's why we use *.eye5, it says "what does eye 5 see" Which is technically "what's in memory location 505"

The stack is really crazy to me also. For some reason, numbers in dna get put in a pile that is worked on and stays there till the cycle ends.
"5 5 5 add store" would put three 5's on the stack, then add the last two numbers on the stack (the second and third 5), then store the first number on the stack (the first 5) in the result of 10. It's the same as:
5 10 store

The stack is not confined to just one gene or action either.
Code: [Select]
cond
*.eye1 *.eye9 >
start
mult -145
stop

cond
*.eye9 *.eye1 >
start
mult 145
stop

cond
start
.aimdx store
stop
This code will get rid of previous stuff on the stack with "mult" (I don't know how...) and then place a number. The last gene will use the last number placed and store it in .aimdx.

I would not worry about figuring out how condition-less or single store bots work until you get a feel for the simple stuff.

Condition-less (Less Boo!!) (I made This  :))
Code: [Select]
cond
start
' Ident
123 .out1 store

'Move
2 .up
*.eye5 0 sub sgn abs 1 sub -
*.out1 *.in1 sub sgn abs 1 sub -
add sgn abs mult
store

'See
-140 .aimdx
*.eye1 *.eye9 sub sgn 0 floor mult
store

140 .aimdx
*.eye9 *.eye1 sub sgn 0 floor mult
store

-15 .aimdx
*.eye4 *.eye6 sub sgn 0 floor mult
store

15 .aimdx
*.eye6 *.eye4 sub sgn 0 floor mult
store

' Follow
*.refvelup 20 add .up
*.eye5 0 sub sgn 0 floor mult
*.out1 *.in1 sub sgn abs mult
store
*.refveldx .dx
*.eye5 0 sub sgn 0 floor mult
*.out1 *.in1 sub sgn abs mult
store

'Shoot
-1 .shoot
*.eye5 40 sub sgn 0 floor mult
*.out1 *.in1 sub sgn abs mult
store
*.refvelup .up
*.eye5 40 sub sgn 0 floor mult
*.out1 *.in1 sub sgn abs mult
store
0 .aimdx
*.eye5 40 sub sgn 0 floor mult
*.out1 *.in1 sub sgn abs mult
store

'Conspec
*.refaim .setaim
*.out1 *.in1 sub sgn abs 1 sub - mult
store

'Repro
30 .repro
*.nrg 10000 sub sgn 0 floor mult
store
stop
end

Single Store (Boo!!) Viewer's Discretion is Advised!
Quote from: happyhamsterchan
Code: [Select]
start
 *.tiepres *.numties sgn mult 100 *.numties sgn -- abs mult *.body 50 sub sgn 0 floor -- abs mult add 628 rnd *.numties sgn -- abs mult *.body 50 sub sgn 0 floor mult *.nrg 2000 sub sgn 0 floor *.eye5 30 sub sgn 0 floor mult *.eye5 sgn *.myeye *.refeye sub sgn abs -- abs mult add sgn mult add 40 *.numties sgn -- abs mult *.body 50 sub sgn 0 floor mult *.nrg 2000 sub sgn 0 floor mult *.eye5 30 sub sgn 0 floor -- abs mult add -6 *.numties sgn -- abs mult *.body 50 sub sgn 0 floor mult *.nrg 2000 sub abs 0 floor -- abs mult *.myeye *.refeye sub sgn abs mult *.eye5 40 sub sgn 0 floor mult add -60 *.numties sgn -- abs mult *.body 50 sub sgn 0 floor mult *.nrg 2000 sub sgn 0 floor -- abs mult *.eye5 sgn -- abs mult *.eye9 sgn mult add 40 *.vel sub *.numties sgn -- abs mult *.body 50 sub sgn 0 floor mult *.nrg 2000 sub sgn 0 floor -- abs mult *.eye5 sgn -- abs mult *.eye9 sgn -- abs mult add 50 *.eye5 sub 0 floor over *.vel sub *.numties sgn -- abs mult *.body 50 sub sgn 0 floor mult *.nrg 2000 sub sgn 0 floor -- abs mult *.myeye *.refeye sub sgn abs mult *.eye5 sgn abs mult *.eye5 40 sub sgn 0 floor -- abs mult add 467 *.numties sgn mult 313 *.numties sgn -- abs mult *.body 50 sub sgn 0 floor -- abs mult add 5 *.numties sgn -- abs mult *.body 50 sub sgn 0 floor mult *.nrg 2000 sub sgn 0 floor *.eye5 30 sub sgn 0 floor mult *.eye5 sgn *.myeye *.refeye sub sgn abs -- abs mult add sgn mult add 300 *.numties sgn -- abs mult *.body 50 sub sgn 0 floor mult *.nrg 2000 sub sgn 0 floor mult *.eye5 30 sub sgn 0 floor -- abs mult add 7 *.numties sgn -- abs mult *.body 50 sub sgn 0 floor mult *.nrg 2000 sub sgn 0 floor -- abs mult *.myeye *.refeye sub sgn abs mult *.eye5 40 sub sgn 0 floor mult add 6 *.numties sgn -- abs mult *.body 50 sub sgn 0 floor mult *.nrg 2000 sub sgn 0 floor -- abs mult *.eye5 sgn -- abs mult *.eye9 sgn mult add 1 *.numties sgn -- abs mult *.body 50 sub sgn 0 floor mult *.nrg 2000 sub sgn 0 floor -- abs mult *.eye5 sgn -- abs *.eye9 sgn -- abs mult *.myeye *.refeye sub sgn abs *.eye5 sgn abs mult *.eye5 40 sub sgn 0 floor -- abs mult add sgn mult add store
 stop
:puke:
Title: Re: Best thing ever
Post by: southpointingchariot on July 03, 2012, 09:44:43 AM
I found the new problem, 971 wasn't increasing with each generation. That should fix it.
Code: [Select]
cond
*.robage 1 =
start
971 inc
stop
That seems to be working somewhat better - bots still sometimes stare at each other until something runs by them. Exactly who will the bots not  attack in this system? Is it everyone of the same age?

Quote
I think what you have going on now would be far less complicated, we already have it coded anyways...
Gotya, that makes sense. I'm just trying to make sure there's sufficient cannibalism, without bots just circling around their immediate children. The goal is cross-pollinated violence ;). This is key to my system (I don't insert veggies when their population is low, they and the taxxons have to find a sustainable level). The real goal is an evo-sim that's as full featured and realistic as possible, while keeping population totals low enough to minimize slow down.

One interesting thing I've noticed is that perhaps the most effective mutation is bots lying about whether they've been fertilized. This makes other bots think they're not fertile, and sperm them over and over while they're being eaten. I've also had a case where a taxxon mutated to the point where it would fertilize a rolling moss, and the moss mutated where it woudl sexrepro, thus creating a carnivorous mobile veggy! Or maybe they just spermed them by accident?

Quote
On a whole different topic... (Tutorial Mode) you can ask me what ever questions you have.
Yay tutorial mode

Quote
Code: [Select]
'You can define custom names for memory locations and you can make constants.
' Just put def followed by a name then memory number to name a location
def count 51
' That names the memory location 51, count
def age 100
' Here I set the constant "age" to 100
[/quote]
Are constants stored in memory somewhere or are they just nice and free?

[quote]
' Example
cond
' When bot age is greater than the constant age(100) (use .age to refer to the 100)
' (*.robage 100 >)
*.robage .age >
start
' Look at the variable count(51) add 3, then store that back into count(51)
' (*51 3 add 51 store)
*.count 3 add .count store
stop
So this means after 100 cycles from the bot's birth, every cycle, add 3 to count?
Quote
To help with debugging, you can click on a bot and open up it's console, here you can see what genes activate, set the energy, and look at the eyes.
You can also look at the bot's memory by opening the info panel and pressing memory, and looking over the dna in the dna panel will show you if you make a typo by usually saying "0" instead of ".aimdx" ect. You can also move bots around in the sim window.
I hadn't looked at the console - this means its good to spread out your dna across genes so you can see what happens when right?

Quote
For coding, I have found that looking at other non-complex and preferably commented bot code helps. Also, commenting someone else's bot dna is a good way to see how things work.
Try figuring out how "SexBot" by d-EVO works. http://forum.darwinbots.com/index.php/topic,3037.0.html (http://forum.darwinbots.com/index.php/topic,3037.0.html)
Thanks for the tip - I'm trying to find understandable bots. I'll look over that in detail at some point, looks actually comprehensible, and gives me a good reason to look up sysvars :). Right now I'm confused with
Code: [Select]
cond
 *.x 1 =
 *.eye5 0 >
 *.in1 1 =
start
 *.refveldx .dx store
 *.eye5 50 =>
 *.refvelup .up store
 -6 .shoot store
 dropbool
 *.eye5 50 <
 *.refvelup 30 add .up store
 dropbool
stop
Is this like gifting some body to another female?

Quote
In bot dna, the bot's controls and senses are operated by referring to 1000 memory addresses. Storing a number in one makes the bot do something.
The * tells the dna what is currently in that memory address. The words on the sysvar page are just for us humans. Saying .up means use memory location 7.
Saying *.up says look at what is in memory location 7. That's why we use *.eye5, it says "what does eye 5 see" Which is technically "what's in memory location 505"
Ahhhh, thank you so much.

Quote
The stack is really crazy to me also. For some reason, numbers in dna get put in a pile that is worked on and stays there till the cycle ends.
"5 5 5 add store" would put three 5's on the stack, then add the last two numbers on the stack (the second and third 5), then store the first number on the stack (the first 5) in the result of 10. It's the same as:
5 10 store

The stack is not confined to just one gene or action either.
Code: [Select]
cond
*.eye1 *.eye9 >
start
mult -145
stop

cond
*.eye9 *.eye1 >
start
mult 145
stop

cond
start
.aimdx store
stop
This code will get rid of previous stuff on the stack with "mult" (I don't know how...) and then place a number. The last gene will use the last number placed and store it in .aimdx.
I wonder if I should find a tutorial for FORTH or some other stack language.

Thank you so much, please keep the advice coming! I need all the instruction I can find, and I'm working on finding the next thing to improve. I think I'd like to get bots to better handle objects - they seem to just look at them and stand still indefinitely, adding unnecessary population and not eating or hunting anything.
Title: Re: Best thing ever
Post by: Tilthanseco on July 03, 2012, 06:00:28 PM
Quote
I think I'd like to get bots to better handle objects
Ya, in evo sims I like to put an object in hoping they will eventually figure out what to do with it.
In some of my sims, the object would move, grouping veggies in a pile, then the bots would plow through them, eating all they could get.

If you want them aware of objects, .refnrg can be used (objects and corpses have no energy), or .reftype (0 for bots, 1 for objects)

Quote
bots still sometimes stare at each other until something runs by them. Exactly who will the bots not  attack in this system? Is it everyone of the same age?
If you have mutations on, the cannibalism code may be breaking. Like I said in the beginning this is simple and would probably last a long time, though they would eat each other when they were old enough.
Code: [Select]
cond
start
*.robage 100 <
-20 .up store
0 .shoot store
dropbool
'This drops the last condition in the gene, I didn't feel like making two genes, so here is one with two conditions
*.refage 100 < *.eye5 0 > and
0 .shoot store
314 .aimdx store
stop
or
Code: [Select]
cond
*.robage 100 <
start
-20 .up store
0 .shoot store
stop

cond
*.refage 100 <
*.eye5 0 >
start
0 .shoot store
314 .aimdx store
stop

Quote
So this means after 100 cycles from the bot's birth, every cycle, add 3 to count?
Yep. (idk why I called it count...)
Quote
this means its good to spread out your dna across genes so you can see what happens when right?
Yep, when I make any bots, the best way to see if it is working right is to look at how the genes turn on and work together, a even better way to see gene activations is to click "show activations" in the info panel, that keeps a small visual history of the genes.

Quote
Code: [Select]
start
 *.refveldx .dx store
 *.eye5 50 =>
 *.refvelup .up store
 -6 .shoot store
 dropbool
 *.eye5 50 <
 *.refvelup 30 add .up store
 dropbool
stop

Is this like gifting some body to another female?
No, that is a generic attack gene using inline conditions, the -6 .shoot is a different shot type. -1 makes the attacked bot give mainly nrg back from it's nrg pool, -6 makes the attacked bot give mainly nrg back from it's body pool.
The attacking bot gets 95% nrg, 4% body, and 1% waste from either method I remember.
Title: Re: Best thing ever
Post by: southpointingchariot on July 03, 2012, 08:42:36 PM
Quote
I think I'd like to get bots to better handle objects
Ya, in evo sims I like to put an object in hoping they will eventually figure out what to do with it.
In some of my sims, the object would move, grouping veggies in a pile, then the bots would plow through them, eating all they could get.

If you want them aware of objects, .refnrg can be used (objects and corpses have no energy), or .reftype (0 for bots, 1 for objects)
Would adding putting in a condition like
Code: [Select]
'Turn around
cond
 *.eye5 0 >
 *.in1 *971 sub abs 1 =
 *reftype 1 =
start
 314 rnd .aimdx store
stop
work?

Quote
Code: [Select]
cond
start
*.robage 100 <
-20 .up store
0 .shoot store
dropbool
'This drops the last condition in the gene, I didn't feel like making two genes, so here is one with two conditions
*.refage 100 < *.eye5 0 > and
0 .shoot store
314 .aimdx store
stop
or
Code: [Select]
cond
*.robage 100 <
start
-20 .up store
0 .shoot store
stop

cond
*.refage 100 <
*.eye5 0 >
start
0 .shoot store
314 .aimdx store
stop
Er, what would this code do? Who is protected from attack currently?
Title: Re: Best thing ever
Post by: Tilthanseco on July 03, 2012, 09:29:10 PM
Code: [Select]
cond
 *.eye5 0 >
 *.in1 *971 sub abs 1 =
 *reftype 1 =
No, what you have has to meet all three conditions, can see check, is related check, is a block huh?. You should put an "or" after *.reftype 1 =
Code: [Select]
cond
 *.eye5 0 >
 *.in1 *971 sub abs 1 =
 *.reftype 1 = or
That way it is either related or is a block.
Quote
Er, what would this code do? Who is protected from attack currently?
It just makes it so bots can't kill each other when they are A. not old enough or B. the food is too young
Currently you have it setup where a bot doesn't kill its children or parent, but that code is too complex to last 100% in a mutation sim. So expect it to break in a few generations.
I was just offering a solution to:
Quote
That seems to be working somewhat better - bots still sometimes stare at each other until something runs by them.
Title: Re: Best thing ever
Post by: southpointingchariot on July 03, 2012, 09:40:00 PM
Code: [Select]
cond
 *.eye5 0 >
 *.in1 *971 sub abs 1 =
 *reftype 1 =
No, what you have has to meet all three conditions, can see check, is related check, is a block huh?. You should put an "or" after *.reftype 1 =
Code: [Select]
cond
 *.eye5 0 >
 *.in1 *971 sub abs 1 =
 *.reftype 1 = or
That way it is either related or is a block.
Ah, thank you. Is the range (whatever you would call that first condition) a good construction?

Quote
I was just offering a solution to:
Quote
That seems to be working somewhat better - bots still sometimes stare at each other until something runs by them.
I see - this seem to be happening some at the very beginning, not after mutation. I very much like the "mother or daughter" protection :). Fortunately, this seems to work well with mutation :). You mentioned there might be a better aiming structure - any suggestions? Is there a way to make the bots know if they're being injured? I notice sometimes bots are being eaten as they go through open space and just sort of ignorantly amble on until they die.

Is there a way for a bot to check if a target is receiving photosynthesis? I'm still having problems with mutations allowing sex with vegetables, which of course then wipe out all the taxxons.

Do you think any of our improvements or other changes should be made to the rolling moss? I'd like to have it sexually reproduce as well - I guess it needs to pursue a mate? Here's its code:
Code: [Select]
' Rolling Moss
' by: southpointingchariot
' Vegetable
'
' A scared plant

'Mate Finder
cond
 *.eye5 -10 >
 *.in1 0 =
 start
 *.refveldx .dx store
 *.refvelup 10 add .up store
 stop

'Sperm shooter
cond
*.eye5 50 >
*.refeye *.myeye =
*.in1 0 =
start
-8 .shoot store
stop

'Sexual Reproduction
cond
*.fertilized 0 >
*.nrg 20000 >
start
50 .sexrepro store
stop

Mitosis
cond
 *.nrg  30000  >
start
 50  .repro  store
 15  .aimdx  store
stop

'Run away
cond
 *.eye5 0 >
start
 *.refveldx .dx store
 *.refvelup -10 add .up store
stop

end
Title: Re: Best thing ever
Post by: Tilthanseco on July 03, 2012, 11:38:56 PM
*.refxpos *.refyps angle .setaim store
Will have bots point very accurately at another bot.

Plants are hard to ID, if the plant has no eye commands, like alga_minimalis, then you can just *.refeye 0 =; with yours it would be a lot trickier.

You can tell when bots lose or gain nrg  with *.pain and *.pleas. Also, bots can tell if they are shot, and the kind, with *.shflav, and the direction with *.shang. I don't know if *.shflav resets so make sure to 0 .shflav store in you gene.
For the above, you have to use the second version linked here: http://forum.darwinbots.com/index.php/topic,1249.msg1384143.html#msg1384143 (http://forum.darwinbots.com/index.php/topic,1249.msg1384143.html#msg1384143)
Code: [Select]
cond
*.shang 0 >
*.shflav -2 !=
*.shflav -8 !=
start
'Reset shflav might not be needed
0 .shflav store
'Ruuuuuuuuun
'Or turn to shoot back
*.shang .aimdx store
stop

For your plant the possibilities are endless. If you want it to be hard to catch you can add the above code, replacing the 'Ruuuun.
Title: Re: Best thing ever
Post by: southpointingchariot on July 04, 2012, 03:47:10 PM
*.refxpos *.refyps angle .setaim store
Will have bots point very accurately at another bot.
So my version doesn't seem to be right - I'm not exactly sure how your code works.
Code: [Select]
'Food Finder
cond
 *.eye5 -10 >
 *.in1 *971 sub abs 1 >
 start
*.refxpos *.refyps angle .setaim store
 *.refvelup 30 add .up store
 stop
Quote
Plants are hard to ID, if the plant has no eye commands, like alga_minimalis, then you can just *.refeye 0 =; with yours it would be a lot trickier.
Hmm, we need to figure something out - both are sexual, and having them cross pollinate ruins everything. Maybe just have them broadcast several unique identifiers as failsafes in case one mutates? Perhaps the protections should be added to the sexrepro command as well.
Quote
You can tell when bots lose or gain nrg  with *.pain and *.pleas. Also, bots can tell if they are shot, and the kind, with *.shflav, and the direction with *.shang. I don't know if *.shflav resets so make sure to 0 .shflav store in you gene.
For the above, you have to use the second version linked here: http://forum.darwinbots.com/index.php/topic,1249.msg1384143.html#msg1384143 (http://forum.darwinbots.com/index.php/topic,1249.msg1384143.html#msg1384143)
Code: [Select]
cond
*.shang 0 >
*.shflav -2 !=
*.shflav -8 !=
start
'Reset shflav might not be needed
0 .shflav store
'Ruuuuuuuuun
'Or turn to shoot back
*.shang .aimdx store
stop

For your plant the possibilities are endless. If you want it to be hard to catch you can add the above code, replacing the 'Ruuuun.

So should I just always run that other .exe if I'm to try and use that type of gene?

Also, I notice that as mutation occurs, bots change color. Is there anywhere that this process is detailed?
Title: Re: Best thing ever
Post by: Tilthanseco on July 05, 2012, 01:35:35 AM
Happy 4th in U.S

Quote
*.eye5 -10 >
I didn't try it, but I believe you need to set the -10 to 0 or above for the gene to work properly. When it doesn't see something, the gene still turns on atm, with nothing in view, the refxpos/ypos values are zero so the bot will always aim at (0,0) I believe.
*.refxpos *.refypos angle .setaim store just has the bots aim at the coordinates of another bot. {aim at (210,1234)}
Also, I spelled *.refypos wrong, fix that.

Ya, you could have the veggies broadcast a veggie code, but with mutations on, that will most likely break in the future.

For sex, you could have the mom ID the Father before birthing. Have it turn toward the father and evaluate based on criteria. Ex:
Code: [Select]
' Sexrepro Gene with Father Condition
cond
*.refeye *.myeye =
'Father Species Condition^
*.fertilized 7 >
'Only use sperm for 2 cycles, 1 to turn, 1 to ID Father and Birth
*.nrg 10000 >
'Birth condition^
start
30 .sexrepro store
stop

'A shoot sperm gene

'Turn towards Father to ID Gene
cond
*.shang 0 >
*.shflav -8 =
start
0 .shflav store
*.shang .aimdx store
stop

On a different note, the order of genes matters. Ex:
Code: [Select]
cond
*.eye5 50 >
start
50 .up store
stop

cond
*.eye5 0 >
start
30 .up store
stop
In that example, the bot will never use 50 .up store if it sees something in eye5.

Yep, run the fixed exe if you plan on using *.shflav or *.shang

I know that mutations will change bot colors but I don't know how. I do know that bot color is only for human enjoyment and has no affect on bot performance.