Weekly Coding Update #17

Now you can pause the game! This involved changing the way everything looks so it’s a bit grayed out, and hiding the words (no fair browsing through the thought bubbles while paused.) As you can see I’m using a placeholder graphic for the pause menu:

Gameplay Screenshot #04

I also beefed up the keyboard event handling, so I can be notified of any key press (before you had to list the keys you wanted to hear about.) It checks for specific key handlers first, so, as you can see in the screenshot, I can register to be notified of “any other key”.

On a much less interesting note, I ripped out the rest of the old code for the “conversation progress bar” that we used in early development. Now all time limits come from script, and are managed by the conversation engine and/or the brain. Yes, there’s a class called Brain :)

Aaand… one more bugfix. A little syntax error in the timers made it so it’d crash if you tried cancel one. I think that’s the last of the occasional crashes at/near the end of the game.

Weekly Coding Update #15-16

#15: Had a big big work deadline last week, so no no progress that week.


This week I reworked the way links work. I added a fourth bubble, which looks a little cooler, but mainly fixes the issues I was having where there would sometimes be an awkward gap at one end or the other. I tweaked the canonical location of each bubble, and the timing at which they appear, the way the move, and made them grow/shrink semi-randomly over time.

I also finished (for now) the “infection” effect, which turns everything red. This work was mainly making it so the link could turn red from either end, and making sure the red starts at the correct end.

Weekly Coding Update #14

Slow week this week due to low energy, and a leaky foundation (yay almost spring!)

I did manage to finally track down a bug that’s been making the game crash occasionally (usually right at game-over.) Turns out there was a bug in the javascript interpreter, not my code. Guess it serves me right for running git master (of the interpreter) from a year ago and never updating.

I also made it so that code can be notified of a “click anywhere”, and used that to make it so you can skip the parallax scene with the mouse, if you’ve already seen it a bazillion times.

I also started creating another of the mind effects: “Infection”. In this effect, thoughts turn a dangerous red, then the red spreads to nearby/connected thoughts. I’m at a rather goofy problem: when fading (from white) to red, right in the middle is pink… not what we’re going for. I’ll have to figure out a more complex way of fading the color so it goes to grey first, or maybe a dirty yellow.

Art Update


I’ve been honing in on the final look for goblins.  There’s are different levels of detail to consider – you’ll see a portrait during conversations, a tiny sprite on the overworld map, and a more detailed view during cutscenes. The picture above is what I’d like to do for cutscenes – though without quite so much shading.

You’ll see a tiny goblin running across the countryside between conversations.  That will look something like this:


I’m actually really happy with this simplified version! It became my business card during PAX:


I just want to share one more piece of art. I was hired to make the cover for the magazine Worlds Without Master. It’s an anarchistic swamp-town, and even though goblins are banned from that magazine’s hallowed pages, I secretly imagine this being very close to how certain goblin settlements look:


Weekly Coding Update #13

This week I rewrote most of the Paralax (scrolling scenery) code again. This time, I think I finally got it right, and I added some nice new features, like being able to scale the layers independently, and also have the sky move at a constant rate, while the other layers can pause, move, etc. I scripted a nice sequence of fade in, move, fade out. This sequence plays between the main menu and gameplay.

Speaking of the main menu, I finally got a proper image on the main menu, so you can see the name of the game and everything :)

Then I did a bunch of research on what video decoding library I should use to play cutscenes. I only need support for one codec, and I’m not all that picky about which one, since we’ll be pre-processing all the videos anyway. My priorities with the codec are that it works well, and that it will be easy to add to my cross-compiling for windows. I’m using MXE for cross-compiling for windows, so I went through the list of MXE packages, and found three candidates: ffmpeg, xvid and theora. ffmpeg seems a little overkill, and there’s been problems in the past with ffmpeg changing their API frequently (we had to do a lot of extra work on cmus to deal with compatibility with different ffmpeg versions.) It was a bit of a toss-up between theora and xvid. I’m trying theora first, because they have API documentation on their website.

Weekly Coding Update #12

This week I replaced the old code that arranged the links, and set their angles. It served well for a time, but it wasn’t able to deal very well with links being removed, or new links being added later. The new code arranges links randomly at first, and then has nearby nodes repel each other so that they make space where needed.

After some amusing/wild bugs, I got this code working nicely. When I went to test it I was surprised how hard it was to focus on the nodes adjusting their positions. It’s so good that fades into the foreground. I feel like I hit that weird rule of design, that goes something like “When it’s designed really well, you don’t think about the design”.

Weekly Coding Update #11

Lots of little things this week.

I installed new speech bubbles from Evan, then made them shrink/grow to fit the text within them. Together, these make the speech bubbles look much better, and make it much clearer who is talking.

I improved the Mind Rush effect, so it adds new links/bubbles over the course of 4 seconds, instead of all at once.

I fixed the Mind Blank effect, so you can’t click on the nodes that are disappearing.

I implemented a simpler way for being notified when an amount of time has been passed, and updated a few places in the code to use this new method, instead of the old one that was designed for animating a trait over time.

Then I got to work trying to fix the weird twitchy/glitching rotations that happen when nodes fade out (mainly the node that connects you to the rest of the web.) While working on this (with mixed success) I realized that I need to change the way I position the link angles. Right now the main determinant is how many links there are, and they’re positioned mostly dynamically. This made a lot of sense when all links were created at once, and never deleted (at least not in the foreground). But now that links are coming and going a lot more, they can’t be spinning around to accommodate the comings/goings of the other links… or at least not spinning around so fast. I’m going to rip out the old angle generator, and instead have links remember what angle they are at, and have them repel nearby links/nodes. I can make it a bit of a physics simulator. This way I can fiddle with the numbers, and achieve some important gameplay constraints, like no overlapping nodes, and making sure that nodes don’t go too fast to be clicked on.

Weekly Coding Update #10

This week, I made it so you could script multiple interruptions to occur while you’re trying to find a word. Also, I implemented a second interruption: “mind blank”, which makes all the thought bubbles except the one you’re on poof away into nothingness… then new ones come in. It needs some polish, but is basically working.

Weekly Coding Update #09

Very techy progress this week!

First I ripped out the SDL2_mixer library, because it seemed to be incompatible with cross-compiling for 32-bit windows. Also, we want to do more sophisticated things with our music than SDL2_mixer’s music API supports, so it wasn’t overwhelmingly useful. So I made it so our music and sound effects work with the much lower-level API of SDL2. Now I am copying audio samples myself. Evan and I talked about this, to see if there’s some cool effects that we can do easily now that we’re involved at the audio-sample level. Not sure anything exciting will come out of that, but we’ll certainly be able to fade in and out the various tracks of the music as we planned.

Next, I made it so all our data files (1 javascript file, 3 sound effects, 3 spritesheets (images), and 1 music file) are built into the main executable. Now the game is just one file that you can run, instead of an executable and 8 data files that must be arranged just right in the same directory. I’ve always found installers annoying, and preferred things that you can just run. Now you don’t even need to unzip or anything. And the game is easy to move, rename etc..

Then after those two, I got cross-compiling working again, so I can spit out windows builds… with sound! This took a bit of work too, because windows doesn’t reference embedded binaries (our data files) it quite exactly the same way as my machine.

Status effects

If things go badly enough, your goblin will die. It will be up to the next generation of diplomats to finish your mission.

But I don’t want every failed conversation to kill your goblin.  At first, there was a planned “health” bar that could be damaged, but I’ve since decided to go with a set of negative status effects instead of a sliding-scale stat.

There are currently four planned status effects: HurtHungryHomesick, and Hunted.  Each one has its own consequences, and a goblin can suffer from multiple status effects at once.

  • Hurt goblin will have thought bubbles of moans and groans drift across their mind.  These will obscure the word web and make it trickier to hit the thought you’re aiming at.  If you click on a moan (“oooaawwwww”), you will actually moan out-loud, to the consternation of the human you’re talking to.  However, this will clear away the moans from your web temporarily.
  • Hungry goblin will often think of food rather than the subject at hand.  Thoughts like “bread” and “bacon” will come from unrelated thoughts like “tree” or “night.”
  • Homesick goblin will have the names of the goblins back home appear in their word web.  If you know your friends and family well, this isn’t necessarily a downside. For example, if your father Nikku likes books and winter, you’ll have a shortcut between those two concepts.
  • Hunted goblin has drawn the attention of the human guards. Now there is an additional time limit on your conversations: How long until the guards catch up to you.  If the guards reach you, getting hurt or killed is very likely.

As much as possible, I want the challenges and boosts in Goblin Diplomat to be significant and describable. I’m trying to avoid extremely fine-grained mechanics (e.g. having 100 hunger-points, eating a bread crust adds +2.5).  More on chunky vs fine-grained design next week!