Archive for August, 2017

Shadowhand Dev Diary #21: Puns, editing and testing.

Thursday, August 24th, 2017

Since the last post I’ve made a bunch of small changes and have worked with Helen to add new text to the game and edit existing text.

Puns

I’m a dad so naturally I like dad jokes and puns, and I like to get a few puns into my games. Also Helen is great at wordplay due to being a writer and editor for 20 years, and she came up with some classics for Shadowhand.

Above you can see the Gravedigger in the game, now named “Doug Hole”. We also have a drunkard called “Earnest Swigger”, which makes me chuckle in an easily-amused manner.

Haste Icon

We needed a decent icon for when the player is hasted and I had a list of standard ideas such as 2x, fast forward chevrons, clocks/hourglasses, lightning bolts etc. but then Helen suggested we use a Triskelion/Triskele, which is kind of cool, and so we used that instead.

Brutes Brew

Several potions in Shadowhand are alcoholic and although they give you an initial boost they also have a detrimental effect after a few turns by slowing down your weapon charging.

The image above is of Brutes’ Brew which boosts your chance to stun (with an appropriate weapon) to 100% for 3 turns. It was 50% for 5 turns but after some testing we changed it to 100% because it gives the player a guarantee of getting a stun, providing they can hit the enemy.

Combat Stars

For puzzle levels players earn stars based on how many cards are left on the tableau at the end of the hand – the same as in Regency Solitaire.

However, for duel levels player earn stars based on how quickly they defeat an enemy. Hovering over the enemy will show a pop up with the star goals. The image above is a tutorial explaining this early on in the game.

Optimising Automated AI testing

Having recently done a ton of duel testing in order to balance the bombs and potions in the game I was getting annoyed at how long 500 automated tests took to run – sometimes they took 5 minutes depending on the complexity

So I spent a bit of time optimising the test runs and managed to speed them up by at least four times! This means that the AI can now do about 20 fights per second which will greatly speed up my future weapon/outfit tests for balancing.

The main optimisiation was simply not drawing anything during the tests. This meant the game could skip Vsyncs which were holding up the simlulation by up to 17 milliseconds every time the player or enemy performed an attack.

Other optimisations included further reducing the length of some animations to the bare minimum time where they still correctly trigger vital code when they finish. Also I preloaded in some dynamic images for items that keep getting destroyed and recreated. The preloading won’t happen in the release version as I need to be careful with VRAM use.

Other thangs

We did a bunch of other bits ‘n’ bobs too:
- Edited character stat panel text to make it clearer what it means (hopefully).
- Edited some card text for clarity.
- Tweaked AI so it uses attack potions more intelligently then retested all relevant potions.
- Tested using Undo after a card drop offs the tableau due to the player’s “Lucky” stat, and made sure that lucky cards don’t mess up the tutorial.
- Made new post-duel dialogs for several enemies (image + text)
- Renamed some story characters for political reasons! The world has changed since we originally named them.
- Added support for enemies to have the same graphics but different names and stats.
- Charged Tartan Kerchief to give percent-based boost to health potions instead of a fixed number.

And that’s it for now. Back soon!

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!