Lethargent

 

Programming

Camera

I chose to use a third-person camera for Lethargent, partly to emphasize the player character's personality to distance him from the player, and partly because many games we took inspiration from - particularly Silent Hill and Majora's Mask - also used similar cameras.

Obstruction

The camera moves closer to the player to avoid clipping through objects in its way. If the camera gets too close to the player, the player character model gets a dithering effect as seen above, allowing the player to see through the character.

Holding the right mouse button zooms the camera in over the player's shoulder and frees the cursor, allowing them to interact with dialogue and focus on items of interest (and shoot a gun, which was a desired feature). Pressing tab switches shoulders, or if the camera becomes obstructed it will switch automatically.

Art

Texturing

I created the textures for most of the buildings and the terrain, as well as a handful of large, simple props (namely the posters, rocks, and cubicles).

Modular Design

Many props and building details are separate objects, allowing existing buildings to be adjusted on the fly and new buildings to be assembled out of existing artwork. 

PSX Shader

The Playstation 1 was infamous for its "vertex snapping" visual artifact. I find this effect rather charming, so I recreated it in Lethargent using a shader I found on github and modified to work on the terrain (see below)

Terrain Shader

The terrain posed an interesting technical problem. In large games, it would be extremely unoptimized to texture an entire terrain using a single texture, so Unity terrains use a compression technique known as splatmapping. Because this technique uses its own custom shader, and because the above PSX shader was created in Unity's shader graph, I needed to recreate the terrain shader in shader graph.

The first step is to read the texture that stores the terrain texture data. The texture has four color channels: Red, Green, Blue, and Alpha, or opacity. Note that the terrain must be opaque and does not support transparency, so Alpha is shown as Black. This allows each splatmap texture to represent up to four textures on the terrain. 

The terrain also stores a list of four textures, one corresponding to each color. To combine them, each texture is tiled across the entire terrain. Then at any given point, the texture's transparency (or alpha) is determined by the strength of its corresponding color at that point. In this screenshot, the Red channel has been applied to the first texture, so areas with little or no Red in them are entirely transparent. Note again that alpha is shown as Black.

Finally, all four textures are added together, combining them into a single, seamless terrain texture. Because this is the color for a "fragment" shader, it allows the PSX shader to be applied as a "vertex shader" in parallel, giving a terrain with the desired vertex-snapping effect.

With my approach, each terrain is only able to render four unique textures, as the shader only supports one splatmap. Rather than overengineering the problem and supporting multiple splatmaps, I chose to split the overworld into a 3x3 grid of smaller terrains. This prevents me from using more than 4 textures together in one place, but with clever placement I can use up to 36 textures in total, with each terrain appearing unique to add variety to the worldbuilding.

Gallery

Design

1st Iteration A

1st Iteration B

Though this iteration was functional, it failed to clearly convey the optional nature of the dialogue, and it fell apart with more than one NPC

2nd Iteration A

2nd Iteration B

This iteration more clearly represented the dialogue's mechanics, but it became very difficult to read, especially at either a distance or from behind

UI/UX

In Lethargent, there are two separate cases where dialogue is present: cutscenes and NPCs. The NPC dialogue UI required special consideration because it's entirely optional; the player is able to ignore it completely if they want. Additionally, it was possible for there to be multiple NPCs with dialogue in close proximity, and UI had to display both text from the NPC and an arbitrary number of dialogue options for the player to respond with. 

Final

Dialogue is displayed in world-space above NPCs, along with any responses the player may choose from. This reinforces the interactive nature of the dialogue and also conveys the fact that the player can ignore these characters if they so choose. The UI also faces the camera at any angle, making it much easier to read. Finally, the UI only appears when the player is within a certain range

Cutscene version

In cutscenes, dialogue is independent from player choice, and thus becomes a single text box. It prompt the player to advance the dialogue with an icon in the bottom-right corner and a sound effect when animations have finished playing. It is also displayed in camera space instead of world space, conveying the importance of the dialogue during these key narrative moments.

Menu

Lethargent uses a simple nested menu system that can be navigated entirely using a controller. It also has a save/load system, allowing the player to save and quit at any time. UI icons and buttons created by Saad.