Refining Cluster Combat

Table of Contents

Over the past two weeks, most of my development time has been dedicated to refining the cluster combat system. Since this mechanic forms one of the core foundations of the game, I wanted to ensure its behavior, pacing, and internal logic were solid before building further systems on top of it.

The work ended up being more extensive than expected, but the system is now in a state I’m genuinely satisfied with.

Below is a summary of the major changes and improvements completed during this period.

Cluster Combat Reworked

The cluster combat system has been reworked, tweaked, re-tweaked, and then rewritten in the places where tweaking no longer made sense. This is the core structure that determines who fights whom, when, and why, so it deserved the extra attention.

🔧 Cluster Parameters (a.k.a. The Three Dials of Chaos)

To make the system flexible, I exposed three key cluster parameters:

  • Engagement Window How long a forming cluster waits before it “locks in” and enters the roll phase.

    • Short window → many small skirmishes.
    • Long window → big, messy brawls.
  • Cluster Radius How close opposing units need to be to fall into the same cluster.

    • Small radius → lots of isolated micro-fights.
    • Large radius → one big family reunion of violence.
  • Post-Combat Delay A brief pause after each mini-turn, adding a bit of that turn-based tension: the moment where the dice settle, everything hangs for a second, and the player anticipates the outcome before the next exchange begins.

Enemy AI Upgrades

While the clusters ate most of my time, the AI got some much-needed attention too.

Memory & Targeting

Enemy units now remember where they last saw the player. These memories fade over time, so the AI naturally gravitates toward more recent sightings instead of wandering the map like it’s sightseeing.

The red dots show paths of the enemy units, I’ve left them for easier debugging and to visualise the AI behaviour.

Smarter Worker Management

I gave the AI the ability to:

  • calculate distance to bases
  • consider worker speed
  • account for gathering times
  • max node slots
  • avoid sending workers on pointless back-and-forth trips

In short, the AI now behaves like a real machine, guaranteed to send his workers in the best possible way to maximise his income. In case of many locations and workers it should actually do it better that humans.

AI Advisors

To keep AI logic manageable, I split responsibilities into separate “advisor” agents:

  • Economy Advisor – handles workers, resource collection, and production
  • Military Advisor – handles units, combat, and cluster decisions

(More advisors likely in the future - maybe an Upgrades Advisor, or a Life Choices Advisor for me.)

This structure should make future changes much easier to maintain without me crying into my keyboard.

Fleeing Logic

Units that get attacked now have a short window to attempt to flee. The tuning aims for a balance where:

  • fleeing forever isn’t possible,
  • but workers aren’t sentenced to immediate death the moment something looks at them funny. It gives skirmishes a touch more tactical nuance without undermining the cluster system.

Upcoming: I expect that there are still some bugs left to fix in the cluster combat system but anyway I plan to start working on more upgrades, including a “tornado” AoE ability that disrupts clusters by applying physical forces. Plenty more to come!