ADITYA SINHAGAMEPLAY DESIGN + ENGINEERING
← All projects
DESIGN + ENGINEERING

Bloons TD5

ROLESystems Programmer

TEAM6 person team

DATEApr – May 2025

GENRETower Defense

GAME SUMMARY

Bloons TD5 is a tower defense game where players place and upgrade monkey towers to stop increasingly difficult waves of Bloons. Success comes from placement, timing, upgrade choices, and adapting to new enemy types.

THE PROJECT

Turn a familiar game into reusable systems.

This recreation was made by a team of six on the custom, data driven C++ engine I built. I personally owned the systems that turned familiar design needs such as tower placement, targeting, paths, and upgrades into reusable content authored through JSON.

WHAT I BUILT
  • Prefab driven towers and behaviors authored from JSON.
  • A scalable grid and a small level design tool for valid tower placement.
  • Node based path following for Bloon routes.
  • Uniform spatial partitioning for collision and nearby target queries.
Gameplay. The playable tower defense loop running on the custom C++ engine I built.
Bloons TD5 recreation with towers and Bloons on the map
A complete wave in progress with tower targeting, projectiles, paths, placement rules, and collision running together.
DESIGN NEED → ENGINE SYSTEM

Build the tool the gameplay asks for.

Each system started with a practical design question, then became a reusable part of the engine rather than a one-off solution.

AUTHORING

Prefab Service

Need: Create towers, upgrades, and behavior combinations without duplicating C++ setup.

System: Register and instantiate reflected prefabs directly from JSON, including game objects and composable Actions.

PLACEMENT

Grid and Level Tool

Need: Make tower placement feel predictable and keep towers off paths and blocked terrain.

System: Generate grid dimensions from resolution, mark invalid cells in a lightweight authoring mode, save them, and query the same data at runtime.

MOVEMENT

Node Based Paths

Need: Give every Bloon a readable route while making new paths easy to author.

System: Define paths as ordered node lists and inherit from a path follower component to reuse movement behavior across Bloon types.

TARGETING

Nearby Bloon Queries

Need: Let towers find useful targets without searching every active object.

System: Reuse the grid as a spatial index so a tower can query nearby buckets, then apply its targeting rule to a smaller set.

PERFORMANCE CASE STUDY

Use the playfield to reduce the search.

A tower defense game can place many towers, projectiles, and enemies on screen at once. The collision system needed to scale with that density.

THE PROBLEM

Every collider against every collider.

A brute force pass trends toward O(N²), even though most objects are nowhere near each other.

THE DECISION

Uniform spatial partitioning.

Each frame, colliders are placed into the grid cells they overlap. Collision tests happen only within relevant buckets, while a seen set prevents duplicate pair checks across neighboring cells.

THE RESULT

Roughly O(N) under a reasonable distribution.

The same service preserves enter and exit event semantics while reducing unnecessary checks. That supports gameplay scale without forcing towers or projectiles to know how collision is optimized.

JSON defining a tower firing behavior
JSON defining the behavior for firing at the nearest Bloon.
JSON defining a Sniper Monkey tower and upgrade paths
JSON defining a Sniper Monkey, its traits, and upgrade paths.

The engine behind the game

On this six person recreation, I used the reflection, content, factory, Action, service, and memory architecture from the solo C++ engine I built. This page isolates the gameplay systems I personally designed and implemented.

INSTRUCTIONS TO PLAY

Try the build.

  1. Download the game ZIP from itch.io.
  2. Extract the ZIP.
  3. Run the included .exe file.
Watch the core loop, then follow the system breakdown to see how the engine supports it.