SLEDGE

Project Type: Team of 10

Software Used: Unity

Language Used: C#

Primary Role: Ai & Tools Programmer

What is SLEDGE?

SLEDGE is a 3D Action Platformer game in which the player’s main movement is the knockback from their hammer. Every level tests the player’s mechanical ability with environmental hazards, timing puzzles, and different enemy encounters. 

My role on the team was to optimize the designer’s AI workflow, develop an efficient 3D pathing algorithm, and create a UI framework.

My Contributions

Behaviour Tree Editor

One problem on the design team was quickly creating new enemies in the engine. Our old process was creating a state machine script in C#, designers would implement their own logic in code.

I solved this problem by creating a Behaviour Tree tool for the Unity game engine. This tool was built from a preexisting tool from TheKiwiCoder with my own additions to fit our team’s needs. I added 20+ drag-and-drop nodes, a blackboard system, and two enemy pathing behaviors.

Behaviour Tree Editor Tool in Unity.

After I programmed the enemy behavior nodes, all designers had to do was drag and drop behaviors together. In the cases where designers did need to modify code, each node had a simple class structure with an OnStart, OnEnd, and OnUpdate function. This allowed designers to change functionality without worrying about the underlying foundation.

For example my Wait Action script below.

Enemy 3D Pathing

First Solution:

One enemy we had required a 3D Pathing algorithm where they hunted the player continuously. I started by designing an A* solution that chunked the world into a 3D grid and found the fastest path to the player.

The Problem:

In a smaller environment, this solution would have worked, however, with the large open-scale SLEDGE levels, the processing time was too high. I did try an Oct-tree solution but pathing was still too slow.

I looked back and wrote down our goals for the system.

  • A quick path processing time
  • From the player’s perspective, a smart tracking enemy

The Fix:

I worked backward from our goals and designed a new algorithm. 

Every 3-4 seconds the player adds their current position to a list, creating a player path. Then the enemy tries to follow a direct line to the player. When the enemy loses sight of them, they find the position on the player’s path closest to them and start to follow the player’s trail.

A demo of new hunting AI, follows the path until the player is in view!

This was efficient and from the player’s perspective seemed intelligent! Out of sight, the enemies would take non-optimal paths to the player, bouncing around corners like the player would. However, right when the player sees the enemy, they hone towards them hiding this unnatural pathing.

UI Programming

My final contribution was the core UI of the game. I wanted to make sure future UI designers could iterate on my designs so I created a framework of 5 UI base elements that could be mixed and matched.

Below are examples of UI elements I created for SLEDGE:

Contact Me!

Reach out at jonahpryan@gmail.com or in/jonah-ryan