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

Jan 27, 2019 - How to Design a Gun

Comments

I love guns in video games; there’s a lot that look and sound really cool. Many games feature gun designs that are so iconic they become part of the identity of the game: there’s the versatile gravity gun in Half Life 2, the beefy assault rifle in Halo, clever portal gun in Portal, and beastly lancer in Gears of War.

assault rifle lancer

Some guns are not only iconic in games, but in movies, even in real life. James Bond’s favourite pistol, the Walther PPK. Or the AK-47, perhaps the world’s most famous assault rifle, well-known in Counter-Strike and many other games, as well as real life - even the flag of Mozambique. Needless to say, their appeal is universal.

ppk ak47

Let’s say you want to design some cool guns for your game. How would you do it? A lot of first-time designers might take bits they like and mash them together. There’s a lot of art kits and even some programs that allow you to do this. Unfortunately, the result often doesn’t make sense, and looks inconsistent.

gun kit

Read more

Oct 2, 2018 - SDL_RenderCopyEx

Comments

SDL_RenderCopyEx is a function in SDL2 that allows you to rotate, scale and flip sprites. But how do you use it? I was wondering the same as I wanted to add bullet trails to C-Dogs SDL. The official documentation tells you what parameters to use but not how they will look. So I just tried it out myself:

sdl2-rendercopyex-demo

This is a simple demo project which uses SDL_RenderCopyEx to rotate, scale and flip a sprite. There’s also a center parameter which controls the center of rotation, which defaults to the center of the sprite you are rendering.

sdl2-rendercopyex-demo

Read more

Aug 16, 2017 - Three Factions

Comments

Some of the most fun and interesting games feature three factions. The number 3 is a magic number, allowing for interesting asymmetries. You often see factions that are unique, provide lots of gameplay variety, and are flavourful too. But how do you mechanically balance three radically different factions? And how do you come up with three thematically unique factions?

It’s not easy. With just two factions, balance is a lot easier, as you simply buff one and nerf the other, but with three (or more) factions, anything you do could inadvertently affect the balance with the third faction.

Duality

One common method is to take a classic duality, and have two factions represent each extreme, with the third, “balanced” faction in the middle. TVTrope’s article on the subject mentions the classic duality of powerhouse/subversive. So one faction is a powerhouse, favouring raw strength, the second is subversive, favouring clever tactics and engagements, and the third balanced between the two.

Yin Yang

How does this work? The important thing is that there is no inherent advantage to either side of this duality. The powerhouse is powerful but slow and predictable; the subversive is weak but fast and flexible.

A great example of this is in Westwood’s Dune RTS games and the unique tanks of each faction. The “evil”, powerhouse Harkonnen have the Devastator, the most powerful in the game but slow and ponderous. The “insidious”, subversive Ordos have the deviator, a tank which has no attack but can temporarily take over enemy tanks. The “noble”, balanced Atreides have the sonic tank, which apart from having a unique attack, is otherwise equivalent to a heavy tank.

Devastator > Deviator > Sonic Tank

Read more

Mar 6, 2017 - 3D Rendered Pixel Sprites

Comments

In the recent C-Dogs SDL release, I introduced a new walk cycle animation using pre-rendered 3D sprites; check it out (before, after):

C-Dogs SDL walk cycles

The content pipeline goes like this: Blender, bash/python render scripts, Imagemagick touch-up, montage spritesheet. The results are surprisingly good, given that no manual retouching was required; I can directly edit the blender file, and create updated spritesheets.

Background

Initially I was leery of this whole project. Pixel art is usually done by hand and laborious enough already; creating animations just makes the amount of work explode. The original sprites only had 4 directions (left/right can’t be mirrored due to the gun-handedness), 2 poses (unarmed and holding gun), with idle (1 frame) and walk (4 frames) animations, for a total of 4 × 2 × (4 + 1) = 40 frames. The project was to show all 8 directions with an improved walk cycle of at least 8 frames, which would make the total number of frames balloon to 8 × 2 × (8 + 1) = 144 frames. That’s a lot of work to do manually!

Not only that, but there are future plans for more improvements, like “textures”, different body types, different animations, each of which multiplies the amount of sprites.

Obviously the alternative is to model and animate the whole thing in 3D. But there are big questions around this approach. Will the animations look as good? Can rendered sprites avoid that “rendered” look?

Molez

This is what pre-rendered sprites looked like in the 90’s

Read more