Fablefarm 2D

An attempt at making a 2D game

Introduction

I've started countless attempts at making games over the years. I consider myself a gamer, although I dont have much time for that hobby left these days. Nevertheless I find video games incredibly inspiring - they're basically most of the things that excite me blended into a single product of engineering, art, music, design and UI/UX. My journey into game development began back in 2014 when I started programming classes at university.

My first taste of game development happened through YouTube. I stumbled upon a creator building a 2D platformer in Java, and I was instantly hooked. This led me down a rabbit hole of programming tutorials - I first had to learn this magical language that was able to achieve such things as video games. Later I learned that pretty much any language can do it, but at the time I was sure it had to be Java. While browsing Java tutorials on Youtube, i came across another creator called ThinMatrix. He had just started a 3D game development tutorial in Java using OpenGL. His videos were (and still are today) both a learning experience and a source of inspiration. I decided to follow along with his tutorials and ended up building a basic 3D engine of my own in Java. However, as I progressed, the challenges began stacking up. Without a solid foundation in programming, engineering principles, and software architecture, I eventually hit a wall and couldn't take the project any further.

A shot from my first ever game dev project. A custom game engine written in Java and LWJGL with OpenGL

With that, I kinda lost my drive, side-tracked a bit and eventually stopped working on the project.

Unity

The algorithm gods of youtube still kept flipping a game dev video my way here an there though, and so I eventually discovered Unity. I realized that I didn't need to write my own engine from scratch — Unity could handle the nifty low-level things. This felt both like a revelation and a loss at the same time. Having acquired substantial knowledge of OpenGL and VAOs and VBOs and all that good stuff, part of me didn't like to just use an off-the-shelf product and have it do the hard stuff for me. I did a few tutorials and prototypes, but I couldn't really get into the flow with it. I also got heavily side-tracked with the creation of 3D game art. I needed that so I could put it in my scenes in unity. So I went and watched tutorials about making game art in blender or maya. But for making the 3D models, I also needed to first draw the side views of the models, so I went and watched tutorials about drawing in photoshop. And so on and so forth. I never really got to the point where I could put all the pieces together and make a game. In fact I was so far from it, that I lost motivation again.

Over the next few months, I managed to build some interesting prototypes, usually based on some tutorial I was following. One of those prototypes was focused on generating procedural terrain, and I was very happy to learn how that worked. However, I eventually ran into performance issues that I wasn't fully prepared to solve. I wanted to have dense grass and vegetation in the world, and I couldnt manage to get this done without the framerate completely plummeting.

My first terrain generator in action. At this stage It just performed simple height-based coloring of the landmass

The performance issues as well as the lack of art assets were draining my motivation. I also didn't have a clear vision for the projects I was working on. They usually revolved around a technical concept I was learning about, but I didn't have a story or a game design in mind. I was just building things for the sake of building them.

Concept and vision

When I started this project, I told myself that I was going to meticulously follow the advice of a good friend of mine, which was to get to a complete (although minimalistic of course) game play loop as soon as possible, and then iterate on that from there. In order to have a complete game play loop that early on, I actually needed to have at least some rough idea where the project was gonna go eventually. It didn't have to be a perfect plan, but a direction at least. I decided that the game would be a non-violent survival game in 2D with farming and base building functionality. The player farms and collects food and building materials, catches and cares for magical creatures that in turn reward them with magical items that enable the player to catch the next bigger creature. The end goal of the game is to revive the mother of the player, who has been petrified into a stone statue. The player must collect 4 dragon eggs, hatch them and grow them into adult creatures, so they would reward them with their magical essence which can be used to craft a potion to lift the curse from the mother. I wanted to create a game that was relaxing and meditative, with a focus on exploration and discovery. I also wanted to create a game that was visually appealing and had a unique art style.

The benefits of 2D and generative AI

I specifically decided to go with a 2D game here, because I thought it was going to be easier in terms of engineering, but also to make custom art in 2D. It would completely remove the need for 3D modeling, which I had lost insane amounts of time with in the past attempts. And with the onslaught of generative AI tools, I could leverage those to make assets. This worked very well, especially for vegetation and other map objects. I found a very nice tool called Scenario which is a browser based asset generator specifically for game art. I used it to generate asset sheets like this by using a text prompt and a reference image for the visual style.

An asset sheet that was generated with Scenario

I could then use Unity's sprite editor to chop these sheets into individual sprites and use them in my game.

Character design and animation

I wanted to have a cute hand drawn character for my game. I generated some designs in Scenario and then adapted them in Procreate on my iPad. Here is the result of this process. I was quite happy with how that turned out.

Character design, front side and back views

The next step was animating this character. For this I used Blender and a tutorial by Sketchy Squirrel. First I had to chop up the character into individual body parts, draw the missing areas myself in Procreate. Then I had to learn everything related to Blender from scratch and it was quite a lot of work to get the character finally animating in Unity. In the end, the result of this process was ... okay. The animation looked basically like if I had cut out the parts from paper and moved them around like a stop motion animation. It was not very smooth, some movements looked unnatural, especially the ones where the character moves forward or backwards and not sideways, since the arms and legs needed to move in a direction that simply does not exist in 2D.

Limitations and challenges

I wanted to know how other 2D games achieved their realistic looking character animations and quickly found out that they were actually animating in 3D, then rendering the result from different view points. This also allows to easily have many more movement directions, without having to animate them all separately. I decided to leave that for later and continue with some development of gameplay. Here I bumped into another limitation of 2D games. I wanted to have lush forests with dense vegetation, and I wanted the player to look for resources in this environment. It was tricky to bring this vibe across, because if the forest was dense, it would obstruc the view of the player making it difficult to find things. I partially solved this issues with making foreground objects transparent, but I still wasn't fully satisfied with this solution. I also didn't really manage to just bring across the feeling of "vastness" of a big forest. It always felt kind of small to me.

Conclusion

In the end I still implemented quite a few things: A wood chopping feature, collecting map objects like mushrooms and stones, placement of buildings, crafting and the minimal game play loop where the player collects an egg, brings it to the statue of the mother and offers it to finish the game. I learned a lot in the process, and looking back I still find there is something to the atmosphere this prototype conveys.

Wood chopping, placement of buildings, character animation, UI and minimal game play loop

I might come back to this at some point in the future. But at this point of the project, I was very convinced that for the concept I was going for, a 3D environment would work better. So I started from scratch, in a new project that can be found here.