Date: 2020 - Ongoing
This is a fruit-themed top-down combat game I am developing as a personal project. Players control fruits as a worm that can jump from one fruit to another.
I created a component-based action system to implement my combat. Actions are made up of stages, and stages are made up of action components. New actions can quickly be composed out of existing components and it is easy to add new functionality to any stage of an action.
Actions for each character are organized into directed action graphs. This allows specifiying arbitrary combo trees for characters; it can handle cycles and self-cycles as well. The action graph also standardizes code for metrics about a character's current action state; for example, the minimum time needed until the next dangerous attack, for AI dodges and reactions.
Thanks to an input source abstraction, enemy AIs can seamlessly control the same characters as players. Each new fruit doubles as a playable character and an enemy.
AIs are implemented using the Utility AI pattern. Different component strategies can be easily mixed and matched to create different enemy behavior styles.
I implemented custom pathfinding to support levels stored as text files, with a point grid and the A* algorithm.
I made a simple collision system to avoid the unpredictability of physics and used raycasting to guarantee collision detection at any speed.
There is a level editor usable for development and by the player. 3D object preview images are generated by processing output from an ingame camera.
I made a texture tiling, blending, and overlapping system which divides block textures into 4x4 sub-units to tile borders with neighbors (such as joining dirt paths), blend colors, and overlap some textures over others.
There is a rasterizer to automatically generate circular, donut, rectangular, and cone search area sprites based on input parameters. I plan to extend this system to use as an art aide for generating new fruit textures as well.
I create my animations directly in Unity. I had a problem with having to specify keys for every transform on every animation, to avoid pulling bad values from updated state of pooled objects. I created an animation baker which finds a set of all keyed values for all animations of a unit, then generates runtime animations that key all values.
I also created an animator baker which fully generates animators based on code only. This speeds things up significantly in a solo development context.
I made an IK system with an editor script for movable handles, and my own IK solver which writes results directly into the animation clips.