Archive for the ‘Game Development’ Category

Shadowhand Dev Diary #20: buff tooltips, weapon updates and more

Friday, August 18th, 2017

We’ve have a busy few days sorting a bunch of loose ends and also answering some design questions that had piled up. Basically I’m trying to clean off a bunch of quick tasks that are cluttering up my todo list. Here are a few examples:

Buff and Debuff tooltips

The game already had tooltips for separate stun, bleed, poison and haste icons, but there were no tooltips for general buffs or debuffs, just a green or red arrow icon.

So I finally coded proper tooltips that list all the current buffs or debuffs (see image above). There are up to 6 possible debuffs and 9 possible buffs, though it’s highly unlikely you’d get them all at once. However, I did need to code a tooltip that can change size depending on how many lines it needs to display.

Firebomb Blunderbuss

This weapon is based on a real naval weapon that Helen researched. In the game we finally decided to make it 100% unblockable fire damage instead of part normal damage and part fire damage as that was overly complex. It’s a late game item and is pretty cool.

Smoke Bomb

Originally we had a cool idea about using the smoke bomb to cover up some of the enemy’s cards in smoke. However, this was going to take too long to code and because it should only last one turn so that the cards aren’t covered up on the player’s turn, it meant that it wasn’t going to be much of a hindrance.

So we repurposed the item to increase the number of cards the enemy requires to get a combo. This was pretty easy to code as we already have a potion called Clarity which reduces the number of cards required to get a combo. Also I made sure Clarity cancels out the effect of Smoke Bomb and vice versa.

Bits and bobs

I also did a few other things such as:
- Made floating text that says “Resist Alcohol” for when an alcoholic potion takes effect but your character manages to resist due to having the Sailor’s Trousers outfit item.
- Tweaked the enemy AI to use attack buff potions when their weapon is charged or nearly charged and not to waste them when they have uncharged weapons.
- Made soap always disarm the other weapon if the first one is already disarmed.
- Improved inventory management so that when you drop an item on the inventory it doesn’t pointlessly scroll if the item is auto-sorted onto an on-screen slot.

Polish List

I also moved a bunch of tasks to the “Polish” list, which I may do after release. These aren’t bugs, just things that, as a perfectionist, I’d rather see improved.

I do this because I found out years ago that the only way to maintain sanity when coming up with cool little polish ideas during development is to put them on a separate list that is not part of the main To Do list. This way they don’t distract me from actually finishing the main game.

OK that’s it for now, back soon with more!

Shadowhand Dev Diary #19: balancing potions and bombs

Tuesday, August 15th, 2017

Wow I can’t believe it’s been 2 weeks since the last post. Basically I went down a giant rabbit hole of balancing…

It all started because I wanted to give a smuggler early on in the game some Slasher’s Cider, which is a potion that increases the chance to cause bleeding. However, when I ran my automated AI test system the potion didn’t seem to be make much of difference to the outcome of the fight.

So I embarked upon a large scale test of all the bombs and potions in the game to check that none were overpowered or underpowered. This involved setting up special test scenarios for each item and logging the results.

How many tests to be accurate?

Typically I run the automated AI test system 500 times and then again and compare the results. I’ve found that running a fight just 100 times isn’t accurate enough.

In fact I was reading about the margin of error for repeated tests and for 10 tests it’s about 30%, and for 100 tests it’s about 10%. That means I could run a test and get say a result of 40% and then run it again and get a result of 60%, or anywhere between those values (if the true value is 50%). That’s not acceptable for fine tuning the effectiveness of bombs and potions, or anything really!

Running 500 tests reduces the margin of error to 4.5%, which isn’t great but is better. Plus if I run it again and average the two values, it becomes even more accurate.

What did I discover?

Early on the the design of the game I gave the various bombs and potions placeholder values and ordered them in what I thought was a reasonable order of effectiveness. However, my tests soon revealed that quite a lot of them were underpowered (nothing was super-overpowered but there are a couple of powerful items on purpose).

So I embarked upon various tweaks and retesting until I got all the items to influence the outcome of fights in an acceptable manner.

It’s possible players might have used an underpowered item but not really noticed it was underpowered just because it did something visually cool and changed a stat, but I didn’t want to take that chance.

250,000 tests!

In the end I ran about 250 test scenarios and many of those were run twice to collect more data. Each of those scenarios consisted of 500 automated AI tests. So in total that’s about 250,000 tests.

Imagine if I’d tried to do that manually? Or just said “those figures are probably good enough”. The game could be broken.

Some may call me perfectionist (and they may have a point) but I learned a lot about how the potions influence the outcome of fights and if they are best used with fast or slow weapons, one or two weapons, at the start of end of a fight etc. I could probably write a Shadowhand strategy guide now :-)

Anyway, I’m back on track with the main development now, so more blog posts coming soon!

Shadowhand Dev Diary #18: weapon modifiers and inventory stacking

Monday, July 31st, 2017

Weapon Modifiers

I’ve had a busy couple of days adding some neat features to the game.

First I added the ability to show a modifier e.g. +2 as part of the weapon card name (see screenshot above). This means that there can be more powerful versions of weapons found earlier in the game. I also added the same ability to Grog Bombs because they deal a fixed amount of fire damage and later in the game the player will need more powerful ones.

This turned out to be quite a big task because I had baked the card names onto the card graphics (I was going to change to dynamically drawing them if we ever localise the game). However, now that I needed to display +X next to the name I basically had to re-export all the weapon and gear cards in both small and large format which was 136 exports!

I also needed to create a special new small font to draw the card name. It’s no good scaling down a larger font as it just looks bad, it’s always better to export a font at the exact size it’s planned to be used in-game for clarity.

Inventory Stacking

I coded gear stacking so that the player’s various bombs and potions can be stacked in the inventory instead of taking up zillions of inventory slots. The quantity the player has “in stock” is shown on the bottom right of the card on both the small and large versions.

Coding the stacking was a bit complex as it had to handle taking one off the top of the stack and allowing it to be equipped in one of the player’s 3 gear slots and vice versa.

Furthermore I decided to auto-sort the inventory as well so that the weapons/outfit/gear/ability tabs are always sorted in a sensible order. However, new items will still appear in the top left of the inventory tab (and be marked with a new icon) so that players can check them out. This is basically what Dark Souls and the latest Zelda does, so it should be OK :-)