I’ve been working on a game off and on for the last couple of months, and I figured I might as well start writing about my efforts in order to keep a history of how it progresses!

The Concept

One of the games that always stood out to me when I was younger was Final Fantasy Crystal Chronicles: My Life as a King. The core game loop involved not adventuring yourself, but rather creating a town that would be optimized for the npc adventurer’s that lived there. It was a city building game but on a much smaller scale than something like SimCity or Cities: Skylines.

At the start of every day, your adventurers would wake up and travel to a board to learn about the jobs you had chosen for them. From there they would go to several stores to buy equipment, armor, potions, or other goods. They might also go to a park to relax a bit, or a pub to hear the latest gossip. After all of that they would set out to a dungeon to fight for honor and glory. The challenge in the game came from optimizing the npc’s routes. You could place buildings wherever you felt like but that might mean your adventurers would needlessly spend extra time walking between all the shops. The wasted in game hours really add up and certain dungeons could take weeks compared to days if you didn’t optimize your route.

Nothing that has come out since that game has scratched the same itch for me. So I set out to create my own game in the same vein. After some brainstorming the minimum feature set I wanted to support included:

  • The ability to place buildings in a town.
  • NPC’s needing to travel between these buildings to acquire items.
  • A time system to create a need for optimization.
  • Some sort of task that only the NPCs can do to acquire resources for the player to accomplish the above.

With that out of the way it was time to get to work!

The Tech Stack

Godot

I’ve toyed with several game engines in the past including, GameMaker, RPG Maker, and Unity. Godot piqued my interest as being an engine that was completely open source. It also was a general purpose engine that could be used to create nearly anything as opposed to something that was specifically designed for a certain niche. Unity was a strong contender but for a side project I liked the idea of not having to deal with a licensing model should my circumstances change in the future. Best of all, it supported C# which I had been getting more involved with at work at the time.

Autofac

In order to facilitate clean design / unit testing I wanted to utilize dependency injection. Autofac seemed to fit the bill and was well supported

NUnit

The big thing that has changed about me since I’ve worked on my previous games is that now I am a professional software engineer and have real world experience under my belt. One major facet of that involves having automated tests for code. Not all of it is testable since certain parts inherently need to be coupled with Godot, but so far I’ve been able to make abstractions that make sense for isolating the interaction points.

Resources

I’m certainly not an artist so I bought some resource packs to help make the game with, there’s a chance I would only use these for prototyping but time will tell.

Progress So Far

This is the fun part! Time to show off what I have so far.

Movement

With Godot, nothing was a given. Keybindings don’t automatically move a character, character sprites don’t get animated when moving, and the actual movement itself isn’t handled. All of those had to be added, and as you can see the player is able to move in 4 directions ( Actually 8 but it isn’t shown) which changes their sprite to match the corresponding direction. When the player is moving the sprite is animated, and when they are not the sprite is still.

Dialogue

The player can walk up to objects and interact with them. When talking with an npc for example the npc turns towards the player for the duration of the dialogue. A (placeholder) message box shows up and text is added to the screen several characters at a time. In addition a small audio segment is played. I haven’t decided on the rate that the text should display, but changing it is fairly trivial. The player can advance through multiple pages of text and even fast forward the text by pressing the enter key. There are more improvements to be made like auto paginating dialogue in the future to make development easier and support variable game window resolutions.

Camera

When moving, the camera also follows the player around when they get close to the edge of view border. From the above clip we can also see that tilesets of objects like trees and houses have been setup to introduce collisions to the player. This also involves the player being able to walk “behind” objects that would appear in front of the player given the camera angle. Again all of this took manual effort since Godot requires work to get everything hooked up, although it does make the process fairly easy.

Conclusion

And that’s a wrap for what I have so far! Hopefully some more noticeable features will get to be worked on soon, now that there is a solid base to work off of. With how things are looking, placing buildings may be next on the list.

Until next time.