Author Topic: Non-Determinstic Bot DNA flow  (Read 28245 times)

Offline PurpleYouko

  • Bot God
  • *****
  • Posts: 2556
    • View Profile
Non-Determinstic Bot DNA flow
« Reply #15 on: June 01, 2005, 06:50:31 PM »
Quote
Are you sure you can't obtain similar, if not exactly the same effect, by breaking operations in different cycles, or grouping them in the same gene? Tell me why you use the "same-cycle" flags.

One version of DOM Inv uses a system where he sets a tie onto a victim (using a random tie phase which he stores into a memory location) and simultaineously sets a flag to show that the tie has been fired.
Later in the genome he uses the stored flag and tie phase number to feed on the tie that he just fired.
The following cycle he fires a new tie with another random number, overwriting the earlier one.
This is a deliberate technique to prevent the victim from using leach genes with *.tiepres to reverse the energy flow.

At other times with MBs I need to perform several things on the same cycle and while it would be possible to seperate them a little, it is already very difficult to form the entire structure within the 20 cycles that the initial tie remains soft.

First parent gives brth, baby overwrites the tie then rotates, checks that it is clear ahead then reproduces again etc. Try doing this with structures of ten or more robots and get it all to fit inside 20 cycles.

I have no problem with changing it such that the genes are pseudo simultaineous and have no effect on subsequent genes. That I can work around without too much difficulty even though it does directly undermine one of my most powerful combat techniques.

Completely ignoring certain gene activations anfd just choosing one of many that should activate on a given cycle will utterly destroy any robot that I either have made in the past or might make in the future.
Every robot that I have ever designed relies on having more than one activated gene per cycle. Even the most simple food finding routines rely on the fact that it is possible to use course direction changes first then overwrite them with finer direction changes when needed. (like if there is a bot in eye 9 and also one in eye 4)
With a randomly dropped gene activation system this won't work and the robot will go either one way or the other or maybe choose to do neither while it builds body points or maybe it will just stop and make a couple of shell points while it is being bombarded by a predator instead of returning fire or running away.

toatlly crap idea that will destroy DB IMO  :(
There are 10 kinds of people in the world
Those who understand binary.
and those who don't

:D PY :D

Offline PurpleYouko

  • Bot God
  • *****
  • Posts: 2556
    • View Profile
Non-Determinstic Bot DNA flow
« Reply #16 on: June 01, 2005, 06:53:08 PM »
I will download and try out the experimental system and see if my fears are well grounded or not.
There are 10 kinds of people in the world
Those who understand binary.
and those who don't

:D PY :D

Offline PurpleYouko

  • Bot God
  • *****
  • Posts: 2556
    • View Profile
Non-Determinstic Bot DNA flow
« Reply #17 on: June 01, 2005, 07:04:56 PM »
OK I just downloaded and tried it.

As I feared each and every one of my bots becomes a useless lump of crap, neither moving nor feeding nor even recognizing each other.
They just sit around and die  :(

This modification to the game adds nothing to the range of possible variety and takes away everything that ever made it interesting to me.

I can see where this may be useful and fun from an evolutionary point of view but for the combat side of the game it is the worst thing that could ever happen to it short of utterly losing the source code and having to start over again.

Make it an option to run non deterministically if you like but I absolutely hate it.  :(
There are 10 kinds of people in the world
Those who understand binary.
and those who don't

:D PY :D

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Non-Determinstic Bot DNA flow
« Reply #18 on: June 01, 2005, 07:31:41 PM »
Not to harp on the issue, but the chromosome idea I explained above and and this one too solves all the problems Carlo pointed out, while not removing the deterministic nature of the program.

Non-deterministic languages usually follow a tree structure, that is, something like a non-deterministic turing machine, which is way beyond the assembly like scope of the darwinbots language.  We could add something along those lines, but that could be an ALife program in itself. (or even a doctoral thesis if done well enough).

What I offer is more along the lines of multi-threading.  Each chromosome is its own thread, executing simoltaneously on shared resources.

From a strictly programming stand point, multi-threading is far superior.  There are established ways on how to build such a system and program within it.  Non-deterministic languages are still something of a novelty, and rather poorly studied.  Plus, procedural single threaded programming is always possible in a multi-threading environment, so current bots wouldn't break (a huge plus when you can manage it).

That said, I have no problem with a non-deterministic checkbox if the hard work is already done.
« Last Edit: June 01, 2005, 08:15:19 PM by Numsgil »

Offline PurpleYouko

  • Bot God
  • *****
  • Posts: 2556
    • View Profile
Non-Determinstic Bot DNA flow
« Reply #19 on: June 01, 2005, 09:26:21 PM »
As I said before Num, I can live with a system which simulates simultaineous gene activation without being able to set and use flags on the same cycle.

I like your idea as you described it above. It would be far more realistic in fact.

It is just when the program just randomly chooses to activate only one gene out of the many that flag true, that I can't deal with it.
There are 10 kinds of people in the world
Those who understand binary.
and those who don't

:D PY :D

Offline Carlo

  • Bot Destroyer
  • ***
  • Posts: 122
    • View Profile
Non-Determinstic Bot DNA flow
« Reply #20 on: June 02, 2005, 05:38:25 AM »
I uploaded a slightly patched version of DB ND, the activations window was not working properly, and now it is.
I tried to run a sim. I noticed that many bots show some difficulty in moving, as they were in a high friction environment. But it is not an inheritable feature, so I think it's some kind of bug. Probably unrelated with nondeterminism.

I noticed also that reloading original name, mutations and generation from the dna file (the thing about which we discussed a few days ago, for the #shp parameter) worked in version 2.3 but not in version 3.36. Parameters are saved into the dna but aren't loaded back anymore.  :angry:

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Non-Determinstic Bot DNA flow
« Reply #21 on: June 02, 2005, 06:03:30 AM »
That's weird.  There are so many subtle bugs in odd areas, none of them really destructive, but not really helping anything either.

I've got a whole wall of sticky notes of things to work on.
« Last Edit: June 02, 2005, 06:58:24 AM by Numsgil »

Offline Carlo

  • Bot Destroyer
  • ***
  • Posts: 122
    • View Profile
Non-Determinstic Bot DNA flow
« Reply #22 on: June 02, 2005, 09:52:42 AM »
Quote
I've got a whole wall of sticky notes of things to work on.
So that's another one, worse. It seems to me that some mutations aren't correctly reported in the mutations number variable. It seems to be lower than it should, even reporting 0 overall mutations for a dna that's clearly mutated (it had a gene duplication).

And I'm working on the dna parameters bug

Offline shvarz

  • Bot God
  • *****
  • Posts: 1341
    • View Profile
Non-Determinstic Bot DNA flow
« Reply #23 on: June 02, 2005, 01:52:33 PM »
Uhm, I tried the ND version from Carlo - I can't really start a succesful simulation.  The problem (as PY pointed out already) is that current bots are not coded correctly for this version - they require cross-talk between genes.  And the more genes they have, the less likely they are to work.  My Alga Ternia seemed to be fine though, it ran and reproduced fine - but much slower than usual, which is also expected, because it has 7 genes.  Time was flowing 7 times slower for it...  

The time flow is the biggest problem with ND version.  I think Dom ternia had no chance for survival even if all genes were fixed not to rely on each other.  It has 32 genes, so time was flowing 4 times slower for it than for its prey!  And it was flowing unpredictably: say you see something and want to follow it - how can you do this accurately if you don't know what is going to happen to you in the next 32 cycles?  The next time acceleration gene activates may be "next cycle" or "100 cycles later".  In 100 cycles the food is so far, that there is no chance to even find it.

So I think in its current form the undeterministic version is not workable even in theory.    I really like the idea of it, and the possibilities it offers, but right now it gives only problems.  Undeterministic effects must work on a much-much deeper level than "gene/cycle".  Just like in real life - we have non-deterministic effects at quantum level, but they average out and result in continious experience of our consiousness.  The way ND version works now is equivalent to us "phasing in and out" of consience: imaging that!  You try to grab a pen and next moment you find yourself 3 meters away from the table where your coworkers moved you so that you don't get in the way.  This is what current version does for bots.
"Never underestimate the power of stupid things in big numbers" - Serious Sam

Offline Carlo

  • Bot Destroyer
  • ***
  • Posts: 122
    • View Profile
Non-Determinstic Bot DNA flow
« Reply #24 on: June 02, 2005, 04:14:14 PM »
Quote
Uhm, I tried the ND version from Carlo - I can't really start a succesful simulation.

I've already run a 1 million cycles simulation starting with e_diplomaticus. It seems to work pretty well.

Quote
My Alga Ternia seemed to be fine though, it ran and reproduced fine - but much slower than usual, which is also expected, because it has 7 genes.  Time was flowing 7 times slower for it... 

No. I dont' know alga ternia, but reproduction is usually triggered by energy level. Energy is still coming at the usual rate. The only difference is that the robot _notices_ it has reached the right energy level with some delay. If, on average, three of the seven genes are active at each cycle, then the delay should be of about 1.5 cycles after the energy is enough to reproduce.

Quote
I think Dom ternia had no chance for survival even if all genes were fixed not to rely on each other.  It has 32 genes, so time was flowing 4 times slower for it than for its prey!

This makes no sense. The slowing down depends on the average number of simultaneously active genes, not on the number of genes. A 100 genes robot which has only one gene active per cycle, has the same reaction times of a deterministic robot. Probably no more than two or three genes are active on average at the same time in a 32 genes robot. So its _reaction times_ (not its speed) should be at most two times slower.

Quote
The next time acceleration gene activates may be "next cycle" or "100 cycles later".  In 100 cycles the food is so far, that there is no chance to even find it.

Apart from the exaggerated numbers, this is true. The slower reaction times (nothing to do with 100 or even 10 cycles, anyway, but usually to or three at most) are a problem in a world in rapid change. For example e_diplomaticus has clearly some problems in following its preys, which often go really too fast. I'll try to run some high friction sim to see if, slowing down movements and making them less random (less bounces, etc), the nondeterministic bots work a bit better.

Anyway, I ran a 1 M cycles evo sim with diplomaticus. Nothing complex, but it evolved (it does distinctly better than the unevolved version). I've set very high mutation values for gene duplication and deletion, so that it ended up with 30 genes on average (it started with 10). Most of the genes are working, not junk, because they contribute to the overall behaviour, so there's a selective pressure on them. There's a risk of number of genes increasing in a sort of intra dna arms race (each duplicated gene subtracts a little probability to other simultaneously active genes of being executed) but probably it can be counterbalanced tweaking the cost of copying dna during reproduction.
This evening I'll tweak my sim parameters better.
« Last Edit: June 02, 2005, 04:16:30 PM by Carlo »

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Non-Determinstic Bot DNA flow
« Reply #25 on: June 02, 2005, 04:15:11 PM »
I've fixed (I think) problems with mutation information passing to kids in my working version no one has yet.



Again, I think we should have ND DNA flow as an option, but its effects are just to surreal for most modern 'tweaked' bots except short bots (which by definition have multipurpose genes).
« Last Edit: June 02, 2005, 04:18:37 PM by Numsgil »

Offline shvarz

  • Bot God
  • *****
  • Posts: 1341
    • View Profile
Non-Determinstic Bot DNA flow
« Reply #26 on: June 02, 2005, 04:42:17 PM »
Good points, Carlo.

When I said that Alga ternia was slow, I meant that it was running slower.  Before it saved 15 in .up on every cycle and now only every 3rd/4th cycle, so of course its speed was lower.  I also had to adjust the energy flow, because Alga were now spending 3-4 times less energy/cycle than before.

Here is what I think about the time flow: If on every cycle a bot has 3 active genes, then all it's processes and reactions are 3 times slower than those of a bot with a single active gene.  You can equate it to time flowing 3 times slower for it.  The more active genes bot has, the slower is the time flow.  This is a problem in itself, as you are driving evolution to either reduce the number of potentially active genes or to make each gene more complex.  A duplicated copy of a gene is a huge liability, because without contributing much it slows down bot's reaction time.  It should not be this way.

In addition, it is impractical from our point of view, because the speed of simulations is essentially slowed down by a factor equal to the average number of active genes.

As I said, in theory the non-deterministic processes should be moved further down into the guts of simulation, so that the execution of different genes appears to be parallel and happening at the same time.
« Last Edit: June 02, 2005, 04:42:47 PM by shvarz »
"Never underestimate the power of stupid things in big numbers" - Serious Sam

Offline PurpleYouko

  • Bot God
  • *****
  • Posts: 2556
    • View Profile
Non-Determinstic Bot DNA flow
« Reply #27 on: June 02, 2005, 07:03:36 PM »
Check out this exert from the genome of Hunter 2.2.

Code: [Select]
'turn towards enemies or food
'*************************

cond
*.eye1 *.eye5 >
*.eye1 *.eye9 >
start
mult mult 140 15
stop

cond
*.eye9 *.eye5 >
*.eye9 *.eye1 >
start
mult mult -140 -15
stop

cond
*.eye3 *.eye5 >
*.eye3 *.eye7 >
start
mult mult 80 7
stop

cond
*.eye7 *.eye5 >
*.eye7 *.eye3 >
start
mult mult -80 -7
stop

cond
*.eye4 *.eye6 >
start
mult mult 40 4
stop

cond
*.eye6 *.eye4 >
start
mult mult -40 -4
stop


'avoid conspecifics
'****************************
cond
*.refeye *.myeye =
start
mult mult 120 0
stop

cond
*.refeye *.myeye =
*.eye5 60 >
start
mult mult 628 0
stop

' Spin back after repro
' ************************
cond
*51 0 !=
start
mult mult 628 0
0 51 store
stop

'reproduce
'*********
cond
*.nrg 2000 >
*.robage 40 <
*.body 20 >
*.eye5 30 <
start
50 .repro store
1 51 store
mult mult 628 0
stop

cond
*.nrg 4000 >
*.body 100 >
*.eye5 30 <
start
70 .repro store
mult mult 628 0
stop

' rotate
' *******
cond
start
.sx store
.aimsx store
stop

Every one of these genes has to be 100% able to operate on every cycle or the robot does absolutely nothing.

Never mind slow reflexes. It just doesn't react to anything... EVER. it just sits there and does absolutely nothing.

It is completely impossible for it to see food and simultaineously turn to follow it. By the definition of the non-deterministic system, only one of these genes can activate in any given cycle, therefore it can never turn at all under any circumstances.
It is also 100% impossible for the carefully designed repro-spinback gene to have any effect whatsoever since this gene cannot ever act on the same cycle as the single gene that actually rotates the robot.
Occasionally one of them moves in a straight line for a while but that is about it.

The same is true of pretty much all the top robots these days.

Simple little things like Diplomaticus Diplo may still work reasonably well but that is because they are incredibly simplistic to start with.

I have given it a fair try and I still have to say that this concept is totally unworkable without utterly destroying DarwinBots.
There are 10 kinds of people in the world
Those who understand binary.
and those who don't

:D PY :D

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Non-Determinstic Bot DNA flow
« Reply #28 on: June 02, 2005, 07:11:34 PM »
I think the kinds of bots that work in a deterministic universe and a ND universe are incompatible.  Which is why it's a neat idea for an option, but unworkable for the default.

Offline PurpleYouko

  • Bot God
  • *****
  • Posts: 2556
    • View Profile
Non-Determinstic Bot DNA flow
« Reply #29 on: June 02, 2005, 07:27:23 PM »
Yup, I can go along with that. Might be fun for a bit of a play with evolving species but I sure won't be using it much.
There are 10 kinds of people in the world
Those who understand binary.
and those who don't

:D PY :D