Category: Game Development

Fiancée Game – 09 – It’s Been a While

Estimated Hours of Work Since Last Update: ~40

   Oh. Hey! I have this blog thing that I totally haven’t been neglecting. I’m back!

   Update time! I’ve not had nearly as much time to work on Fiancée Game as I’d have liked over the past handful of months. I normally do my programming after work in the evening, but work has been particularly busy this year and has no signs of stopping so I’ve had to get work in where I could. I did manage to squeak in a pair of dev streams in May (Links for those interested: 1 | 2) which were a blast. I’d like to do more dev streams, if only because it forces me to sit down and work for a handful of hours without distraction. I feel that I’ve made a lot of progress given the time I’ve put in, all things considered. As per usual, if you want a more granular look at everything that’s taken place for this update, check out the Fiancée Game Trello.

   Apologies ahead of time for the lack of pictures. Most of the work on this update was on mechanics, not so much new features that are player-visible.

Old Become New
   The biggest chunk of time spent on this update was moving old systems to some much newer (and easier to work with) design choices. In the past, an enemy and a player were different types of objects as far as the game’s code was concerned. No longer is this the case. Now the player, companion, and enemies are all of the same stats_MOB class. This means that instead of having to do something like dealing damage three ways (once for the player, once for the companion, and once for enemies) I just do it one way. Nice!

   In addition to making a single mob class, I completely rewrote how items and the inventory were handled. Things are much faster now. There are still some improvements to be made in this area, but they’re far from necessary at the moment and I don’t even know if they’ll be needed in the final version of the game.

UI
   I’ve mentioned it in the past, but I don’t much care for UI work. That said, on one evening I sat down and hammered a decent chunk of time into prettying up the UI for the game. I have to admit that it certainly feels more polished, if nothing else. I’ve also switched the default font from a blocky styled font over to Fontin, which most would recognize from Path of Exile.


The windows match and tooltips now have formatting! There’s still some work to be done, but the UI is getting there.

   There’s still more work to be done (as per protocol), but it’s certainly coming along nicely and looks much better than the stock gray windows I was using before. As you can see I also added prerequisites for skills, green prerequisites are ones you meet. Once a skill has all of its prerequisites met it will have a white outline instead of a red one. Skills with green outlines are ones that the player has learned.

   I also managed to squeeze in time to finally get the UI to properly orient itself based on the game’s window resolution. It looks pretty crappy on anything less than 1080p, but you can go all the way down to 720p and it’s still playable.

The Sounds of Battle
   While I previously implemented a very basic sound system into the game for playing music, I went a bit further and implemented a sound handler. This will allow me to play sounds for the player (novel, I know) in addition to whatever music. I threw in some placeholder sound effects for combat and they definitely make it feel much more like a proper game. I was very surprised by how much more like a proper game having even basic combat sound effects made Fiancée Game feel. I also implemented fading between tracks on the music player; no longer is switching areas in the middle of a music track super jarring.

   To go along with the above changes, I picked up a few sound packs from Epic Stock Media which I’m hopeful to get some use out of for this project as well as future ones. I’m likely to pick up a few more off of the Unity Asset Store at some point, but these delay that need a great deal.

General Optimization
   Among all of the above I did some optimization on particularly bloated bits of code. I improved tooltips so that they only draw once per frame instead of once per frame per object that could draw a tooltip (don’t ask). Also, at the suggestion of MadJackMcMad (the dev of Dungeonmans — go buy his game) I made some optimizations to how objects face the camera that had some pretty substantial positive effects on performance. I still need to get a proper billboarding system implemented, though.

   There’s still work to be done regarding UI optimization, mostly related to text display, but I’m to the point now where the amount of effort I’d have to put into it probably isn’t worth the gains I’d be looking at. The game runs perfectly fine with how things currently are and I’m debating over whether a fraction of a millisecond worth of frame draw time is worth refactoring a lot of old display code. Were this something I was planning to sell, I’d probably put the time in to fix these old issues, but as it is I probably won’t bother since the performance gains would likely be unnoticeable on anything but the poorest hardware.

New Mechanics
   I finally implemented a buff/debuff system to the game. It’s currently only used by the player for a pair of abilities in the rogue skill tree (Dervish and Smoke Bomb), but it certainly works!

   In addition to support for buffs, I changed how random item drops work. Combat can now result in a decent pile of loot for the lucky player. Where before each creature could drop only a single item, now they can drop many. Creatures have their own personal drop tables, but also share a much larger global drop table that has a chance to drop things based on a critter’s given level. With this change came a revised post-combat victory screen; the player has up to three pages worth of loot to tab through. There’s still a bit of work to be done on it; I want to disable page navigation when there aren’t multiple pages of loot, but that’s hardly a pressing matter.


The new post-combat victory screen. I’ll get a proper !!!VICTORY!!! header image up there eventually. Maybe.

   Along with changing how loot is portioned out to the player I also modified how monster spawning works. Previously, each monster spawner on the map had to be hand-tuned. That is, each had to be populated manually. Now, in addition to allowing that, I also implemented monster spawn tables. If, for example, I wanted an area of the map to swarm with generic undead I could just put together an undead_TrashMOBs spawn list and point a spawner to that instead of having to hand edit each spawner as I place them. This also makes expanding spawn lists much easier. Where I’d previously have to go back and add a new spawn to each spawner, now I can just add it to a single spawn list and all spawners that use that list will have access to the newly added critter beast. I figure 99% of spawners will use these spawn lists. The only ones I can think of off of my head that won’t are boss spawners and perhaps rare spawners that I may or may not hide around the world.

   As mentioned briefly above, I also implemented proper prerequisites for skills. Skills can now have both level requirements as well as skill requirements. I don’t expect the player will have much trouble meeting requirements for skills if they stick to one tree, but if they branch out they might have some issues. Skill points come quickly at early levels, but as the level count increases the rate of skill acquisition decreases. A character will only be gaining 40 skill points over 100 levels and half of those points come in the first 30 levels.

Balance is Changin’
   Finally, I did a bit of work on balancing numbers across the game. While I’m not super concerned about general game balance, I do want to avoid things being too crazy. Working with this in mind, I pulled the numbers down a little bit. Character stats at creation are now generally much lower on the high end — previously a class could hit a 32 in its primary stats before spending up to 10 bonus points on them — while the low ends are slightly lower. All classes now generate a number between 3 and 16 for each stat and have 8 points pre-assigned to them. Once that number is determined the player is given between 1 and 8 ‘bonus points’ to spend as they will. The highest stat a character can start with now is, in general, a 28. Magicians can hit a 32 Magic stat, but having a Magic stat that high is needed because they are so heavily dependent on their spells insta-gibbing things where other classes have enough survivability that they can afford to slug it out with enemies if need be (a magician starts with an average of about 15 HP, the lowest among other classes is roughly 30 — magicians are going to be Hard Mode™ in the early game).

   I’ve been putting some thought into how I want ability/spell costs to scale and while I’d originally thought to have them scale with level, I think I’ll keep them static and instead have Energy be a fairly limited resource. I want using abilities to have an impact in combat, and not something to generally be spammed (that’s what basic attacks are for). To offset this being overly cruel, I think I’m going to have a character’s Energy recharge to full after every combat. This keeps the player from having to worry about “saving it for a boss fight” and lets them really let loose if they’re in a dire situation or want to clear easy fights quickly.

That’s It
   That’s all I’ve got for this round of updates. I’m hopeful that the next update will come sooner rather than later, but only time will tell. I’ve been holding off on updates until I’ve got a decent amount of stuff to go over, but if folks would prefer more frequent incremental updates I could try that, too. Let me know in the comments what your thoughts are. Until next time! (I promise it won’t be ~4 months ’til the next update!)

Read More Fiancée Game – 09 – It’s Been a While

Fiancée Game – 08 – A Little of Everything

Estimated Hours of Work Since Last Update: ~15

   As per protocol it’s been a while. As per protocol life has been busy for me. Alas, it seems that whenever I finally get into a good rhythm of working on Fiancée Game that everything gets chaotic all of a sudden. Strange.

   Anyways, I’ve got an update. A fairly substantial one. Lots of stuff has been done in the ~5 weeks since my last post. I also set up a Trello page if you’d like to follow development as it goes on, minus the witty banter that I know you all come here for. I’m not going to go over every little thing that I’ve done, but I’ll cover the major stuff here. If you want a more granular look at everything that’s taken place for this update, use the link to the Trello page above.

Of Tooltips and Optimization
   The most time consuming thing I’ve worked on for this update has to have been either tooltips of game optimization. I completely rewrote the tooltip system from the ground up. It’s a lot faster now. Like, a LOT faster. It also supports multiple kinds of tooltips instead of just tooltips for items.


We now have tooltips for stats!

   While I was working on tooltips I’d noticed some fairly heinous slowdowns. Fiancée Game typically sits at around 400 FPS on my system. For whatever reason, tooltips were slowing this down to about half that (!!!). The reasoning behind this was how I was displaying them. I’d originally had the tooltip display running once per frame for every object that could display a tooltip because I was being a lazy ass (and it wasn’t particularly harmful to the FPS early on). However, as time went on, the number of objects increased and running the same bit of code ~100 times per frame does have an impact on performance.

   The fix was easy enough. I stored all objects that could have a tooltip in a global list. Once I’d done that, I moved the displayTooltip function from those objects to my IO handler that checks the list once per frame. If it finds that an object should have a tooltip displayed it displays it. There is now no FPS loss for tooltips.


I also prettied up item presentation a bit. Item subtypes were added, too.

Skills and Leveling
   Gaining levels has been implemented. I’m still fooling with experience point requirements but I’ve got the larger details set. I’d originally expected a fairly low max level, but I’ve gone back on that. Instead of the level cap being the original ~20 that I’d initially planned, I’ve bumped it to 100. Why? Well, future-proofing, for one. I don’t expect that the ‘base’ Fiancée Game is going to have enough content to it to even remotely hit the level cap. The Fiancée™ has, however, demanded that there be future expansions, so I’m leaving room for those. I expect the base game will be completed in 30th to 40th level range. Or more, assuming she grinds a lot. Which she does.

  Currently gaining a level nets you some extra health and energy based on your class. You also get ability score points and skill points. The rates that these points are gained vary based on the level band you happen to be in at a given time. Skills and abilities are gained quickly at lower levels, but less frequently as the levels pile on.

   There’s currently no grand fanfare when you gain a level, just a message in the message box. I’ll eventually get some sort of graphical flourish implemented so that the player knows they’ve gained a level.

   I’ve begun implementing skills. I currently have all the basic skills for the rogue skill tree implemented. While getting skills working (and getting the UI put together for them) I discovered that I’d have more room than initially intended — almost twice as much space, actually.


We also have tooltips for skills.
There’s still some formatting work that needs to be done.

   My original design for Fiancée Game was to have four tiers of skills. With the new UI put together I have room for seven. I spoke with The Fiancée™ about this and she was okay with the idea of an expanded skill system. We brainstormed how we were going to handle the extra tiers and settled on a ‘specialization’ system. How it will work is that the first three tiers of skills for a given skill tree are considered ‘basic’ skills and anyone can learn them. Tiers four through seven are considered ‘specialized’ skills and when you hit a specific level (I’m leaning towards around 12, or so), you’ll pick a specialization and be stuck with it for the rest of the game. You can have a specialization in each skill tree that you’ve invested a certain number of points into.

   Each skill tree will have three specializations (the rogue’s, for example, are acrobat, assassin, and thief) that offer different styles of play within a given skill tree. Using the aforementioned rogue specializations: the acrobat is for avoiding damage via evasion, assassins are great for single target damage and damage over time, while thieves are good at stealing things from enemies and getting more treasure in general. In addition to unlocking specific active abilities with each specialization, a specialization will grant passive bonuses as well. The assassin, for example, will grant bonuses to damage with daggers and will add a poison-based damage over time effect to the rogue’s bandoleer/fan of knives and dagger toss abilities.

   I’d originally thought to lock the specialization trees behind skill point expenditures, but with the rate that skill points and ability score points are gained I’ll likely just go with a “you have to find the trainer” method instead. I think it’s better this way anyways since it will encourage exploring the world more than just hoarding skill points instead of spending them on interesting skills.

The Stuff I Work On Instead of Fixing Bugs
   It hate bugfixing. Not because it’s hard, but because it’s time consuming and often tedious. I fix critical bugs, but most smaller niggling bugs remain, or have been given band-aid patches.

   Instead of fixing the bugs in my old spaghetti code, I instead implement totally unnecessary features that really should wait. But they don’t. Because I hate fixing bugs.

   So, what has this amounted to? Three big things as of right now. First was loot piles (and examine text):


My inner loot whore is breathing heavily right about now.

   I programmed loot piles mostly as an exercise of boredom. I’d just finished debugging some god-awful bit of combat-related horribleness and wanted to add something to the game as opposed to fixing things that I’d broken. Loot piles were the result. They’re hand placed but I have the ability to fill them with random goodies from a list as well as have a chance to not even spawn. Yes I fully intend to plug one of these things in somewhere that has a 5% chance to spawn and then another 5% chance to spawn some stupidly powerful item. Because I can. And because The Fiancée™ needs to know that this game hates her.

   With the loot piles I also implemented examine text. It’s fairly simple: if the player right-clicks on an object in the world it pops up a bit of descriptive text in the message box. You can examine objects, but not things like walls or doors (I would hope that we all know what those are). I eventually want to have it display the description somewhere more prominent on the screen, but there’s no rush for that. I’ll probably use this descriptive text system at some point in the future to give hints to the solution of puzzles or the location of secret areas.

   Up next came in-combat damage splats which I shamelessly burgled from the excellent Eye of the Beholder games — buy them on GoG (or, failing that, watch either my or Captain Planets’ LPs of them (#shilling)):


Believe me when I say that my splats were… lacking.

   While I’m generally opposed to adding ‘pretty’ things unless they’re necessary at this point in development, I’ve felt that combat needed some feedback-related love for a while now. I added these because, dammit, who doesn’t like seeing damage numbers flying around?! I fully intend to have combat-related sound effects implemented for the next update.

   And, finally, monster spawners:


It spawns things that want to kill me.
Joke’s on it; player death isn’t implemented yet!

   These were implemented because, frankly, I got tired of having to restart the game to continue killing stuff. I guess it’s a good sign that I like running around murdering things. Means the core gameplay isn’t completely terrible. It’ll be better once I’ve gotten more combat-prettiness implemented and have got the skill trees filled out.

   Oh, and I also implemented a basic music player. No screenshot for this one (still haven’t mastered filming sound waves quite yet), but it’s there. Music now changes depending on whether you’re in combat, exploring, creating your character, and so on. I’ve got the music player implemented in such a way that I can have exploration music changed based on tile that the player is standing on. This will be used for per-zone music. Handy stuff. I mostly play with the mute on, though, since listening to the first ten seconds of the same track over and over again has somewhat begun to grate on my nerves.

Bugs that I Did Fix
   Only a few bug fixes for this update. Truthfully most of the bugs that are currently running around are so minor that I just ignore them the majority of the time. They’re things that I’ll need to take care of eventually, but I think it’s more worthwhile to be implementing new features than fixing them. Still, I did take care of a few:
   – Enemies weren’t dying when reduced to exactly 0 health.
   — Pretty simple mistake. I was checking an enemy’s health improperly (health >= 0 is alive), easy fix.

   – Fixed a reference bug for enemy Attack values.
   — This was another easy fix. I’d borked up the reference code somehow and each enemy was referring to the next enemy in line’s attack. I didn’t even notice this until I was working on a boss monster whose attacks really shouldn’t have been missing and yet inexplicably were. Sneaky little bug.

   – Fixed a camera display issue that cropped up when the player was on the edges of the playable area.
  — This bug was caused by how I have the player peer forward and down when standing on a ledge. The script itself works by referencing the cell ahead of where the player is standing. If the player was at the edge of a map there’s no cell to reference (null reference error) and it would lock up the camera. I simply added a check to make sure to only call the ledge peer when the player was in an area it would actually work.

In Closing
   While I haven’t had nearly as much time to work on Fiancée Game as I’d like to have over the past month, I’m more than happy with the amount of work I’ve gotten done in the time that I did have. Hopefully things will keep moving along this quickly! Thanks for reading!

Read More Fiancée Game – 08 – A Little of Everything

Fiancée Game – 07 – Enter the Companion

Estimated Hours of Work Since Last Update: ~11 plus a 4.5 hour dev stream

   Hey, a weekly update that’s actually on time! Not only that, but I’ve hammered out a decent amount of work this week, too, due to catching a really nasty head cold and otherwise not being up to doing much around the house.

   Last Saturday (the 2nd) I even streamed some development of Fiancée Game and had a really good time. Definitely going to do that again!

   Anyways, enough about all of that, time to dive into all the new things I’ve gotten plugged into the game this week!

The Companion
   The player’s companion has been implemented to the point where it’s combat effective. It derives all of its stats off of the player’s, so as the PC gains more power so does the companion.

   I still have to implement some display information for the companion and I feel that I need to tweak his final stat values a little bit, but overall he feels like he’s about where I want him to be.

UI
   I dislike UI work. I find it incredibly tedious, even though Unity makes it easier than doing it by hand. Still, I actually got a decent amount of it done this week with regards to adding a character sheet to the game.


So I hear you have a thing for numbers…?

   I would say that I spent between four six hours getting the character sheet implemented to its current state. Most time was actually spent getting the information I wanted in the space that I had. As you can see above, there’s still room for just a little bit more information in the ‘Secondary Stats’ section but I don’t have anything to put there yet. I also still have to implement variable display for resistances, but I’m not in a rush to do that since they aren’t taken into account by anything yet. Graphically it’s a work in progress and I haven’t even started on the Companion character sheet, but it should mostly be copy/paste work. I also need to implement the character sheet (and skill sheet) closing the inventory and minimap when the player opens them on a screen with a resolution that has a width less than 1080 because otherwise they obscure the player’s inventory and gear.

   I also spent a few hours completely rewriting how the game handles tooltips. The previous method was sloppy and slow, now all tooltips pull their functions from the global functions script instead of having to do everything in their own script. I also changed how they display a bit; now if they’re an item or a skill they show the icon of whatever you’re mousing over in addition to providing the relevant info.


An item tooltip! Still a bit of a work in progress, but I like ’em better now.

Combat
   The combat saw a bit of work this week due to the addition of the Companion. I had to add functionality to all current ‘kill the thing’ scripts so that enemies will properly damage the Companion and so on.

   During the Dev Stream I implemented a victory screen that pops up after combat and gives the player a chance to grab their post-murder rewards. Assuming they survived. Item drops are added to a small ‘loot’ list and can be taken if the player desires. I’m planning on re-writing how the loot slots function in the coming week since they don’t currently support the rewritten tooltip system.


We survived a fight and even managed to snag an item out of it!

   In addition to the spoils of battle, the player can now gain levels. Currently a level grants you some bonus health and energy based on your class, three points to allocate to ability scores, and a skill point that can’t be used for anything quite yet. I’m hoping to have a rudimentary version of the skill system implemented by next week but it’s going to require some work on other systems to tie in functionality for things like passive skills.

Bug Fixes
   As per protocol there were a handful of bugs that I set out to take care of this week. I think that from now on I’m just going to copy/paste my notes on bug fixes instead of going into long paragraphs over them. So, for this week, I fixed the following:
   – Enemies at low health (2/22 HP on a kobold chief) have a full health bar display. Probably an error in handling the display as opposed to math error.
      – Yup. Display error. Didn’t take into account enemies with 1% – 9% health, only 10%+.

   – Null item returns when rolling for loot for a creature that has a loot table but doesn’t throw out any loot. Probably not really an error, just a poorly placed Debug.Log command.
      – I didn’t take into account the player just not rolling well enough to get loot. Whoops.

   – Torch timer counting down when not in ‘exploration’ mode.
      – 30 second fix. Made sure that the timer only counts down in exploration mode.

   – Doors (and secret doors) facing N/S don’t work because reasons.
      – Code was correct, but the script was referring to the door’s button’s worldspace position instead of the door’s. This lead to… problems.

   – Fix borked particle effect on N/S doors.
      – I was incorrectly getting the parent object’s rotation. Looking at the base rotation instead of getting it as a Euler angle.

   – Player Health/Energy bars do not move on the Y axis when re-positioning them in the UI. Has to do with their vertical resizing.
      – Linked their position on the Y axis to their parent object’s Y position. Easy fix.

   – Finally fixed all the null reference exceptions to things that exist. Was due to scripts looking for stats at the time of creation. I pushed the referencing code from Update to LateUpdate so everything has a chance to set itself up for proper referencing.

   – Gold drops at the end of combat are borked. Waaaaaay too high.
      – Was rolling dice based on min/max gold for an enemy instead of generating a number between min/max. Rookie mistake!

In Closing
   This was a really solid week for me with regards to getting things implemented in Fiancée Game. I’m hoping the coming weeks are as fruitful.

   As you might have noticed from the screenshots above, the worldspace looks a bit different. I’ve scrubbed out all of the realistic looking graphics and I’m aiming for a more 8-bit/16-bit feel to how the world looks. I just think it works better this way, plus it gives me an excuse to avoid having to 3d model decor for the world, I can just use 2d sprites instead. Fun!

   In the coming weeks I want to finish up the UI work that I need to do, which will amount to finishing off the Companion’s character sheet as well as the skill sheet. I also want to get tooltips implemented for non-skills/items so that a player could, for example, mouse over their might score and it would break down where its total is coming from.

   The biggest upcoming hurdle is that I also want to get skills for both players and enemies implemented into gameplay. Once that’s done I’m going to have to do some work on getting a proper AI routine put together for the enemies in combat. My experience working with AI is dated (very dated) so it should be a learning experience, to say the least. I’d also like to do more development streams; I had a really good time with the last one, though I’ll probably keep them a bit shorter than four-and-a-half hours.

   Until next time!

Read More Fiancée Game – 07 – Enter the Companion