My ramblings
I’ve lately been inspired by Loren schmidt and her new project. Although her project is way more involved and complicated and more game-like it inspired me to try something in similar vein.
So here’s a small ecosystem and how it works.
A brownish substance that piles up. It’s calculated as follows:
A dark teal totally inert substance. Mostly for light cover
A blue/light blue material. Currently does nothing important. Calculation:
Dark reddish material. Simulated same as sand.
Everything in here is either light blocking (e.g. sand, walls) or not (water, empty air, seeds). It’s shown as light background and it lights up first layer of sand.
Plants have 3 stages: seed, growing and fruiting.
It’s an orange/yellowy falling pixel. While falling it moves a bit to left/right just so it would not fall into same dark spots. To go into growing stage it needs to fall onto sand and be lit by light. If it sits too long in darkness it decomposes into dead plant matter
.
The green material. The seed extends it’s shoot upwards. It has a bias towards the light. Each pixel placed consumes some energy of the plant and even existing consumes some more. On the other hand sunlit pixels of the plant generate energy. If energy gets below zero plant turns into dead plant matter
.
The cost of adding pixels is increased (quadratically) for each new pixel. This makes plants stop growing after some time. That is when the plant goes into fruiting
.
The orange blob stuck to the plant. Plant uses it’s energy to grow it bigger. As it reaches it’s size limit it burst into dead plant matter
and some seeds
. This makes new plants as the seeds sometimes get into good place and sprout new plants.
Worms start a single cell and grow by eating dead plant matter
. This reduces the piles of it which would drown out the terrarium very quickly. It also mimics the part of decomposers in natural world. Some behavior traits:
This makes them very good for plants as they come up to the surface, destroy dead plant matter
and then die and turn into sand in sunlight. This is then makes plant seeds sprout.
However this still needs work to be fully closed system:
It’s a very interesting toy to experiment and see some emergent behavior. My approach is more object oriented (i.e. plants and worms are objects) but you could go more Cellular automaton path and get different cell interactions that way (e.g. make artificial cells with cell membrane being one type insides different kind cells). And any way you go it’s a very dynamic and ‘alive’ toy.
Code for this is here.
tags: