a lump of coral of any given shape is understood to be composed of a colony of individual coral animals. Coral species produce a wide variety of macrostructures: see for example table coral, brain coral, staghorn coral, and pillar coral, to name just a few out of thousands of species.
It seems apparent that the component animals of a branch, lump, or head of coral must somehow be aware of the overal structure of their comrades around them, otherwise they would not know where to situate themselves so as to form a part of that larger pattern.
So how do they do it? how does any given coral macrostrure emerge from the apparent individualistic behavior of bazillions of individual coral animals?