Evolve 5.0 Blog
VOLVE    5.0

Newer Posts Older Posts

Introduction

December 14th 2022 @ 10:46am




Evolve Code 2

December 14th 2022 @ 10:10am

This is the the latest evolve program from the same simulation that has been running for 15 days. Here's a quick explaination of the protected code:

main:
{
      13  call
}

row1:
{
      DSLEN  50  >=  ?exit  DSLEN  2  <  ?exit
      R0  R1  2swap  R1!  R0!  R0  R1  1  5  10
      SPAWN  pop  R1!  R0!
}

row2:
{

}

row3:
{

}

row4:
{

}

row5:
{

}

row6:
{
      DSLEN  60  >=  ?exit  R1!  R0!  R0  R1  1
      5  10  SPAWN  pop
}

row7:
{

}

row8:
{

}

row9:
{

}

row10:
{
      R0  R1  2dup  11  call  12  call  HALT
}

row11:
{
      2dup  OMOVE  ?loop
}

row12:
{
      2dup  EAT  pop  2dup  OMOVE  pop  255  NEAREST
      EAT  ?loop
}

; ----- protected / unprotected -----

row13:
{
      2  OMOVE  22  call  2dup  14  call  22  call
      15  call  22  call  16  call  22  call  17
      22  call  22  0  30  18  call  call  44
      R6  22  call  20  2dup  pop  OMOVE  and
      R2!  2dup  EAT  GROW  OMOVE  1+  29  BIGGEST
      -95  13  -41  R4++  -1  pop  OMOVE  2  ?loop
      R8!  30  R6++
}

row14:
{
      2dup  EAT  0  GROW  4  GROW  OMOVE  -85
      GROW  EAT  pop  -85  HOTTEST  2dup  EAT
      ?loop  OMOVE  1+  -38  R0  OMOVE  ?loop
      -87  -50
}

row15:
{
      HOTTEST  OMOVE  GROW  54  GROW  -26  OMOVE
      -26  GROW  54  GROW  GROW  -4  -51  nop
      R8++  51  -16  -74
}

row16:
{
      -48  0  NUM-CELLS  --R6  73  GROW  OMOVE
      invert  GROW  2dup  9  GROW  OMOVE  pop
      /  ?loop  pack2  94  --R4  -1  2dup  EAT
      pop  OMOVE
}

row17:
{
      2+  55  -7  SIZE  86  16  call  2  OMOVE
      -12  37  2+  63  R5!  61  -1  R4!  -41  53
      SPREAD-ENERGY  58
}

row18:
{
      ENERGY  3  /  R0!  -2  -3  R0  MAKE-SPORE
      -5  -51  R0  MAKE-SPORE  -85  LOOK  -6  CB
      15  52  OMOVE
}

row19:
{
      -48  GROW  54  99  COLDEST  31  1-  -44
      R0  79  -71  AGE  79  -71  -28  -24  R5++
      -50  MAKE-SPORE  29  PEEK  --R8  -22  max
      0  NUM-CELLS
}

row20:
{
      GROW
}

row21:
{
      /mod
}

row22:
{
      2dup  EAT  ?loop  ?loop  62  -48  -51
}

row23:
{
      R5!  63  +  or
}

row24:
{
      MAKE-ORGANIC  not  78  R2++  -22
}

row25:
{
      -93
}

row26:
{
      MAKE-SPORE  -26  *  -22  not  -38  R2++
      POKE  rot  -52
}

row27:
{
      87  -26  unpack2  TRAP5  ?exit  0  R8++
      51  R8++  51  54  --R4  >
}

row28:
{
      -87  MAKE-SPORE  <=  74  22  call  2dup
      14  call  15  call  22  call  16  call  22
      call  17  22  call  22  0  call  /mod  -59
      R9!  85  call  44  R6  -11  41  22  call
      20  2dup  pop  OMOVE  and  -3  R3  LOOK
      R6++  OMOVE  1+  29  BIGGEST  -95  13  2+
      63  R5!  -38  R4++  -1  pop  OMOVE  2  ?loop
      R8!  30  R6++
}



unprotected code vs protected code

December 13th 2022 @ 9:29am

A kforth program is split into two regions, a protected region (the first N code blocks) and the rest of the code which is UNPROTECTED code. Most CPU's have a "protected mode" bit or supervisor mode bit. Evolve 5.0 doesn't have such a bit. It uses the current program counter location to decided what mode the cpu is in. If you are running code that is in the protected region, then you have super user rights etc.... If you are running in an unprotected region you are running in user land.

More information on this here.

I'll be randomly blogging like this from now on. These notes are to jot down little tidbit of knowledge about the simulator and how it works.




About Evolve 5.0

December 11th 2022 @ 3:59am

The simulator implements a clever platform for evolving programs. I think of the simulation not as artificial life, but as evolving programs.

Evolve 5.0 allows the user to customize the simulations via strain profiles. A strain profile defines a set of properties for an evolving program. The most important properties that a strain can have are protected code blocks and protected instructions.

These protections allow the user to create an evolving program which is a mixture of code you write and code that evolution writes. You can create a sandboxed program which can spawn copies of itself and move around the grid. This sandboxing allow you to invent new instructions/behaviors/morphologies that will not be eroded away by evolution.

With protections, you can modify the rules of how various instructions behave. For example, one could change how energy transfer happens during the EAT instruction.

The simulator allows multiple strain profiles to co-exist within the same simulation. This can be used to create different types of evolving programs. For example one set of programs could be robots that cannot evolve but move around barriers and organic matierial in some way. Another strain could implmenet a "bullet" object which the main creatures can fire. So some strains can become environmental objects. And some strains can be a mixture of evolving code and protected code.

It's hard to explain without concrete examples. I created a "bullet" object which just moves in a line and EAT's and then collects all the energy it consumes into a single ORGANIC block. My other strain, would call an instruction i invented TRAP1, which spawns a bullet object to the bullet behavior. Then I waited to see if any creature would evolve to use this. My results have been very fun to see creatures shooting other creatures.

Another example is a "nibbler" creature I invented. This creature responds to KEY-PRESS and MOUSE-POS instructions. It moves around and will eat/kill other organisms, via the user controlling it with the keyboard. This creature can spawn different number of copies of itself so that the user can control a swarm of these "nibblers". I call it the nibbler because it nibbles on other organisms and takes their energy. I designed it to unstuck simulations that have too many blobs and not enough fun creatures.

The hardest part I am working on now, which is to document all this stuff. The program itself is 99% done and does exactly what the old Evolve 4.0 did with a much better simulator for customization.




Evolved Code

December 1st 2022

Below is the evolved KFORTH program after three days. The comment "protected/unprotected" was added by me. This seperates the code which does not mutate from the code which does mutate. This is a new feature of Evolve 5.0.

This organism has protected code which implements a bullet. When the creature stumbles upon the instruction TRAP6, it will shoot a bullet. Another new features of Evolve 5.0 allows the bullet to un-eatable because it belongs to an uneatable strain. Lots of experimentation available with the new simulator.

main:
{
      13  call
}

row1:
{
      DSLEN  50  >=  ?exit  DSLEN  2  <  ?exit
      R0  R1  2swap  R1!  R0!  R0  R1  1  5  10
      SPAWN  pop  R1!  R0!
}

row2:
{

}

row3:
{

}

row4:
{

}

row5:
{

}

row6:
{
      DSLEN  60  >=  ?exit  R1!  R0!  R0  R1  1
      5  10  SPAWN  pop
}

row7:
{

}

row8:
{

}

row9:
{

}

row10:
{
      R0  R1  2dup  11  call  12  call  HALT
}

row11:
{
      2dup  OMOVE  ?loop
}

row12:
{
      2dup  EAT  pop  2dup  OMOVE  pop  255  NEAREST
      EAT  ?loop
}

; ========= protected / unprotected ==========

row13:
{
      16  call  2  OMOVE  22  call  2dup  14  call
      22  call  15  call  22  call  16  call  22
      call  17  R0  -10  22  call  22  0  30  18
      call  call  22  39  OPCODE  call  20  2dup
      pop  OMOVE  and  R2!  2dup  EAT  GROW  OMOVE
      CHOOSE  R4++  TRAP7  -1  2  1  ?loop  R8!
}

row14:
{
      0  GROW  4  GROW  -85  HOTTEST  OMOVE  1+
      -38  R0  2dup  2dup  EAT  GROW  OMOVE  NEAREST
      -49
}

row15:
{

}

row16:
{
      ENERGY.O  --R5  -26  0  NUM-CELLS  --R6
      73  GROW  OMOVE  invert  GROW  2dup  9  GROW
      OMOVE  pop  R3!  96  --R4  -1  2dup  EAT
      pop  OMOVE
}

row17:
{
      OMOVE  GROW  R3!
}

row18:
{
      ENERGY  6  /  R0!  -1  -4  R0  MAKE-SPORE
      /  -7  -2  R0  MAKE-SPORE  -83  LOOK  -40
      18  56  -5  pop  FARTHEST  pop
}

row19:
{

}

row20:
{
      -38  pop  96  OPCODE!
}

row21:
{

}

row22:
{
      2dup  EAT  ?loop  ?loop  57  -7  -54
}

row23:
{
      3
}

row24:
{
      GROW  R6  -85  HOTTEST  OMOVE  GROW  R3!
}

row25:
{

}

row26:
{
      14  OPCODE!  23  DSLEN  TRAP8  24  26  17
      2dup  -59  R7!  ?exit  R7!  PEEK  -71  -62
      3  EXUDE  --R9  2over  43  TRAP3  call  ?loop
      nop  -5  -3  -80  GROW  R3!
}

row27:
{
      R3
}

row28:
{
      dup  call  -3  SPREAD-ENERGY
}



Newer Posts Older Posts