Skip to content

Releases: JoelQ/ecosystem

Game jam release

06 Jul 04:10
Compare
Choose a tag to compare

This is the version of the game released for the end of the Elm Game Jam 4.

This release includes multiple changes the make the game actually playable including:

  • Game end conditions
  • Scoring
  • Players can control population variables

Now that players can tinker with the numbers, it's possible to create scenarios with self-balancing populations of foxes and rabbits.

ecosystem-1-0-0-start

ecosystem-1-0-0-game-over

Introduce randomness

04 Jul 05:26
Compare
Choose a tag to compare

This release introduces randomness for choices where an animal has multiple valid targets. In the previous deterministic world, anminals would always choose the first valid target, leading to behavior like foxes always gravitating to the top-right corner and starving there despite an abundance of rabbits on the map. Now that foxes move randomly, they quickly kill all the rabbits and then die of hunger.

This required changing up the architecture a bit. I've tried to keep all the actual game logic separate from dealing with randomness as much as possible. For example, moving to a given location and moving to a random location are separate functions that build on each other.

While almost every random operation is described in terms of generators, I've opted to manually step the generators at the top level when iterating through the grid. This is so that all the randomness remains synchronous since each step depends on the result of the previous. While I could have chained them all with andThen, there is a limit to that after which it will trigger a stack overflow (see https://thoughtbot.com/blog/elm-debugging-story). While the grid currently only has 100 cells, growing the grid rapidly increases the number of cells.

I've hardcoded the initial seed of the program as 1, however that doesn't mean that every program plays out the same. This is because I'm independently generating the initial graph (as a command), so all of my repeatable random functions have a different starting point. Therefore I effectively have a random starting seed.

HOTFIX: Broken CSS

03 Jul 01:51
Compare
Choose a tag to compare

the v0.2.0 release had a bug in the CSS that rendered the game unplayable. This is a hotfix release that fixes the issue allowing the game to be played.

Introduce hunger and reproduction

02 Jul 06:06
Compare
Choose a tag to compare

This introduces two new systems:

  1. Hunger
  2. Reproduction

Hunger adds a food counter on animals. They can increment this counter by eating (foxes eat rabbits, rabbits eat grass when undisturbed). If it ever drops to 0 or below the animal dies.

Reproduction allows animals with high food levels and a valid nearby tile to produce a baby.

All this is getting us closer to the natural boom and bust cycle we are trying to model. Foxes initially boom as they eat a lot of the initial rabbits, then they start starving. As the foxes die out, the rabbits start booming. Since foxes move in a deterministic manner when on the hunt (towards the upper right), they tend to gather in the upper right corner and starve even when there are plenty of rabbits left on the map.

I've also started thinking about how energy moves through the system. All animals burn energy to stay alive, meaning that energy is constantly exiting the system. Energy enters the system whenever rabbits eat since grass is an infinite resource. Energy can be both be added and removed from the system when a rabbit is eaten since foxes gain a fixed energy amount no matter how much energy the rabbit has stored. I'd love to track energy in the system more closely. Perhaps in a future release I might add some graphs.

ecosystem-0-2-0

Introduce some deterministic rules

07 Jun 07:17
Compare
Choose a tag to compare

I added the first game rules. They are:

  1. Foxes will eat 1 adjacent rabbit if possible
  2. Foxes will move if they have no rabbits adjacent
  3. Rabbits will move to a safe adjacent square if they are currently next to a fox.

Each animal is processed sequentially. There is no randomness yet.

A big challenge here came with the neighbors calculations. I'd pulled in the jxxcarlson/elm-cell-grid library to help modeling the grid. Unfortunately it contained some bugs in its coordinate logic, causing the neighbors calculations to give wrong results around the edges of the grid. I ended up vendoring a patched file into the project for now.

Initial release - barely interactive

10 May 18:09
Compare
Choose a tag to compare

This game is being built for the fourth elm-lang gamejam, with a theme of "Animals/Nature". I've been wanting to create a simple ecosystem simulator for a while so this is a good opportunity.

I'm trying a "release early, release often" model for this game so here's the first release. The goal was to have something to show that is visual and interactive, though minimal. The only inputs the user can control are the game speed. Each step forward in the simulation is currently random, there is no logic governing what the next state might look like.

ecosystem-0-1