One Room Roguelike

This portfolio piece contains some of the more technical features of a game prototype. Mechanically the game is roguelike platformer, focused around building a complex kit of synergies. The play area is limited to a single small room which is deconstructed and reconstructed procedurally once each room is cleared. The intention is to condense the experience of the roguelike down into bursts of action, and limited downtime. In games like The Binding of Isaac and Gungeon players are encouraged to backtrack in order to maximize their chances of winning. While this backtracking adds a level of skill and strategy, it also drastically slows down the pace of gameplay. By restricting the play area to one room, my prototype maintains a fairly quick pace.

Something I haven’t been able to show below is the item system. The item system is divided into two sections and is coded using a data-driven design. Gear, and modifiers. The characters may have a varied number of slots in which gear can be equipped. These slots can be triggered to activate their effects, which are modified by attached modifiers. For example, one slot may be the primary fire slot. In the primary slot is a grenade launcher. We could attach fire rate, ice damage, and homing modifiers to the grenade launcher. In code, these modifiers are simply data which the grenade launcher can access to modify its behavior. Another example could be a piece of body armor that contains a slot that triggers upon taking damage. We could put a piece of gear in there that explodes when triggered, and leverage the invincibility granted by taking damage to mitigate the explosion damage. This creates a deep and satisfying item system that is easy to pick up, but difficult to master.

Another pitfall of roguelikes is losing your items. Even when you win, you have to start again. Especially with such a deep item system, losing a great kit could be devastating. To mitigate this, winning with a great set of items lets you save one of these items. This item can then be used in an ultra-difficult “final showdown” mode where the player gets to use all of their overpowered broken weapons to take down overpowered broken bosses.

On the technical side, the key points of interest are the enemy navmesh generation and pathfinding systems, the character controller, and the squash and stretch shader used to make the player movement feel juicy. All artwork and animations you see on this page are also made by me.

Navmesh Generation

After spending days searching the internet for ways to build a decent AI, I gave up and made my own. The AI needed to be able to navigate a procedurally generated 2D tile based world. It needed to take into account the agent’s jump height, gravity and movement speed, and find an intelligent enough path to its target.

A* is always the obvious choice for anything grid based, but the issue was how to actually build the node graph to allow for platformer jumps. Since the internet failed me, I created the Alex Galbraith patented platformer node generator 3000  (trademark pending). I won’t give out the secret   to how it works as I’m saving it for a tutorial post, but it generates all nodes that don’t require (literally) jumping through hoops. The algorithm also stores information on the node transitions including the vertical clearance, manhattan length, jump height, and square roots for optimization.

AI Navigation

All that information in  the generation phase becomes incredibly usefull when we want to actually pathfind. For the most part, the pathfinding is simple A*. The twist comes about when it comes to traversing the jump/fall nodes. To check if the the AI can successfully traverse a jump, the patherfinder takes into account gravity, movement speed, jump height, and the clearance above the jump.

Likewise when the AI actually performs a jump, it calculates the necessary jump force and run speed.

Platformer Controller

A custom made 2D platformer controller designed for fluid movement and responsive controls. This controller supports these mechanics:

1.

Slope sliding and stair stepping

2.

Wall and air jumping

3.

One way/drop through platforms

4.

Short hopping and variable jump height

Visual Effects

The most interesting effect implemented in this project is the shader based squash and stretch. As you may be aware, squash and stretch are fundamental to making an animation feel good.

Since I wasn’t keen on animating a bunch of nice blend frames, I took the easy way out and wrote a shader to do the work for me. The video to the right shows a comparison with squash and stretch off and on. An explanation as to how I achieved this effect can be found in my write up here.

I wrote this shader for pixelating particle effects, which also provides a handy shader that creates crisp pixel art that is stable under rotation and scaling.

Aside from these effects, the particle effects, animations, and art seen above are all created by me.