
Newer Posts | Older Posts |
Introduction
December 14th 2022 @ 10:46am-
Who am I?
Hi, I am Ken Stauffer, the author of Evolve 5.0. I am a 54 year old software developer. I live in New York city. I have lived in many other cities: Austin, Sunnyvale, Calgary, Pittsburgh, Jacksonville, Montreal, and Waukesha. I am creating this project to share the program with others and share things to do with the platform. I am looking forward to engaging with others and see what they can create with the program.
-
What is new since 2007?
I previously worked on Evolve in 2007. Development got stalled because I over engineered the thing and was attempting too much. I had this elaborate re-write of the simulator to enable super amazing customizations. But the complexity of what I was writting was overwhelming me and I lost interest.
Nuf said, then I got a girl friend and moved to New York city and started a new job. This was a carreer changer for me, and I invested most of my energies on the new job. It's been 12 years now since I moved to New York.
I tried to pick up evolve 4.0 and port it to linux and add 3D over the years. These projects never got too far, and I was left with a bunch of crazy C++ code that I didn't like or care about.
-
Why am I back?
I recently rediscovered Evolve, which I totally had forgetten about. I missed playing with Alife. I saw my old website and really missed playing the simulator. It seemed like a perfect time to re-release Evolve 4.0. It was also highly motivating to be reminded that others cared about this program too.
-
What is back?
The artificial life software I wrote in 2007. Why did it ever leave you ask? It's back because, I let the code rot. I stopped using Windows and Evolve 4.0 ran on windows. Now I use Linux/Mac. This meant I couldn't run the Evolve 4.0 program, nor could I even compile or build a new executable.
So, its back because I have restored the code to running condition.
-
How is Evolve back?
It has been restored and made runnable on the MacOS platform. The core simulator was modified in many great ways. The user interface was rewritten in Swift using Xcode. The alife simulator is still written in C but I have greatly improved the performance and the ability to customize things.
-
What are the old blog posts from 2006/2007?
For context about this project I restored the old blog entries from the ealier years. It's pretty boring material, but this was what I talked about back then. It's probably what I'll be talking about now. I think there will be more reasons to blog content with substance. I think I will be finding more hacks and things to do with this version of the simulator which I can share.
Evolve Code 2
December 14th 2022 @ 10:10amThis 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:
This is where execution starts. We simply call the first unprotected code block, row13. -
row1:
This is TRAP1 handler. If the evolving program calls TRAP1 then this is called. What does this code do? It spawn's a bullet and send's it off in the direction indicated by the 2 arguments passed to TRAP1. -
row6:
This is the TRAP6 handler. If the evolving program calls TRAP6 then this is called. This does the same as TRAP1, except uses a different interface (doesn't use registers R0/R1). It spawn's a bullet and send's it off in the direction indicated by the 2 arguments passed to TRAP6. -
row10 - row12:
These rows implment the bullet's behavior. SPAWN will indicate which code block the new organism starts at. We use row10 for the bullet. Row 11 and 12 is helper code too. All together they implement a un-eatable single cell object that eats in one direction. Then stops when no more moving/eating can happen, then dies (which deposits an organic block at this spot).
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:29amA 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:59amThe 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 2022Below 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 |