Hugo the Wizard - Game Postmortem

My JS13k entry for 2023. Play Now



I had 1 month to make the game, but of course I only started coding the gameplay what there's only 1 week left.

Genre: Roguelike Deckbuilder

The year is 2023. Every indie game is now a deckbuilder. Well, each genre has someone adding cards to it.

I've made a list of just the indie deckbuilders I've seen randomly recently while scrolling social media:
Why is everyone suddenly making a deckbuilder?

Possibly because of this article where Rogelike Deckbuilder is the highest earning and least filled genre on steam. https://howtomarketagame.com/2022/04/18/what-genres-are-popular-on-steam-in-2022/

Also, Slay the Spire, then Marvel Snap became popular. And these are easy to make.

These games are really addicting because it's kind of like a slot machine. Each turn, you're always hoping to draw the perfect hand. After a victory you get to pick a card (from usually 3 choices) to add to your deck. You're always hoping for the perfect option for your deck. After you lose and have to start from scratch you always think "this time it'll be different."

This is an innovation in game design. It's funny because these games are simple and could've easily come out 20 years ago and it would have blown everyone's minds. But innovation happens gradually. Every innovative game is just a copy of another game but with a key change added. And it seems so obvious after the fact. But there's a million things that could have been changed that seem good in your mind but actually make a game less fun. Innovation is just that one perfect little change to something that already exists. And it takes years and years for ideas to mature. Because it requires several innovative products, each copying from the last and getting just one more thing right.

The key to a deckbuilder is randomity, but with clever choices from time to time that improve your odds going forward. Why cards though? When I design games I try to make everything real. I don't want to just insert arbitrary rules. I don't want my game to sometimes pause and show the user 3 choices for upgrades. Where are these choices coming from? Why can't I take them all? Because this is actually a board game and none of this is real? In my mind cards are just a bunch of arbitrary rules that aren't clearly intuitive from the real world nor the game world. I think it's possible that these games don't actually need to have cards in order to get this deckbuilding mechanic.

Enter goblins.

Setting: 13th Century Scotland

When the JS13k theme was announced. I was happy. I've already been researching medieval Scotland for the past 3 years for my upcoming game. But I knew more about the 14th to 17th centuries. I knew I'd heard about a wizard with a goblin army at some point. After a while I looked him up and I was suprised that he actually was from the 13th century!

The video I stumbled upon 3 years ago that made me decide to immediately make a game about Scottish castles:

Recognize the roof in the youtube thumbnail? It's in my game!

I went through the massive list of castles Scotland in that region to see which ones existed in the 13th century.

I came up with a path of castles to defeat King Alexander III:
  1. Yester
  2. Dirleton
  3. Byres
  4. Edinburgh
  5. Abercorn
  6. Aberdour
  7. Macduff's
  8. St Andrews
  9. Leuchars
  10. Kinclaven


I removed the castle in Belhaven because it's too out of the way. You have to get to Perth, because that's where the king's castle was at the time.

Music Player: songs made from code

I spent the first 3 weeks of the game jam just on music and research. I had to get my music player just right so it's easy to plug in and edit songs while being very compact. Then I have to get it to not sound fuzzy, then get it to work on Safari. I've played a lot with JS Oscillators but it just sounds to harsh and unnatural. Try my oscillator music player It's less code and loads the song very fast and uses very little memory compared to one that makes audioBuffers.

AudioBuffers require you to make audio by setting an array of numbers between -1 and 1 to... make sound waves.
var len = ctx.sampleRate * seconds | 0,
buffer = ctx.createBuffer(1, len, ctx.sampleRate)
bufferArray = buffer.getChannelData(0)

// Fill the array to make a sound wave???
for(var i=0; i<len; i++) {
	bufferArray[i] = Math.sin ???
}
But then I found xem's piano player and I wanted that sound. Here's the important code I needed to make those piano sound waves:
// Modulation. Voodoo to make waves sound good.
b = (note, add) => Math.sin(note*6.28 + add)
// Instrument synthesis.
pianoify = (note) => b(note,
	b(note,0)**2
	+ b(note,.25)*.75
	+ b(note,.5)*.1
)
Where note is the index you're setting in bufferArray / sampleRate * frequency. (middle C frequency is 65.406).

It still sounds kind of fuzzy on phones (iPhone and android) for some reason. I couldn't solve that and gave up.

Songs: 13th century songs

Then I had to find songs that were written in the 13th century. It's hard to find any. I think there's only 1 from Scotland that survived, which is really sad. Most European songs from that time actually came from Portugal so I used those.

Then I added the famous later Scottish song: The Bonnie Banks of Loch Lomond


Sound Effects: Make sound waves not sound computery.

There was an attempt. I analyzed the waves of lots of sound effects. I managed to make them slightly more organic than typical metallic/futuristic generated sound effects. One key change was rather than doing
for(var i=0; i<myAudioBuffer.length; i++)
myAudioBuffer[i] = Math.sin(i*stuff)
//Instead I did:
myAudioBuffer[i] = Math.sin(i2*stuff)
i2+=add
Then I can sometimes change how much I'm adding to i2, (add is usually 1 but sometimes not) to make short pauses in the wave for a gutteral sound. Such as add = Math.Random()*.1-(i%1300<900?1:0)

Coding: Start with 9 days left.

First do the art and music, then victory screen, then intro screen, then credits screen. Then code the gameplay. What?

I generally try to make less UI or even no UI and more visual cues to show what's going on. Goblins with more health have larger stomachs. Goblins that deal more damage have larger swords.


I started to run out of time for art so I start switching to emojis 😂, so the crown and devil are "for now" emojis. I also realized after using RoadRoller to compress the game, it's only 7KB. I stopped caring about how I code.

Coding the gameplay: 5 days left 😧

When I was younger I always coded gameplay first. Menus/polish/story were just chores and I would rarely do it. Now that I'm older I care about what story I have to tell. Why this all matters in the end. How can my game be bigger than my game? How can my game be interesting when 100 games are released each day?

Nowadays I start with: How should I explain this world to a new player who isn't sure they even want to figure this game out, and has thier finger ready to click the browser Back button? And I never want a tutorial that feels like there's a tutorial at all. I feel like noawadays there's so new much stuff to try that it's a brain drain to try anything. Because I'm old now or because there's really way more stuff? And so many people are making up new stories all the time and trying to get people interested, but we haven't even fully fleshed out most of our history. Most people don't know who defeated Hannibal, or where the largest ever tank battle was fought, or the 13 Treasures of Britain.

I did a lot of research on goblins and added the Redcap. He's a goblin normally found in ruined castles. His hat is red from the blood of the people he has killed. So I made his hat get more red with each castle he defeats. If he does the final blow then his strength improves permanently.

But most of the goblins types are made up to make the gameplay work in the time I had.

Final day: Try to make this a balanced game.

The jam ends at 4AM for me. I submitted at 2AM then went to bed. And I had only slept 4 hours the night before. I added a few more types of goblins, then did a couple playthroughs to make sure the game is actually beatable. Basically there's 2 strategies:
  1. Go for fire and use Torchers to double the fire. Get some Blobbys to defend. Don't care about your strength.
  2. Get a redcap and make sure to upgrade him on every castle, then clone him when he attacks for like 11 damage. Use Trainers to keep your strength positive.
I submitted my game without first having anyone else test it or showing it to anyone. I'm pretty much hoping people have played Slay the Spire and thus will understand the game.

In all I had fun making this game and laughing at my little goblins by myself. This game would have been fun to make with a friend but I wouldn't have had time to meet up with anyone. Next time I'll allocate more time and probably want to team up with someone, make a friend instead of a music player.
© 2023 Curtastic Corp