Connected Component Labeling

NOW AVAILABLE!
Strategy Games in ActionScript 3: Terrains!

The Problem:

You've created a nice looking terrain with islands and oceans, now you need the computer to understand what regions (land or sea) are connected to each other.

To the rescue comes "connected component labeling". Using this algorithm, we will be able to identify the different regions of an image.

To the left is an interactive demostration of the algorithm. In the forthcoming lesson "Strategy Games in ActionScript 3", I will take you step-by-step writing the code and integrating it with the terrain generation and then A* pathfinding and statemachines.