Very cool! However, I don't see why this has to be so specific for Linux from when by judging from the libraries used it can be also compiled for MingW, macOS, Free/Open/NetBSD, QNX and even surprising Haiku.
It looks pretty interesting but unfortunately I'm unable to run the demo, getting a crash in glDrawElements which is sort of outside of my scope to address. As a side note the debug symbols flag doesn't get passed to individual C files so the binary ends up without debugging symbols (as a workaround I moved the -g3 flag to CC variable instead).
Interesting. What distribution are you using? On Debian it has been working fine, however on macOS I also encounter the glDrawElements issue. Still working on that.
Not the OP, but it crashed with ubuntu 19.10 with a GTX1070 with the default ubuntu nvidia binary blob:
i nvidia-driver-390 - NVIDIA driver metapackage
Maybe the code is incompatible with libglew2.1?
When I run:
$ ./ecosim
Segmentation fault (core dumped)
I see a window map for an instant before the seg fault.
This seems very cool. I would recommend including an animated gif or link to a YouTube video showing the results of the simulation under a variety of settings/parameters. Also, this would probably get a lot more traction if it used web technologies WASM and webgl. Would be cool to combine this with an evolutionary algorithm similar to the Scriptbots project by Karpathy.
If you're at all concerned with keeping it reasonably easy to find, you may want to know that the name Ecosim is in use by software for simulation modeling of trophic energy flows in ecosystems.
Ecosim has prettier graphics and seems more high level and concerned with ecology, while nanopond is more about just open ended program evolution (including the rise of self-replicators ex nihilo... it starts by just generating totally random programs).
Nice, this is so cool! I had a few line-type creatures wriggling around at first and then a huge population explosion occurred and a swarm started filling the screen.
Here's another ecology oriented cellular automata rule called ECOLIBRA, a cross between LIFE, BRAIN (and optionally ANNEAL on the bit plane that determines water/land), from John Walker's and Rudy Rucker's classic CelLab (which Autodesk originally published as a PC application, but John Walker has ported to JavaScript):
>This rule is a cross between Life and Brain. The basic idea is that the cells are divided between dark “sea” cells and light “land” cells. We run Brain in the sea, and on land we run not Life but AntiLife. All the land cells are normally firing cells, and the presence of an active AntiLife cell is signaled by having a land cell which is not firing. Full details on EcoLiBra are in the Cellular Automata Theory chapter.
>The name EcoLiBra suggests 1) an ecology of Life and Brain, 2) a balanced situation (equilibrium), and 3) the human intestinal bacteria Escherichia coli, known as E. coli for short. The third connection is perhaps a bit unsavory, but remember that E. coli cells are in fact the favorite “guinea pigs” for present day gene splicing experiments. As one of the goals of CelLab is to promote the development of artificial life, the designer gene connection is entirely appropriate. I've given EcoLiBra a nice, symmetric start pattern, but it also does fine if you use the Bit Plane Editor to randomize all bit planes.
>The EcoLiBra rule, consisting of Brain and AntiLife,
each turned on by the red/black boundary.
>But when the sea runs Brain and the land runs Life, the situation is no longer symmetrical. The pervasive presence of Brain's refractory state makes it less likely for a sea cell to have seven firing neighbors and be turned into a land cell. Unless we change the transition rules, the land will always melt away. So to give land a fighting chance, I now say that a sea cell becomes land if it has seven or six firing neighbors. Also I use better colors: Black, blue, and green for Brain; red and yellow for AntiLife.
Here is a variant I call "ECO" that runs "ANNEAL" on the water/land plane, and (for giggles) a heat diffusion in the upper left-over planes.
Very cool. I have dreamed of building something similar. I would be interested in these modifications:
1. Change living/non-living distinction of food to two different dimensions, shared by living and non living food alike:
* Composition - arbitrary bits to match against a consuming organism's diet
* Defense - arbitrary bits to match against consuming organism's capabilities, might be a function of energy level for living food
2. Organisms leave behind waste as part of eating and/or moving. Waste left behind is food for other organisms
This might allow for the rise of symbiosis and multicellular organisms
Very cool! I wonder if anyone has done something similar but for people and companies in an economy... it's my dream pet project, but I've never even gotten around to researching where to begin.
Anyone interested on this might also be interested in an mobile app called "Cell Lab: Evolution Sandbox" [1], which does a good take on a cell simulation "game".
30 comments
[ 4.3 ms ] story [ 91.0 ms ] threadBut a very interesting project nevertheless.
gcc -c main.c gcc -g3 logger.o quadtree.o graphics.o utils.o agents.o input.o main.o -o ecosim -lGL -lm -lglfw -lGLEW $ ./ecosim Segmentation fault (core dumped)
Maybe the code is incompatible with libglew2.1?
When I run: $ ./ecosim Segmentation fault (core dumped)
I see a window map for an instant before the seg fault.
If you're at all concerned with keeping it reasonably easy to find, you may want to know that the name Ecosim is in use by software for simulation modeling of trophic energy flows in ecosystems.
https://en.m.wikipedia.org/wiki/EcoSim
https://github.com/adamierymenko/nanopond
Ecosim has prettier graphics and seems more high level and concerned with ecology, while nanopond is more about just open ended program evolution (including the rise of self-replicators ex nihilo... it starts by just generating totally random programs).
https://www.fourmilab.ch/cellab/manual/rules.html#EcoLiBra
>ECOLIBRA
>This rule is a cross between Life and Brain. The basic idea is that the cells are divided between dark “sea” cells and light “land” cells. We run Brain in the sea, and on land we run not Life but AntiLife. All the land cells are normally firing cells, and the presence of an active AntiLife cell is signaled by having a land cell which is not firing. Full details on EcoLiBra are in the Cellular Automata Theory chapter.
>The name EcoLiBra suggests 1) an ecology of Life and Brain, 2) a balanced situation (equilibrium), and 3) the human intestinal bacteria Escherichia coli, known as E. coli for short. The third connection is perhaps a bit unsavory, but remember that E. coli cells are in fact the favorite “guinea pigs” for present day gene splicing experiments. As one of the goals of CelLab is to promote the development of artificial life, the designer gene connection is entirely appropriate. I've given EcoLiBra a nice, symmetric start pattern, but it also does fine if you use the Bit Plane Editor to randomize all bit planes.
https://www.fourmilab.ch/cellab/manual/chap4.html#EcoLiBra
>The EcoLiBra rule, consisting of Brain and AntiLife, each turned on by the red/black boundary.
>But when the sea runs Brain and the land runs Life, the situation is no longer symmetrical. The pervasive presence of Brain's refractory state makes it less likely for a sea cell to have seven firing neighbors and be turned into a land cell. Unless we change the transition rules, the land will always melt away. So to give land a fighting chance, I now say that a sea cell becomes land if it has seven or six firing neighbors. Also I use better colors: Black, blue, and green for Brain; red and yellow for AntiLife.
Here is a variant I call "ECO" that runs "ANNEAL" on the water/land plane, and (for giggles) a heat diffusion in the upper left-over planes.
https://github.com/SimHacker/CAM6/blob/master/javascript/CAM...
Here are the guts of the rule (omitting the heat diffusion layer calculation):
1. Change living/non-living distinction of food to two different dimensions, shared by living and non living food alike: * Composition - arbitrary bits to match against a consuming organism's diet * Defense - arbitrary bits to match against consuming organism's capabilities, might be a function of energy level for living food
2. Organisms leave behind waste as part of eating and/or moving. Waste left behind is food for other organisms
This might allow for the rise of symbiosis and multicellular organisms
[1] https://www.cell-lab.net/
when cell collide, the bigger one take life points from the smaller. Cells give birth randomly with slightly changed DNS (color, speed, etc)
play in browser:
http://life.viralpoetry.org/