Darwinbots Forum

Code center => Suggestions => Topic started by: Jez on December 11, 2006, 06:38:47 AM

Title: Excess nrg -> body, excess body -> death
Post by: Jez on December 11, 2006, 06:38:47 AM
Partly to deal with the problem of big Berthas but mostly 'cause I'm having to wait for the first match between 100's of Anubis Canis and 5 Atrium Venator's(Dark Hunter) to finish (at about 10 cycles/sec).

It seems a shame that excess nrg (over 32000) isn't being turned directly into body. I presume it's not anyway 'cause Dark Hunter seems to spend most its time at >31900 nrg but its body is growing quite slowly (12k cycles 8k body)

To go with that, punishing Berthas, if body gets over a limit, say 25k or 30k why not give them Altzheimers in the same way excess waste is punished?

Seems a biologically sound idea to me;

excess food = excess fat = less mobility & more chance of heart failure etc

***

The question is; will Dark Hunter ever reproduce before it dies of waste? (16k cycles now still only 8.5k body) Or will Anubis Canis just die from boredom?
Title: Excess nrg -> body, excess body -> death
Post by: Light on December 11, 2006, 07:34:46 AM
Neither of them have any body genes so there not really going to grow, Dark hunter doesn't have any repro gene so will never reproduce and as waste is disabled it wont die of it, Anubis Canis is so small in size and terrible at aiming that its never going to kill off the Dark hunters, I think its pretty much a stalemate. I think you could leave it all day and nothing will happen, call it a draw and move on. Also if they dont appear to be shooting each other its worth checking they aren't matching on cospec recognition ie both have the same .myeye value, but this isn't happening in this case
Title: Excess nrg -> body, excess body -> death
Post by: Jez on December 11, 2006, 08:18:02 AM
I think you are right.

It reached 32000 waste a while ago and no mutations, this match would go on forever.  
Title: Excess nrg -> body, excess body -> death
Post by: EricL on December 11, 2006, 10:38:53 AM
Quote from: Light
Also if they dont appear to be shooting each other its worth checking they aren't matching on cospec recognition ie both have the same .myeye value, but this isn't happening in this case
FYI, in leaugemode, the code fudges .myeye valeus for combatants with the same number of .eye statements so .myeye should always be different between contestants.  Old routine, there long before I came along, but I did fix a bug or two there.  Should be working.
Title: Excess nrg -> body, excess body -> death
Post by: Numsgil on December 11, 2006, 04:02:27 PM
If you exceed 32000 nrg I think maybe the excess should either be converted into waste (10 nrg -> 1 waste) or shot out automatically through the bots front, like a "leak".

Waste for leagues should exist, I think, but very high.  Like maybe 20 000 or something around there.
Title: Excess nrg -> body, excess body -> death
Post by: Jez on December 11, 2006, 05:43:55 PM
Eric suggested 10k waste limit.

That fudged eye ref completely wastes Blue on Blues delgene chameleon tactic
Title: Excess nrg -> body, excess body -> death
Post by: EricL on December 11, 2006, 05:55:33 PM
Quote from: Jez
That fudged eye ref completely wastes Blue on Blues delgene chameleon tactic
Happy to turn it off if people like.  It's kind of a big hack.  IMHO, using *.refeye/*.myeye as a means of conspec recognition strikes me as brittle, lazy programming.  Writing some special value to .out1 might be better.  Species spoofing strikes me as a totally valid tactic and reason for bot authors to get even more sophisticated in this sapce.
Title: Excess nrg -> body, excess body -> death
Post by: Jez on December 11, 2006, 06:46:38 PM
It brings to mind, what should a bot use for species ID and how much should we allow confusion? Greenbeards by Haig? The Altruism thingy, in the same way it was suggested that bots' point of reference should be specific not exact. What should be the bots POV? What is the biological comparison?

Bots should be allowed species (greenbeard) ID but chameleons exist so how to model them as well?
Title: Excess nrg -> body, excess body -> death
Post by: shvarz on December 11, 2006, 07:11:47 PM
What should be the bots POV? What is the biological comparison?

No simple solutions here.  Organisms use many different criteria to define "own species".  Some don't care at all.  Some use very complicated visual and behavioral clues.  Actually, comparing number of eye commands is probably very close to the real biological situation for higher animals.  If only bots could compare other things as well...  Theoretically, they should be able to check on almost any property of a genome and come up with their own definitions of "their species".
Title: Excess nrg -> body, excess body -> death
Post by: EricL on December 11, 2006, 08:11:57 PM
Quote from: shvarz
Actually, comparing number of eye commands is probably very close to the real biological situation for higher animals.

I'd love to hear more on this as it does not strike me as anything like what biological organisms do.  I would think they inspect relativly accessable morphological traits - color, size, plumage, scent, behaviour - rather than peering into the genetic code of another organism and determining how many of a specific base pair sequence it has in it's genome....

Equivalents in DB might be eye angles and widths, the values of the .out sysvars, movement speed, spin rate, size, mass, amount of body, navigational behaviour, whether it has ties or is shooting, color if we had it, etc.   I would consider each of these a morphological trait, relatively accessable to other organisms.  But relying upon the specifc way a bot's DNA is coded, makign a conspec determination on whether it uses *.eye5 as opposed to *505, I don't get how that parallels biology at all.
Title: Excess nrg -> body, excess body -> death
Post by: shvarz on December 11, 2006, 10:41:26 PM
Well, any morphological trait that can be used to tell your own species must be defined genetically.  So, yes, you are looking at the phenotype, but you judge the genotype.  In real life the complexity of phenotype is almost unlimited, whereas in DB it is strictly defined by the program.  For example, right now there is simply no way for a bot to tell that another bot is of a different color.  Bots are limited to the properties you described, but those properties are few and difficult to observe.  

One solution is to increase the number of phenotypic properties.  But to be done correctly those properties must bear a functional significance.  Just assigning a bunch of numbers and calling them "color", "fatness" or something else is pointless.  But if done properly I'm for it!

But the other way to look at this is that all our DNA makes us look and behave the way we do.  It's really the DNA that we care about.  We can't look at each other's DNA directly, but bots can.  So give them the ability to create and read certain fingerprints of DNA - problem solved.  You can even view these fingerprints as their "senses" - smell, taste, vision.  You may say that a dog "smells like a dog", but bot can say that a dog "has certain DNA patterns that make it smell like a dog".
Title: Excess nrg -> body, excess body -> death
Post by: EricL on December 11, 2006, 11:42:40 PM
Hmmm.  I hear you.  But I wonder whether not having a clean seperation between phenotype and geneotype is wise, not just for conspec recognition but for everything in DB.  It goes back to the other threads we've had concerning evolvability mechanisms.  If we allow the genotype to essentially be part of the morph, then I worry that morphological selective pressures will place morphological constraints on the genotype and cause us problems with evolving the right information structures in the long run.

Take mimicry.  If conspec recognition is all about direct interogation of the genotype, then there will be select pressure in some cases to artifically decorate one's genotype to look like another's.   The genotype becomes the morph.  It's hard enough to evolve a good information passing and evolvabilty language but if it is also directly subject to morphological selection as well... well what?  I don't know...  It makes my brain hurt.  You and others have probably thought depper and longer about this than I but my gut tells me that a clean seperation between genotype and phenotype is important.
Title: Excess nrg -> body, excess body -> death
Post by: Jez on December 12, 2006, 04:37:52 AM
I don't know; having read what you guys have written I can see now how a bot 'seeing' another bots dna length could be considered a 'genetic fingerprint', a relatively good way of a bot being able to define anothers shape, something it is otherwise going to have difficulty doing. (ooh look you're a circle, you must be my friend!)

Things like 'movement speed, spin rate, size, mass, amount of body,' are non defining characteristics, they change all the time.
Quote
"Just assigning a bunch of numbers and calling them "color", "fatness" or something else is pointless."
We have an equivalent of this in being able to ref locations in a bots dna just without the meaningless labels.

Even something minor like *.refeye rather than only seeing a bots outward eye postions could be considered a judgement on the number/size/colour of eyes.

In essence I think the way it is done could be considered analagous to many real life comparisons. As long as there is no way to lock an ID, other than an individuals ID, I will be ok with it. If a bot only wants to use one ID system then it is going to be easy to fool, the fun comes trying to con a bot that uses multiple ID methods, or multiple species opponents with different ID systems.

I vote the code fudge for .myeye ID be removed. Otherwise it becomes the defining ID system that will replace all others. An advantage without disadvantage.
Title: Excess nrg -> body, excess body -> death
Post by: Numsgil on December 12, 2006, 04:46:18 AM
The fudge for the eyes occurrs at the start of a round, and was added to reflect what PY did manually when I asked him what he did when two competitors had the same eye count.

It's not meant to screw with any ID system.  It's just a "fudge".  It also lets you run a league round against identical bot species, which is interesting and should be done at least once by anyone interested because it gives results you wouldn't expect (there actually is a winner after long enough.  Interestingly, it takes fewer rounds than some other competitions between very dissimilar bots).

In short, it's used in a very specific case where the starting DNA of two species has the same number of eye statements, and shouldn't interfere in any conspec strategy except maybe in very specific cases.

As a side note, I've been considering dropping the refeye, refshoot, etc. sysvars in favor of a DNA "hash" code that's built to maximize collisions and non linear distributions.  That is, it's a hash code that changes very little as DNA changes from mutations.  The simplest version would simply be the DNA length, though I'm hoping to make it a little more comlex.

It would be equally spoofable as any current refeye versions, but would prevent the moderate issue of bots knowing more than they should about an opponent.  It just seems weird to me that the number of eye commands in the other bot is visible.  And we use it for conspec recognition almost exclusively anyway.
Title: Excess nrg -> body, excess body -> death
Post by: Jez on December 12, 2006, 05:02:37 AM
Didn't know that, thanks Nums, in that case I'm not worried about that either.
Title: Excess nrg -> body, excess body -> death
Post by: Testlund on December 12, 2006, 05:24:41 AM
Quote from: EricL
If conspec recognition is all about direct interogation of the genotype, then there will be select pressure in some cases to artifically decorate one's genotype to look like another's.

Maybe if the program is designed so the genotype doesn't have to be an exact match for bots to recognize each other. It could be like the more different they are the less percentage the bot will think it is a conspecies. For instance if 90% of the genes are the same it will be recognized as a conspecies. That should prevent a bot to get killed right away by it's relatives just because it got a single mutation, much like in reality I believe. In reality; the more different the genes the more different the species look. We could just PRETEND the bots think other species LOOK different.  
Title: Excess nrg -> body, excess body -> death
Post by: Henk on December 12, 2006, 05:30:53 AM
Quote from: Testlund
Maybe if the program is designed so the genotype doesn't have to be an exact match for bots to recognize each other. It could be like the more different they are the less percentage the bot will think it is a conspecies. For instance if 90% of the genes are the same it will be recognized as a conspecies. That should prevent a bot to get killed right away by it's relatives just because it got a single mutation, much like in reality I believe. In reality; the more different the genes the more different the species look. We could just PRETEND the bots think other species LOOK different.  

This is already possible, consider this gene for example:

cond
(some conditions)
*.refeye *.myeye ~=
start
(some actions)
stop

Correct me if I'm wrong on the operator, can't remember exactly but there is an "is almost equal to[/I[ operator.
Title: Excess nrg -> body, excess body -> death
Post by: Numsgil on December 12, 2006, 04:22:20 PM
I can never get the "almost equal" operator to work like I want when I'm actually coding.  What I would do is:

cond
(some conditions)
*.refeye *.myeye sub abs 3 <=
start
(some actions)
stop
Title: Excess nrg -> body, excess body -> death
Post by: Testlund on December 12, 2006, 05:09:07 PM
Then, theoretically, bots should be able to evolve using that function, though it might take forever.
Title: Excess nrg -> body, excess body -> death
Post by: Numsgil on December 13, 2006, 12:24:44 AM
Presuming that the selective pressures encourage that sort of "friend" recognition.  I'm not at all convinced that it does, because the way the environment is set up it's very much "every bot for itself".

Maybe if we had a large, networked environment than this would evolve to prevent the slow intrusion of rival groups from rival network nodes.
Title: Excess nrg -> body, excess body -> death
Post by: Endy on December 13, 2006, 07:45:47 PM
Quote
Take mimicry.  If conspec recognition is all about direct interogation of the genotype, then there will be select pressure in some cases to artifically decorate one's genotype to look like another's.   The genotype becomes the morph.

I've seen some of this in my own sims with co-evolving plants. They have a disturbing tendency to simply keep adding "eyes" until they hit on the right number.

Lately I've been using in/out and .memloc/memval to achieve something closer to a phenotype recognition. With enough arbitrary reference points it should be virtually impossible for another species to mimic easily.
(Which raises the question of just how arbitrary our own reference points are  )

Haven't had any of the above problems using this and the bots are given a freer reign to mess around with their dna.

You could also use something like:
Code: [Select]
cond
*.out1 32000 !=
start
.out1 inc
stop

cond
*.refage *.in1 =
start
do some actions
stop

This used with regualar methods would expose any bot trying to simply copy another, because it'd expose itself in the process.

Sims with apparent conspecs should eventually resolve themselves. Typically one of the bots will have some slight hunting advantage over the other, and win the match over time.
Title: Excess nrg -> body, excess body -> death
Post by: Endy on December 17, 2006, 03:51:13 AM
Ran an experiment involving a species that was at least temporarily altruistic towards it's family. Whenever 32000 rnd equals 1 however they randomly change their out1 value. This seemed to happen on a fairly regular basis, presumably about every 16000 cycles. During the transition points the population droped rapidly until a new number dominated.

At first a completly(no kin recognition) canni species evolved from them. Next in response to the canni's attacks and inter-family fighting a completly altruistic species evolved.   They eventually won out. From the completly altruistic species a chamelon canni species evolved. The altruists were eliminated. Eventually the wasteful canni methods caused the population to wipe itself out.  

Haven't quite figured how to take the findings, Seems like a species needs to somehow maintain a level of altruism and infighting to avoid excessive cheaters.

I'm going to take a look at what effect seperating the shooting conspec check from the hunting ones has. From what I've seen the bots typically only break the shooting conditions, they don't often break the avoidance conditions.

I've also been working on a next of kin recognition system. (Parent, Self, Children) The complexity of moving the recognition numbers around is pretty hard though. I might just have them only recognize their own children, until the children themselves reproduce.This would be relativly easy, but leave them vulnerable to attacks from siblings and their own parents.
Title: Excess nrg -> body, excess body -> death
Post by: Numsgil on December 17, 2006, 04:33:17 AM
Quote from: Endy
Ran an experiment involving a species that was at least temporarily altruistic towards it's family. Whenever 32000 rnd equals 1 however they randomly change their out1 value. This seemed to happen on a fairly regular basis, presumably about every 16000 cycles. During the transition points the population droped rapidly until a new number dominated.

Neat.  Can we see the bot?  I'm interested in how you set it up.

Quote
At first a completly(no kin recognition) canni species evolved from them. Next in response to the canni's attacks and inter-family fighting a completly altruistic species evolved.   They eventually won out.

This I don't understand.  Were they altruistic towards all other bots?  Did the altruism take the form of ignoring other bots?  Did this altruistic species evolve from the cannis or did it come from the original?

Quote
From the completly altruistic species a chamelon canni species evolved. The altruists were eliminated. Eventually the wasteful canni methods caused the population to wipe itself out.

This is fundamentally interesting to me.  Situations where evolution eventually causes the extinction of all life seems deliciously ironic.  This is also fairly constant with experience I've had with enitor comesum, which is specifically designed to eat each other.  The only stable population sizes are in the 20 - 30 individual range on the largest sim size.  I think cannibalism wouldn't lead to eventual extinction if we had the opportunity to use significantly larger geographic sizes.  Part of the problem is that new mutations get well mixed into the general population, so there's no failsafe to prevent blind short sighted adaptations from totally destroying a population.

All in all, your results remind me of an iterative game arriving at a Nash Equilibrium.  In this case the equilibrium being an unmaintainable strategy.

Quote
I've also been working on a next of kin recognition system. (Parent, Self, Children) The complexity of moving the recognition numbers around is pretty hard though. I might just have them only recognize their own children, until the children themselves reproduce.This would be relativly easy, but leave them vulnerable to attacks from siblings and their own parents.

I had an idea a long time ago of a species that stores a random number into out1 at birth, and copies the in1 to its out2 at birth.  If either the in1 or in2 of the other bot matches the current bot's out1 or out2, it wouldn't attack it.  So basically out1 is a unique ID and out2 is the ID of the parent.  Basically, this would result in bots not attacking parents, children, siblings, and some other close siblings.  If you combined this with a very large sim size and zero momentum mode, or high friction, so that geographically distinct areas with distinct family lines developed, I think you would be able to create lines of stable altruists.
Title: Excess nrg -> body, excess body -> death
Post by: Jez on December 17, 2006, 06:45:33 AM
Impressive,

I would also like to see how you set the bot up to do this.
Title: Excess nrg -> body, excess body -> death
Post by: Endy on December 17, 2006, 08:57:26 PM
Err... It's no problem re-writing it. I've been peering at this bot's and it's evolved brethren dna for a whole day. The problem is it still won't work, it uses epigenetic locations I've added to my version. (550-554 coppied instantly at birth). Mainly this was to get around the time requirements of the other epigenetic locations and the difficulty of using tie number to accuratly communicate the value.
Quote
This I don't understand. Were they altruistic towards all other bots? Did the altruism take the form of ignoring other bots? Did this altruistic species evolve from the cannis or did it come from the original?

The altruistic species evolved from the original stock, and were tragically altruistic to all other bots.

Quote
Part of the problem is that new mutations get well mixed into the general population, so there's no failsafe to prevent blind short sighted adaptations from totally destroying a population.

Which is why they fight amongst themselves   Multiple times duiring the revolution periods where most of the bots are largely canni's, a new King bot would emerge decended mainly from original stock. After the revolutions produce an obviously more fit bot I'd go in and figure out what made it so much better, or in the case of pure canni's worse.

The most benneficial change, was probably simply duplicating the avoidance and attacking genes. The first two test refage equality to in2, while the last two use in/out epeigenetic recognition.

Code: [Select]
'Revolutionary Bot
cond
start
' Standard epigenetic starter
31999 rnd 1 add 550 store
.delgene inc
stop

cond
start
.out1 inc
32000 rnd
stop

cond
1 =
start
' 1/32001 chance that 550 will randomly change to something else,
' once that happens population begins a downward slide until the population stabilizes at a new number.
31999 rnd 1 add 550 store
stop

cond
*.robage 0 =
start
*550 .out1 store
stop

cond
*.eye5 45 >
*.out1 *.in1 !=
start
.shoot dec
stop

cond
*.nrg 5000 >
start
50 .repro store
*.nrg 5000 sub .strbody store
stop
' Avoid / Attack
cond
*.eye5 45 <
*.eye5 0 >
15 *.vel >
*.in2 *.refage !=
start
15 *.vel sub 2 div .up store
stop

' and this gene sets aim to well... aim. It was an avoidance gene, but along the way evolution had it's vote
' woks better than the original gene so it's been left this way
cond
*.eye5 0 >
*.refage *.in2 >
start
314 inc
*.aim add .setaim store
stop

cond
*.eye5 45 <
*.eye5 0 >
*.maxvel *.vel >
*.in1 *.out1 !=
start
*.maxvel *.vel sub 2 div .up store
stop

cond
*.eye5 0 >
*.in1 *.out1 =
start
314 rnd *.aim add .setaim store
stop

cond
*.eye5 0 =
start
314 rnd *.aim add .setaim store
stop
end
Title: Excess nrg -> body, excess body -> death
Post by: Endy on December 18, 2006, 08:29:25 PM
Still can't use my computer, crazy little things been going over 19 hours straight.  

They're continual firing cannibots, but they still attempt to avoid family. They also seem to still have the posibility of randomly changing 550. Although the odds are stacked largely against it. 1/31549 x 1/32000.

It's almost like there's a kind of inertia to evolution, once the bots were evolved enough to prevent die offs they kept going.
Title: Excess nrg -> body, excess body -> death
Post by: Jez on December 18, 2006, 09:15:29 PM
Can I add that to the bestiary as a working bot? Or is that a bot that also needs one of those epigenetic starter kits?  

Are you saying that they are all cannibots with family avoidance? Sweet little technique, particuarly as a stable(ish) evolved trait if it is. Makes me wonder about that haystack games theory (I did read your link Nums'  ) and how a change like that to the aggressive mice would affect the final result.

Very nice work btw, your title should be; Knight of Evolution!
Title: Excess nrg -> body, excess body -> death
Post by: Numsgil on December 18, 2006, 10:56:19 PM
I'm happy