Blighthouse

Submitted to Godot Wild Jam #72, developed between 9th August and 18th August 2024 with the theme "Light and Dark".
Placed #136 out of 155 entries.
Summary
Blighthouse was planned to be a free-roam tower defense game, but sadly our team way overscoped and ended up with a barely functioning mess. Still, it was a great learning experience for me.
Pathfinding and AI Behaviour
For the enemies, I learned how to use and implement Godot's NavigationAgent system, which uses the A* pathfinding algorithm. Additionally, I made a finite state machine, which I used for the enemy AI to control their behaviour.


The root is a CharacterBody2D, and it has (grand)children such as a state machine with its states, sound playing nodes, its sprite and animator, timers, navigation agent, and its components (more later).
Shader
For the lighting, I took my first leap into proper shader code using Godot's shader language. It was implemented as a modulator for the entire canvas, where every pixel was darkened unless a light was present nearby. Admittedly, it wasn't very good, and Godot's 2D lighting system would have worked better anyway, but it was fun to get into the nitty gritty of shader code.

A "light" is stored as a vec4 colour, where red and green is its x and y position in space, blue is its colour type (retrieved from a const array, 0 is red, 1 is orange, 2 is yellow, etc.), and alpha is the strength of the light or its radius.
Components
Blighthouse was my first experimentation in a component-based entity system. As a developer, I only had to code the functionality for health, hitboxes, and attacks once, then I could simply drag and drop the components to instantiate as needed to the necessary entity.

The root node is a CharacterBody2D, with (grand)children such as its sprite, a light Marker2D, components, weapons, sound playing nodes, timers, and colliders/areas.


Max Health = 20
Root Node = Player
Retrospective
While Blighthouse could barely be classed as a game, I have no regrets in it being part of my learning journey. While some poor decisions were made, and the systems were fairly primitive, Blighthouse was an absolutely essential stepping stone into bigger and better things. The components paradigm and FSM are highly adaptable concepts that I use in my later projects.