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

Dec 2, 2016 - 2D Overhead Traversal

Comments

Why are open world games so fun? A lot of reasons: a huge, interesting world, lots of things to see and do. But one important mechanic that support this, and which pops up a lot when people talk about open world games, is traversal. What’s that?

In a nutshell, it’s the way the player moves around the world, getting from A to B. This sounds (and often is) mundane, which would be a problem for open world games with huge worlds, which is why these games often have interesting, advanced techniques to get around. You see this a lot on 3D open world games.

When it comes to great traversal mechanics, two games often get mentioned: Spiderman 2 and Just Cause 2. In the former, you use your web to swing around the city, and in the latter, a unique combination of paraglide and grappling hook lets you fly around quickly. Both take some skill to pick up, but the result is a fast and cool way to get around their game worlds.

spiderman 2just cause 2

Other games also get mentioned, but I’ve noticed that they are all 3D games, and the traversal mechanics described are 3D mechanics. I’ve been thinking about how traversal might work in a top-down 2D game; a lot of the things that work in 3D simply aren’t there. Like:

  • Great views: open world games are fun because they have great scenery to enjoy. Many open world gamers have anecdotes of climbing up that big mountain to get a spectacular view, or seeing majestic buildings and landscapes in the distance. In a top-down 2D game this simply isn’t possible.

    oblivionarkham knight

Read more

Apr 7, 2016 - A Review of Overhead 8-Directional Shooters

Comments

To make better games, one can look for similar games (not only in the same genre), and see what worked and what didn’t. One game I’m making is C-Dogs SDL, an overhead 8-directional shoot-em-up. A while ago I started looking for similar games, looking for cool features I can steal, but also for where they weren’t fun, and why. Bertram25 (of Valyria Tear and OpenDungeons) encouraged me to elaborate on some of my conclusions in a blog post, so here it is :smile:!

What are Overhead 8-Directional Shoot-em-ups?

8-way

This mouthful of a sub-genre doesn’t get mentioned a lot. In a nutshell, it’s where you can move and shoot in 8 directions, from an overhead perspective. Sounds awfully specific, so people simply describe these games as top-down shooters or 2D shooters, which lumps them together with other sub-genres like twin-stick shooters (Geometry Wars), scrolling shooters (Gradius, most of the Touhou games), run-and-guns (Contra), even games like Asteroids (which have tank-controls, and includes the Strike series or even the on-foot sections of 2D GTA). Fans of those sub-genres will understand how different they are; each has different design lessons to learn.

Read more