Simulating and Studying Ecosystems, Genetics & Neural Networks (Part 1)

Hello! It’s been a while! I haven’t stopped making things, but I did stop posting about what I was working on. I suppose I just got really busy with life stuff; since my last post, I graduated from University and found a job at local game development company!

Anyway, on to business!
I’ve wanted to make a little ecosystem simulator for a long time – mostly because complex simulations are a lot of fun to watch as they can act in surprising and entertaining ways, but also because of some games I played a long time ago; namely, the Creatures series.

Creatures 2 Box-Art

Creatures 2 box-art

Those of you familiar with the series likely know about those games’ ridiculous depth and complexity, beyond the simple-seeming pet simulator front. The, uh, creatures of Creatures were simulated not just as game entities roaming around, but with biochemistry and neurology simulators built-in.

The in-game neuroscience kit. Dendrites, lobes, axons, neurons... it's all here!

The in-game neuroscience kit. Dendrites, lobes, axons, neurons… it’s all here!

As you played through the game, you could unlock tools to let you examine and interact with these systems. Perhaps less-known are the wide variety of third-party genetics editing tools, which allowed modders to create their own species outside of the game’s standard breeding simulations, where the genome of the creature controlled what kinds of chemicals and enzymes would be released by which cells in which body parts, and so on. It astounds me how much was crammed into this series, which was released during the late 1990s.

The 'Zeus' editor. Note the biochemistry stuff going on in the window in the top-right.

The ‘Zeus’ editor. Note the biochemistry stuff going on in the window in the top-right.

Of course, all of these systems were far above my head when I first played. Having been used to the Petz series of pet-simulators, I wasn’t really prepared for the sad and often quite sudden deaths of my Norns, most often caused not by negligence, but by my misplaced understanding of how everything in the game world belonged to a tightly-controlled ecosystem. My fervent attempt to put all the stinging insects I could find far away from my creatures meant that in the short-term, they never learned how to respond to danger, and in the long term, the fruits and vegetables ceased to pollinate and I couldn’t grow any more. So, I began to feed them using the smattering of ancient machines littered on the game’s world, but there’s only so much replicated cheese a creature can live on before it dies of obesity. I had created a barren world, where the only constants were death and misery.

I went back to playing Petz.

This is the highest-quality screenshot of Petz I could find.

This is the highest-quality screenshot of Petz I could find.

However, a more recent run-up at the series showed me the depth and care put into the series by its creators. I’m a sucker for complex interlocking simulated systems, being a big fan of games like Dwarf Fortress and Space Station 13, so why not build my own? I don’t think I’ll attempt anything quite as complex as any of those, but I do want a sort of cellular-type creature sim thing going on!

I’m not entirely sure what it’s going to be, but I have a few targets I want to hit!

  1. The game world should obey rules regarding the conservation of energy; food shouldn’t appear from nowhere for things to eat, and things shouldn’t be able to move without expending some form of energy. Additionally, expended energy shouldn’t vanish from the system, but be re-incorporated as heat, light, or other form of radiation.
  2. Creatures should exist as a collection of body parts which allow certain behaviours. Control over these body parts should be driven by a (very) simple neural network.
  3. Creatures should have a genome, from which the body parts derive their properties and the neural network its configuration of neurons/axons/dendrites, connections, and weights.
  4. The simulation should be deterministic, so that I can scrub backwards and forwards through a timeline to any particular point. This will also make it easier for:
  5. The simulation must be examinable at all levels. Representations & descriptions of neurons firing, etc for each creature should be made available. These could be textual at first, but graphical later.

I’m probably going to try and come up with solutions for simulating various things (like genetics, neural nets, etc) myself, based on my understanding of the topics. While this will probably result in inaccurate or incorrect behaviours, I find that examples and literature on those things tend towards heavy mathematical backgrounds, with altogether far too many greek letters and arcane symbols for my liking. Additionally, many of these resources make assumptions about what contexts these simulations are used in, and often don’t make allowances for the fact that maybe I don’t want to run it as a single one-shot on a mainframe and instead as a live, visually-represented entity. I appreciate the work that goes into researching these topics, but I’m not trying to reach out into the frontier of simulative science, I just want to make a fun toy out of it!

As for the tools I’ll use for this, I’m probably going to use Otter2D, which is one of my favourite game development libraries.

So, that’s my idea and my rationale! Time to get cracking!