← Back to projects
games · 2023 · Ongoing

Tank Lore

UnityC#AIEditor ToolTech Art
Tank Lore — Video Thumbnail

Project Overview

Tank Lore is a game where players pilot, upgrade, and customize their tanks to reclaim humanity's post-apocalyptic world ruled by rogue AI tanks in a procedurally generated world.

Role: Gameplay Engineer, Systems Designer

Team: 5 (2 developers, 1 artist, 1 designer, 1 audio designer)

Game Engine: Unity

Programming Language: C#

Technologies: Adobe Photoshop, Blender, GitHub, Visual Studio, Audacity, Notion, Trello

Platform: PC

Date: 2023 – Ongoing

Behavior Tree System

As we added more and more enemies, it became apparent to us that our state machine system was starting to get messy. Even though it was implemented in a modular and reusable way, creating connections between states and keeping track of them was something we struggled to manage.

So, to help us streamline that part of the development, and to get to do what I enjoy doing a lot (creating tools), I implemented a behavior tree node-based system for the Unity Editor using Unity's built-in Graph View, UI Toolkit and UI Builder.

The visuals of the node editor were inspired by the ones in Unreal Engine. I used UXML and USS to accomplish the current state of the tool, and it's still work in progress.

The Blackboard was a crucial feature of the system. I implemented it using Unity's built-in Blackboard system and customized it to meet the specific needs of the project. This implementation allows for the creation of various data types that can be easily accessed through code using a BlackboardKey variable.
Unlike the blackboards found in Unity's Shader Graph and Animator, where variable names must be typed manually, this system is foolproof, with all variables conveniently listed in a menu in the Inspector.

The behavior tree system is a flexible and visual approach to creating AI behaviors in games. It organizes actions and decisions into a hierarchical structure of nodes, where each node represents a specific task or condition. The tree traverses these nodes, evaluating conditions and executing actions based on their success or failure which allows complex and dynamic decision-making.

The graph view makes it easy to create new behavior trees, and add, delete, copy, and paste new nodes.

Learn more about the library here.

Quests and Meta Progress

Between runs, players return to a hub world that changes based on what they've done: new quests, NPC dialogue, shop items and enemies unlock as the story progresses. I built this as a world state system where persistent flags and counters, saved in signed files to stop tampering, are evaluated by a dedicated behavior tree, so designers can author whole quest lines without new code.

Read the full breakdown in the case study.

Tank Recoil System

In Tank Lore, tanks experience a recoil effect when moving, halting, or firing. Initially, we implemented a static recoil animation, which did the job at the time. However, to account for the varied dynamics of different actions, I developed the Tank Recoil System. This system performs dynamic animations by adjusting intensities and motion curves specific to each action. I used Unity's Scriptable Objects to store and reuse the values passed to the system to make it easy to adjust the values when needed.

Local Multiplayer

I added a couch multiplayer option. The system was implemented using Unity's new input system. The difficulty of the game dynamically increases in multiplayer mode.

Aim-Assist

The game has an aim-assist feature that takes place when the player stops both movement and aim. This adds a little boost to players who have difficulties aiming in the game.

Player Skill Tree

In Tank Lore, players can enhance their tanks by upgrading weapons, gaining new abilities, and increasing stats through a skill tree. A key challenge was enabling the UI to be navigable with button inputs for controller users, eliminating the need for cursor control. I addressed this by developing a custom UI element framework. This framework includes a parent component that manages navigation through four directional slots, with each slot having a definable destination. The process of setting these destinations is streamlined with a custom editor script. This navigation setup is applied across all UI components, including the skill tree cells.

I only implemented 5 skills in the skill tree as we haven't fully tested the game's overall progression. It's still far down the project's timeline, but the system's core functionality is working.

Level Generation (Growing Tree Algorithm)

The level generation of the game is handled using the Growing Tree Algorithm. It takes a set of premade rooms, and based on configurations it creates a maze-like layout where rooms are connected through gates.

Since only one room can be active at any time, we didn't have to concern ourselves with making enough space for rooms of different sizes. Here's a little tool to view how the algorithm works. Click the grid to simulate how the level is generated in the game, and try the different strategies to see how they affect the shape of the layout :)

CELL SELECTION: ROOMS:

Click the grid to regenerate

Dynamic Camera Controls

Camera control in Tank Lore evolved as the project progressed. Initially, we utilized Cinemachine for basic follow mechanics, tracking the player's movement. However, to better meet gameplay needs, I developed an enhanced camera controller with several key features:

  • The camera follows the player's cursor instead of the player directly, providing a better feeling when aiming and exploring.
  • In two-player mode, the camera follows the midpoint between both players' cursors, ensuring both are always in view.
  • The camera's following speed increases when a player is boosting, keeping the action in frame during high-speed movements.
  • The camera zooms out during combat for a broader view and zooms in during safe periods for a more focused exploration.
  • During key events, such as entering a boss room, the camera automatically focuses on the main targets to enhance the dramatic impact.
  • At all times, the camera keeps the outer boundaries of the room out of view.

Mapmaker

I implemented a mapmaker tool that made the process of designing rooms easier. With this tool, we could build the room using tiles, set spawn points for enemies, level props, and destructibles that drop collectables. The visuals of the individual tiles and props change depending on the level. The room is then saved as a scriptable object and can be viewed by the inspector by drawing a simplified version of it using a custom editor script.

Component Breaks

I implemented a little custom editor tool that acts as a visual representation of a break that groups components on the same game object.

Other Responsibilities

Here's a list of other tasks that I was responsible for in the project:

  • UI Programming: Developed scalable UI interaction systems compatible with both keyboard and controllers.
  • Custom Utilities Scripts: Created attributes that ease the task of assigning references in the inspector, creating new scriptable objects, null checking, and more.
  • QA sessions and playtests: Organized and conducted multiple playtests at community indie events, collecting feedback and addressing areas for improvement in weekly team meetings.
  • Shaders creation: Designed and implemented a variety of custom shaders using Shader Graph, enhancing the visual style of the game.
  • Documentation: Maintained thorough documentation for features, concepts, and systems to support future development and team reference.
  • Script Templates: Created a custom script generator that streamlined adding new child classes—such as abilities, UI windows, and editor cheats—by integrating them seamlessly with pre-existing game features.