Apr 12, 2020 - The Language of Music

Comments

For a while there was this idea that music was the universal language. Our human languages may be mutually unintelligible but we could always enjoy each other’s music. Music is such an important part of our cultures that we even sent it out on the Voyager golden record.

But is it really as universal as we thought? Even hearing some of the songs in the golden record, they could sound beautiful yet alien to those of us accustomed to Western music, like this haunting Navajo chant:

And then consider how different everyone’s musical tastes can be, how they are shaped by teenage experience in particular. The kind of music we listen to as adolescents usually sticks with us for all time.

Read more

Mar 11, 2020 - Natural Path Generation

Comments

Random level generators are great fun to make; there’s nothing quite like coding an algorithm that creates endless variations of maps and dungeons.

A typical random map generator might place rooms randomly around the place and connect them with corridors. Then the map might be filled randomly with inhabitants - monsters, treasure, NPCs and so on. This is simple and effective, giving players unpredictable yet interesting encounters in games. It’s an evergreen approach starting from rogue (1980) all the way up to the latest indie dungeon crawlers.

Rooms and Mazes

This can seem backwards though. One problem is that the layout often seems artificial; there’s not much reason or purpose for the rooms and the connecting corridors. Real locales would be filled with inhabitants, with paths connecting important destinations together. The paths are like arteries; they are inextricably linked to the design of the whole place.

So I thought a fun experiment would be to make a random level generator that builds such a map via simulation: fill it with virtual inhabitants, who need to go from A to B, find out what paths they need via pathfinding, and create the paths based on travel patterns. Let’s see how this goes!

First, I start with a simple “village” generator - just a bunch of buildings scattered randomly around the place.

village

Read more

Oct 26, 2019 - Level Design Patterns in 2D Games

Comments

I’m a sucker for level design and design patterns, so when I came across this article (and paper) called “Level Design Patterns in 2D games”, I had to read it! Unfortunately it’s a bit wordy, so I thought I’d summarise it and throw in a bunch of pictures! Enjoy!

Hover over the images to read an explanation for each example!

Guidance

Guide the player through the path they need to take.

  1. Level shape

    | Super Mario Bros. | Super Meat Boy |
    | ------------- | ------------- |
    | ![Super Mario Bros. stairs to flagpole](https://raw.githubusercontent.com/cxong/cxong.github.io/master/_posts/smb.png "The upward shape of the staircase encourages players to hit the flagpole as high as possible, achieving a greater score") | ![Super Meat Boy hills](https://raw.githubusercontent.com/cxong/cxong.github.io/master/_posts/super_meat_boy.png "The goal is to reach the pink character on the middle platform, but it's impossible to jump here from the starting location directly. Instead the gentle staircase-like level layout hints at the solution - move to the right side of the level, then jump left onto the middle platform.") |
    {:.table-bordered}
    
Read more

Sep 2, 2019 - 3 Tips for Super Legible Pixel Fonts

Comments

Recently I restored the font used in C-Dogs SDL to the one used in the original C-Dogs. The reason why they were replaced in the first place was because the original graphics weren’t open source, so I was looking for alternatives. A few years back the author of C-Dogs agreed to open source the original graphics, and I’ve only just gotten around to restoring the font.

But that’s not what this post is about! I want you to take a look at the C-Dogs font:

It’s actually a pretty neat font. Most of the letters are just 3x5 pixels (some wider or taller), but with a few tricks they look super legible for their size. Here I’ll show you some of the tricks used to make pixel fonts really legible.

Read more

Feb 16, 2019 - Useful Gamedev Articles

Comments

Over the years I’ve found myself referring back to the same handful of gamedev articles, because their advice is useful and timeless. I’ve decided to collect them here in one place for easy reference. Hope you enjoy!

Reducing Visual Confusion In Your Game by Peter Angstadt

Side-by-side screenshot of DoTA 2 with a greyscale vs full colour version, with the greyscale image showing the important visual elements like characters and UI

A lot of game devs know how to make good-looking screenshots but the game itself is unreadable because everything looks too busy, too dark or too washed out. This article goes into the visual design theory of why, and really easy ways of improving the readability of your game.

Read more