Daniel Masterson

Programmer | Developer | Hypernerd

Three Thing Game - I finally won one!

Posted 15/05/2017 17:15:48 under Personal

So last Saturday (The 13th), I took part in Hull University's Three Thing Game competition, possible for the last time. This competition has each team be given three random 'things' from a pool, and our team was given the things 'Ambient Occlusion', 'ASCII' and 'Psionic'. Huh. Not the most inspiring words, but we worked with it and in the end we won! Well how about that?

The game we made was a sort of isometric twin-stick shooter thing in Unity with entirely procedural levels. First off, we had a visual idea with ambient occlusion that we've wanted to use for a while, so that was easier to pin down. Basically, only use ambient occlusion maps! Everything ends up grayscale, if not entirely white, with the only detail being provided by the shading caused by ambient occlusion. This shades in things like corners and inner edges between objects, as well as stuff like indentations to simulate the reduction of light in such areas. Here are two examples of the game with only ambient occlusion effects and nothing else.

One of the game's arenas with a faux Greek styleThe game's "generator" room, basically a sort of checkpoint

As you can see, even though we're not using actual lighting, colour or anything else that you would normally use to describe 'depth', you can still pretty easily navigate the scene while still having a striking game aesthetic. Even the player and enemies have this effect which works surprisingly well.

Alright, one of the 'things' is solved, and in a very nifty way too. How about we tackle ASCII next?

Now, I've made 3D games in ASCII before, and I might do a write-up of one of those later on, but ASCII won't really work with the current aesthetic. Looking at this, you can consider the aesthetic to represent a virtual or digital space, and what represents digital more than ASCII! We needed particle systems, but they don't work too well using AO, so how about having the particle systems be random ASCII characters? In addition, why not make the characters support colour, to make them seem very unnatural in this world. So that's what I did! First, I generated a texture atlas of a variety of Latin, Cyrili and common ASCII symbol glyphs. With this, I wrote two shaders, one for particles and one that I will use for normal meshes. The particle shader took the vertex id divided by four (Giving each particle quad its own ID), which is then used to randomly offset the UVs to select a random glyph. Add transparency and support for colour and we have a perfect particle texture! The mesh version, which will be used in the effect for meshes dissolving in and out, basically pastes the atlas in view space multiple times, offset by a random value each time. By offsetting both of these randomly using the scene's elapsed time, we can even have the glyphs randomly flicker over time. Perfect!

The player character with blue particle system hair shooting 5 'psionic' ASCII projectilesA part of the world fading in with the ASCII effect clearly visibleThe same part of the world, slightly in the future with the final surface starting to dissolve in.

Fantastic! It looks otherworldly and fills in our second thing! The final thing was actually super easy, we give the player psionic powers! The character's psionic potential is clearly visible thanks to his super stylish blue ASCII hair, and he can charge up and shoot psychic 'bolts' with the power of his mind. The player does this by holding down the left mouse button (or one of the triggers or bumpers on the controller, if we had managed to get controller support implemented). The longer it's held, the faster and more damage the bolt does. We also had plans for an ASCII/Psionic blade of sorts for melee attacks, but in the end that wasn't implemented, primary due to issues animating the player character. I won't get into those issues too much, but the psionic attack uses some awful hybrid of the jump and crouch animations just on the upper body and it sort of works. Also the character's upper torso is completely independent from his legs. It looks as goofy and painful as it sounds.

Now we just need a goal. We decided pretty early on that the 'plot' is that you're trapped in this virtual hellscape and must escape. You do this by acting three 'psionic generators' which are used to charge a portal. Annoyingly, a virus/worm/thing is obstructing the portal, so you better go kill it. Get to the end and kill the worm = Game complete. Easy.

And, surprisingly for a game jam, most of this was easy, The game ended out balanced and there was a full game loop, including completion and player death. I'm honestly very proud of the game, even a little bit surprised that we won. If you want, you can watch one of my teammates narrate a demonstration video and a play through of the entire game (Cheating a bit so he doesn't die). This is something I want to work on in the future too, so this might not be the last time you see AO.