Wednesday, April 10, 2024

Faire Hollow Dev Log #10 - Refactoring

I've decided to take some time to refactor my code base. This is a natural part of every game developer's journey, and in the long run it will save a ton of headache and make my game much more stable and manageable as it grows in scope and complexity!

I've introduced several important new features that are only possible because I've rebuilt the underlying game logic:

  1. The day/night cycle now extends from midnight to midnight. This is important, because there may be a future where I may make some overnight quest or monster battle that can only happen in the wee hours of the morning. (Previously a day lasted from 7am to 3am, without any flexibility.) The code to handle time is much more simplified.
  2. I've restructured the game so that a "Player" represents a human player, and they can play one of many different "Characters". These characters can be swapped in and out, so that you can play the role of a shopkeeper, or king or queen, or adventurer, etc. (Previously there was just one "player", which also represented the single visual avatar on the screen.)
  3. I've introduced the concept of a GUID (globally-unique ID) for players, characters, shops, etc. This is the underlying code that will make multiplayer a possibility in the future. I don't have plans to introduce multiplayer when the game launches on day 1, but if there is demand I will be able to do it precisely because I've got these unique IDs now representing every object.
  4. Inventories are now much more scalable: characters have inventories, as do shops, and the underlying code is essentially the same. I'm using a lot more object-oriented concepts to make life easier.
  5. Inventories no longer contain references to a fixed catalog of item IDs. This is a small thing that makes a big difference: now it will be possible to enchant or otherwise customize an item, maybe even making a one-of-a-kind item that doesn't exist in any other player's game anywhere, and store the details of that item in an inventory with the save-game file.
  6. To anticipate a future where modders might want to create mods for Faire Hollow, I've structured the save file so that it is simple editable JSON. I've thought a lot about this, and although it means that a player could simply edit their save file and give themselves infinite money or whatever, the benefit is that it will be much easier to extend and customize the game. If someone wants to cheat, and that is the way they get enjoyment out of the game, then who am I to stop them. What difference does it really make?
  7. The code is more modern and cleaner overall: I've added comments throughout, which will make future-me much happier.
I will share more updates, including more visual updates, as the code continues to improve! For now, thanks for tuning in, and don't forget to wishlist Faire Hollow on Steam!

Faire Hollow Dev Log #11 - Official Trailer

I am thrilled to share the official trailer for Faire Hollow! This has been a month-long effort to create just the right combination and var...