pouët.net

Go to bottom

Cycles (a bit like Conway's Game of Life)

category: general [glöplog]
http://www.cathyportal.ru/files/Cycles.zip (1 Mb)

I present to you Cycles - a cellular automation model I wrote, which might remind some of Conway's Game of Life, but is based on different principles.
And the first thing you'll notice is that you can hardly interact with it. Some small interaction possibilities will be described further down. Basically, this thing the way it is done now is mostly to observe the process.

You can just run the program, no need to read anything, but for those who are curious - let's see what's going on there.

You'll see several types of cells: "X", "O", "+", "~" and "=".

"X" and "O" are living cells
"+" are egg cells
"~" are larva cells
"=" is void space

Cells of the grid are randomly accessed and the result of the interaction depends on what state is the cell in. Each micro-cycle tries to place a pair of "X" and "O" on the grid, first "X", then "O", their positions relative to each other are random. "X" is more aggressive, taking a role similar to male, and "O" is female.



Rules
Cycle starts with a "big bang" - all cells are alive, meaning that addressing any of them results in either an "X" or "O".

1. If an "X" is placed on "X", it stays "X". Same for "O".

2. If an "X" is placed on an "O" cell or vise versa, an "+" egg cell appears.

3. If an "X" is placed on an "+" egg cell, it destroys it and turns it into "=" void space.

4. If an "O" is placed on an "+" egg cell, it creates a Red Larva cell.

5. If an "X" is placed on a Red Larva cell, it produces an "X" in its place.

6. If an "O" is placed on a Red Larva cell, it creates a Bio Burst, which means that the field it landed on becomes a usual "~" larva. Two more larva in any of the eight directions around the field might appear. Larva may only land on void space, so if "+" an egg is fully surrounded by non-void cells, only one larva will be produced instead of three. Usually an egg will be surrounded by both void and non-void cells and in that case luck will decide whether the additional two larva will be thrown into what of the 8 surrounding cells. All in all, a Bio Burst can produce 1-3 larva cells.

5. Both "X" and "O" can be placed on usual "~" larva cells, that being the main mechanism of reproduction.





Heating up and cooling down of void space
While all of the above exciting fuss is going on, a process of energy transfers, invisible at first, takes on a life of it's own.

All void cells begin with 0 of charge.

6. Each time a void cell is accessed, it tries to obtain an energy charge from the surrounding 8 cells.
-If at least one of them is non-void, it gets a charge from it. A non-void cell does not suffer anything from the transfer and the void cell receives a +5 charge (heating up).
-If all of the surrounding cells are void, it tries to obtain +5 from each of the 8 cells. Such transfers deplete surrounding cells by -5 of charge each and adds +5 to the center cell (cooling down). If some of the cells do not have a +5 charge, nothing happens. So the best outcome is +40 and the worst is 0.

7. Each time an "X" or "O" are placed on the grid, they feed all the surrounding void cells by +5.

8. When the void cell reaches the charge of 150, it becomes a Blue Larva cell.




Space Burst
This is a second reproductive process possible which adds a couple of more rules.

9. If an "X" is placed on a Blue Larva cell, it cools it down about a third, turning it back into a well-charged void cell.

10. If an "O" is placed on a Blue Larva cell, it creates a Space Burst, which places a "~" larva on the center piece on all of the surrounding it void cells, which in the best case gives a total of 9 larva cells, all of which can be populated, thus creating a second reproductive mechanism.





Big Cycle
Sooner or later the big cycle comes to an end and the grid totally cools down. To start the process over you can either click on a grid which would produce random "X" cells and thus revive the cosmos or else choose "Clear" from the menu and Start the cycle over again.

It was my intention to create a "life" which would have an end. Somehow modelling eternally stable processes is boring and besides most processes in the world we observe do actually have a certain end.

However, they also have rhythm and periods. So, this being a first version, I plan to add a phase of reset which means that after the whole grid has cooled down it will be able to accumulate charge to the point of the next Big Bang.


Okay, enjoy the observations and would love to read your comments on this.
May be interesting, but it's not very fun to watch.
added on the 2009-05-22 23:39:32 by xernobyl xernobyl
Depends on what you are looking for when watching. I personal enjoy to see how it evolves and how it tries to "stay alive". This struggle has a very interesting property of this algorithm.
Okay, guys! Forget almost everything that I wrote above. It was a nice start but now the cellular automata I would like to present to you uses different, less complex rules, and the model itself is much more elaborate and, plainly speaking, more cool.

http://www.cathyportal.ru/files/Cycles.zip

First of all, the universe is now not an enclosed space, but a torus, which means that it is continuous yet finite, which is a very satisfying concept for me, since I was not happy neither with a "room" nor with "infinite space". In a 2D representation it is simply a rectangle where if you go beyond right border you actually come out from the left, if you go down, you come out from up and vice versa for both cases. The torus has also a great property that it is homogeneous, while a surface like a sphere would have special points - the poles.

Second, the initial idea that the process should be a series of cycles - life, death, rebirth, life, death, rebirth - is now actually there.

Third, the program is very interactive, it starts out as empty space and you get to create cell configurations and see them evolve into complex life and you can also add and delete cells in real time.

=======
I will not tell you in too big a detail how everything works - only if anyone specifically asks for it - and for the moment will stick with what you need to know to start exploring the model on your own.




A small walkthrough.

1. Observe how space cools down.
When you start up the program, you will see void cells, most of which are coloured in various levels of blue. The more blue the cell, the more charge it has. However, if you go to Cycle->Start and observe, you will see how everything pretty rapidly discharges with several cells getting the most charge and them also loosing energy eventually so that you will be left with absolutely dark cells.

This is how void space works if left to its own devices. Each void cell that is fully surrounded by other void cells will get a portion of the charge from each one of them in an attempt to fully charge and become an egg which in initial randomly charged space is actually impossible. It is possible, however, when living cells are introduced. Let's see what happens then.

2. Charge a void cell with living cells.
If a void cell is adjacent to a living cell, it will not receive energy from other void cells, but get charged from a living cell and eventually become an egg that will then hatch out other living cells. But for that to happen it either has got to have enough cells around it to compensate for the loss of the charge to other void cells.

Perhaps that explanation is a bit confusing for now. Let's try an example.

By left clicking on the grid, you can produce X cells. Form this construction out of five cells:

X-X-X
X-#-X

Here # is void space. After you've done that, make sure the process has been started (counters below should show numbers, otherwise click Cycle->Start).
Now as you wait for the result, you will soon notice that the void cell within the construction begins to charge strongly. Sooner or later it will become an egg, usually that takes around 1-2 mins.

You can create cells in real time and for this explanation it is safe to leave the configuration you just made evolving and create a different configuration in another spot. The suggested configuration will actually evolve much faster:

X-X-X
X-#-X
X-#-X

As you watch these two configurations, you might see them either start evolving or turn themselves into stable non evolving configurations. For instance, both configurations that I showed you have a tendency to become a square of one gender cells which will then not evolve or else evolve very slowly:

#-C-#
#-X-X-X-#
C-X-X-X-C
#-X-X-X-#
#-C-#

The "C" fields indicate void cells which would tend to be charged more than others since they touch upon the maximum number of living cells. But the exposure of those cells to the "cosmos" is pretty serious so this process usually takes a loooong time.

This configuration, however, will work much faster

X-#-X
#-X-#

because the cell is secure from the void and all the void cells around it touch on the living cells and will not reduce the charge.

In conclusion to this, the most minimal evolving configuration is this one, though it is also the slowest to charge and evolve:

X-#
#-X

Anyway, now that you've experimented with some starting configurations, let's move on!

3. Intermix genders.
So now you can create life by charging void cells. But there is an even faster way to create life, by putting X and O cells together from the start. You know how to place X cells on the grid. If you want to create O cells, all you have to do is right click on the grid.

By creating configurations that contain both X and O cells, you will almost immediately get evolving life. For instance:

X-O-X

or even as simple as X-O, though such configuration will result in a non-evolving or slowly evolving one-gender configuration. That happens because grey eggs (biological eggs) will hatch out only either x or o. But if the egg touches only upon, say, O cells, it will hatch out o. So in X-O configuration one of them will turn into an egg which will deliver babies of another and so eliminate itself completely.

So it makes sense to make a bit more complex configurations to ensure development, or create simpler, but several of them.

4. Gender wars and what cells mean what.
Basically, how the model behaves is that X and O constantly fight each other. We just saw that hatching is, from some perspective, a pretty aggressive procedure so that once the egg is created what type of cells it hatches out depends on what cells are adjacent to it. But this battle is what makes life evolve - a philosophical principle which seems to be working quite well here. The indicator below shows the number of X and O cells, but since the model is balanced, eventually they'll get evened out and be of about the same amount.

So anyway, the grey cells with a "+" are biological eggs and small "x" and "o" are offspring which eventually become adult cells. The red cells are also offspring, they just mark that there was an egg in this cell. When hatching out, the egg delivers one larva in its own place (the red one) and throws 0-2 larva around itself (white ones).

The blue "~" cells are space eggs, as you've probably already understood, and it throws bluish larva around itself. Space eggs hatch out both genders, not depending on what living cells they are adjacent to and, in fact, don't care if there are any adjacent living cells at all. So space eggs are cool.

5. The decay.
You have probably noticed that as you are observing evolving cells, it says below - Cycle: 1. What does that mean?

Well, what happens when the whole universe is filled with living cells and there are no void cells at all, the "cosmos" will go into a cellular decay phase, as it becomes "tired", drained of ability to hold living cells. You will observe that void cells start to appear here and there and space eggs won't hatch. Eventually, the process will escalate and at one point life will stop and empty space will fill most of the universe, leaving islands of offspring and bio eggs. Usually most adult cells do not survive the procedure.

The decay phase eventually ends, cycle number goes up by 1 and you will see life begin to evolve from what is left. In most cases you will see that what is left are once again basic one-gender configurations like the ones we've tried above, various "L" and other tetris-like shapes. Stranded bio eggs will eventually die if adult cells do not connect with them soon and so new cycle will evolve from few basic shapes. Which is pretty fascinating... at least to me!

It is possible that the configurations left after the decay phase will be non evolving ones in which case it means that the next cycle will not develop without placing additional cells. Basically, it would mean that the process has stopped and life of this universe has ended.

It is fun to see how many cycles life will evolve. However, the process is indeterminate, so you cannot influence the amount of cycles any definite universe will live. Your influence can only be direct - that is, adding cells. But even without adding anything the universe can live many cycles on its own. I have seen it go through as many as 8 cycles and usually universes tend to live long.

Additional controls.
By left double clicking you can create a void cell (a good way to erase individual cells). By right double clicking you can produce a bio egg.



That's it for now!
Enjoy!
tl;dr like SIX times man!

someone remove this guy's 'create thread' priviledge
added on the 2009-06-05 08:41:12 by skrebbel skrebbel
this is getting quite tiring - fuck off with your witty comments. if you have nothing to say, just don't fucking say it.
I think that what he wants to say is "get the fuck out of the scene, you are not appreciated here". And yes, its mean. Skrebbel is deffo a nice guy so if you managed to piss him off, it means something.
I am also a nice guy and if skrebbel managed to piss me off - it might mean something. Why should anyone tell me to "fuck out of the scene"? Are there any special parameters as to what is allowed to post on these boards? I am not producing demos, but I do take part in demoparties as a musician, playing demomusic. And a lot of things which I post are much more relevant than all those "random something" threads. The above thread depicts a curious cellular automata. There are a lot of coders here - it might be interesting to them.
spewk: it is not
added on the 2009-06-05 10:46:55 by Rob Rob
I think most coders would appreciate it better if the description was simple and to the point, or not there at all. Something like "Here's my new cellular automaton toy" with a link and an interesting screenshot would do it.
added on the 2009-06-05 10:50:51 by Preacher Preacher
Good to know. I will not post any applications here again. Right?
Preacher: it is a complex engine. When I showed this people required explanations. I mean, really, if one doesn't want to read it all, then just don't. Nobody's forcing ya. But the screenshot is a good idea, I will do it.
Quote:
Nobody's forcing ya.

but you are sticking one of these useless topics right up our faces about every other day... as if one optimus on this site isn't enough yet. so please do us a favour and GTFO.
added on the 2009-06-05 10:59:32 by havoc havoc
No, not really. This is a list of threads I have started on this BBS. And so? The BBS is full of threads and each thread is started by someone. Each person can make such a list. What is your point? That those threads are bad? I do not agree. I like them just like any other "random stupidity thread".

Let's see the fucking topics I discussed.

1. I want an edit button.
I really do. It is a good suggestion. Lately lots of people started bringing this up and I decided to create a thread on the matter. I really do think an edit button is a good idea.

2. Almost useless software.
Funny topic. A lot of people liked it. You are telling me I shouldn't have written it? Why?

3. Making an ambient pad out of a jazz loop.
Yep. Guess what - I decided to share something I did musically. What, demoscene has no musicians? I dunno, I got responses. Some negative, some positive. People did respond.

4. Random "good mod" music thread.
Don't tell me it is a bad thread. It can't be!

5. Scream Tracker 3
Well.... bringing up a topic about a tracker program on a demoscene related forum is absolutely... a good idea! Is it not?

6. Pirate Bay trial.
Current events. It was interesting to discuss. Are you saying that because it is a demoscene BBS you cannot bring up topics which are not 100% demoscene related?

7. A text game
Yep, presented a small game, got 3 responses, no harm done to the world.

8. Screwdriver.
One of my best threads to this day. Or not. Just a funny thingy like any "random" thread out there. Actually, did not get much response, just some poems )

9. Proprietary Text Editor: some free software humour
The free software multipage thread. Might not've been entirely pleasant but useless? I don't think so.

Should I go on?
havoc: very well, I will stop posting at pouet. If I am so hated here it would be silly to stick around, indeed.
The day you realize you're useless, you shit bricks.
louigi drama queen: i never said i hated you, but if assuming so helps you to stop posting pointless topics, then please do feel free to misinterpret my opinion.
added on the 2009-06-05 12:22:58 by havoc havoc
heyhey, would you blease stop flaming eachother? this may be boring for some, but this guy has some interessting stuff i actually think that (as a coder).
I may have some opinions about the program, ive made game of life in java myself and cellular automata can produce some interessting patterns, it does not just have to be that, but it can be used for alot of simulations. but about the program, it would have been nice to change the speed to whatever you want, because i think some dont have enough patience to sit and watch this for more than a minute.
added on the 2009-06-05 12:37:27 by rudi rudi
also the squares are quite boring to look at, may be it would be nicer to change the graphics to some sprites or icons.
added on the 2009-06-05 12:40:14 by rudi rudi
Louigi: I don't think no one here hates you, most of us if not all of us, don't even hate Optimus :). The problem is, you do not realize that you are being a little selfish. Maybe Gloom was right, maybe we seriously need that button that would read us what we have written. The point is, try to read what you have written. Here let me help you:
Quote:
I really do. It is a good suggestion.

It's a good suggestion from your point of view, it doesn't apply to me. Also Gargaj currently maintains the site and if he would've wanted one, he would've made one. The point is, you can't generalize your opinions. You are not superior nor inferior to anyone here.
Quote:
Funny topic. A lot of people liked it.

I didn't think so. See, again your opinion cannot be generalized. There might be people who disagree.
Quote:
Don't tell me it is a bad thread. It can't be!

Meh, I think it is pretty useless after having access to many mod sites with a search bar already.
Quote:
It was interesting to discuss

Again for you... Might not apply to others.
Quote:
The free software multipage thread. Might not've been entirely pleasant but useless? I don't think so.

Once again, you might not think so. But for me at least it was useless, disturbing and irritating.

No-one is asking you to cease your activities within the scene, no-one has such a right nor the power. But we simply ask you to think twice before posting. Your areas of interest might not be the areas of interest of everybody posting here. And I am afraid in most cases they are not the areas of interest of the majority either as we now ended up in such a situation.

Finally, there's this other part that only I would personally speak myself: It is somewhat alright that you share the things you accomplish / do with us. I, myself am an amazing fan-boy of cellular automaton in the first place so I really do appreciate your enthusiasm towards this thread and thus this subject. But, sharing even the most useless output of yours with us collaborates with our level of dislike for you. Sure, if you share solely true and deserving accomplishments that might indeed benefit some of us if not all. And we'd be happy to discuss. But you should see that, starving for attention won't do any good to you.

Finally, if you are addressing coders I think many coders would prefer short digests that give brief information about the product. I hope we all are sane people here, I am pretty sure most of us can figure out the rules and the underlying work-flow of your product. But pasting pages of text then when people complain telling them to fuck off is quite derogatory and belittling for yourself.
added on the 2009-06-05 13:06:00 by decipher decipher
Decipher has a point there.
added on the 2009-06-05 13:19:27 by rudi rudi
I would totally disagree with Decipher here. The day when the only things acceptable to post here are "areas of interest of the majority" is a sad day. But that said, do not act like a crybaby when people say tl;dr to a post that is too tl;dr.
added on the 2009-06-05 13:31:42 by Preacher Preacher
Quote:
The day when the only things acceptable to post here are "areas of interest of the majority" is a sad day.

he didn't say that (but you know that, yes you do) :)
added on the 2009-06-05 13:35:48 by havoc havoc

login

Go to top