Gwynbleidd RL

Gwynbleidd RL is a roguelike game written in Java with mechanics and themes loosely adapted from The Witcher series of games and novels. Like the genre inspiring Rogue, Gwynbleidd has the player traverse through a gauntlet of randomly generated dungeons home to a selection of treasures and foes. The goal of the game is to retrieve a prized object residing at the dungeon’s depths and return it to the surface, surviving only on one’s wits and what little the player can scavenge.

The dungeon is constructed from a series of randomized and interconnected floors. The layout of each floor is determined by randomly populating the level with wall tiles and then smoothing out the tiles so that the level has continuous regions of wall or empty floorspace. To connect the floors, each independent region of floorspace is identified and then the layers are vertically stacked to determine where there are intersections between overlapping floorspaces. A stair tile is then placed at an intersecting coordinate to allow the player to transition between the two floors. Using another smoothed level, water tiles are placed using the floorspace of the temporary level as a mask. The floors are then populated with items and entities including the player at the surface and the objective down below.

Layout of a Level

Graphically, Gwynbleidd inherits the genre’s minimalist ASCII tile aesthetic in which all objects in the world are uniquely portrayed by a text character on a grid. To render the world, I used Trystan Spangler’s AsciiPanel which simulates an ASCII terminal display by mapping a symbol, color and background to a displayed tile. Since a floor is bigger than the viewport, the window of displayed tiles follows the player as they move. The player’s visual radius is conveyed by a highlighted circle that depreciates radially from the player and can be obstructed by opaque blocks like walls. The level remains blank until explored by the player, and regions that were explored but are out of view are retained in memory as greyed out tiles.

Player vision radius

The gameplay of Gwynbleidd is built around a set of modular intercommunicating mechanics that can be learned and mastered through play. The core of these mechanics is the system that queues when entities in the world take turns to perform a particular action. These actions can be anything from the movement of a creature to the growth of a plant into a new tile. Since actions can have varied time-costs, the queue prioritizes the entities that are closest to recovering from their last action rather than the entity that started their action first. This allows for more varied entities that are slower or faster as well as the use of magic effects that can modify the speed of an entity.

Targeting signs

Two of the systems directly inspired by The Witcher are the player’s options to cast magical signs and concoct consumable potions. To aim the signs, a targeting system was implemented, using asterisks to label affected tiles. Signs like Aard and Igni affect a cone extending from the player while Axii must specifically target an entity. The alchemy system allows the player to brew Witcher potions from the flora and parts taken from slain creatures. With each new game, the recipes for specific potions change but their effects when imbibed remain the same. To help collect matching ingredients for potions, the potion crafting menu labels the ingredients that are missing, and highlights completed recipes.

Potions menu

The greatest draw of the game comes from the creatures the player encounters as they descend deeper into the dungeon. Each foe has a unique set of behaviors that will prompt the player to riposte with a counter strategy. Trolls, for instance, are slow, powerful, predictable and will pick up items in the environment to throw at players out of melee range. In contrast, vampires are faster than average, move erratically and can turn invisible to ambush the player. While the player may consume a potion to bolster themselves against the troll, the vampire would require vigilance and a speed altering ability like the sign Yrden to combat. The game is most engaging when the player encounters multiple enemy types at once, forcing them to plan around each one’s strengths and weaknesses or find their quest abruptly cut short.

To try your luck as a Witcher you can download the game or view its source files at GitHub.