A Game About Garden Eels?


I’ve become fascinated with garden eels when a colleague shared this article with me:  “Japanese aquarium urges public to video-chat eels who are forgetting humans exist”. I didn’t actually get to call the eels, but I thought that making a game about them would be cool, especially because it totally matches the topic of  Elm Game Jam #4!

We’re working on this game together with Nadya. She researched videos of eels on YouTube, and found that they behaved quite differently in an aquarium versus open waters.  In an aquarium, where there is no strong current, eels seem super flexible and probably lazy too, as they do not need to resist the water. In open waters the “resting” position of an eel depends on the speed of current: a slanted segment coming from the burrow, with a curve towards the head, that is facing the current.

We did not have an exact idea about the game, so we decided to start with the mechanics of an eel. How to represent it in code? My first thought was to break an eel into multiple segments and store their relative angles, however this seemed difficult to control. We wanted the flexibility to animate the way it strikes zooplankton, and the way it hides in the burrow. In other words, we needed an ability to change the position of the head, and control the exposed length. 

The second take was to use cubic Bézier curves. The problem with them is that they do not preserve the constant length. Ian Mackenzie, the author of elm-geometry, suggested to find the intermediate control points by brute force until the length of the curve matches the exposed length of the eel. That seemed to work!

Although a single cubic Bézier curve didn’t perfectly match any possible position of an eel (especially not when it’s bent under the strong current), it seemed to work in most cases, so we just decided to proceed with it.

For the initial setup, I configured the automated deployment to itch.io, so the game gets published every time I push to master.

The next step is to work out the heuristics of positioning the head and the start and end angles based on the speed of current and the location of the prey. I hope to be writing more on the progress of the game, so stay tuned!

Also, if you have any idea about the possible game play, please let me know in the comments!

Leave a comment

Log in with itch.io to leave a comment.