I spend a lot of time thinking about heraldry, but perhaps not in quite the same way that a heraldic historian does. For Iron Arachne, I have to think about heraldry as a system that can be represented in software. That changes the questions I ask. It’s easy enough to assemble a catalog of lions, eagles, crosses, swords, flowers, and crowns and randomly select from it † This is pretty much what the very first version of the heraldry generator did. The heraldry generator is older than Iron Arachne itself, in fact, and none of the original code is part of the current site. ↩ .
That can produce something that looks vaguely heraldic. It does not, however, reproduce heraldry. A heraldic tradition is not merely a collection of symbols. It’s a system of rules governing how those symbols are selected, described, arranged, combined, distinguished, and recognized.
That raises a more interesting problem for procedural generation: how can I represent those systems programmatically while remaining reasonably faithful to the historical circumstances in which they developed? Comparing European heraldry with Japanese mon is particularly useful because the two traditions solve some similar problems using remarkably different visual systems. Those differences suggest different approaches to procedural generation.
Glossary
This article describes a few different concepts that you might be unfamiliar with. I’ve put together a glossary here to define some of the terms. Feel free to skip to the next section if you know them already.
- Procedural generation: creating things by applying rules rather than selecting finished examples from a catalog.
- Blazon: the conventional verbal description of a coat of arms.
- Field and tincture: the field is a shield’s background; a tincture is the heraldic name for a color or metal used in the design (Azure is blue, Or is gold).
- Charge, motif, and attitude: a charge is a figure placed on the field; its motif is the kind of figure, and its attitude is its pose (a lion rampant is reared upright).
- Ordinary and division: an ordinary is a standard geometric charge, such as a cross or broad stripe; a division splits the field into regions.
- Mon and kamon: a mon is a Japanese emblem; kamon specifically means a family emblem.
- Grammar and corpus: grammar means the rules for constructing designs; a corpus is the collection of historically documented examples.
- Morphology and syntax: morphology describes the forms a language’s terms take; syntax describes how those terms are arranged.
- Abstract syntax tree and scene graph: an abstract syntax tree is a nested structure of the parts of a description; a scene graph organizes visual objects and their relationships.
- Finite state machine: a model of a process moving among a limited set of named states according to rules.
- Cadency and marshalling: cadency distinguishes the arms of family branches; marshalling combines arms to show inheritance or alliance.
- Negative space: the open areas around and between shapes.
- SVG: a text-based format for scalable vector images.
- Enum and tagged union: an enum is a fixed list of named choices; a tagged union is a value that can take one of several named forms.
Heraldry as a Generative System
Western European heraldry is unusually convenient for programmers because it already has something resembling a formal language. A coat of arms can be described using a “blazon”: a specialized vocabulary and grammar capable of describing a heraldic design with enough precision that someone familiar with the system can reconstruct it. Here’s a simple example.
Consider a simple hypothetical blazon:
Azure, a lion rampant Or.
Even without seeing the shield, someone familiar with heraldry can reconstruct its essential appearance. The field is blue (azure). Upon it is a lion standing in the conventional rampant posture. The lion is gold or yellow (Or).
More complicated arms add divisions of the field, ordinaries, multiple charges, positional relationships, variations in tincture, and other qualifications, but the basic idea remains the same. The blazon is not simply a name assigned to a picture. It is a structured description of one. That makes blazon interesting from a computational perspective. It behaves somewhat like a constrained natural language: a language with rules that limit which combinations are valid.
A blazon has a vocabulary, morphology, syntax, and an expected ordering of information. Some constructions are valid while others are not. Earlier parts of the description establish a context in which later parts are interpreted. A relatively small collection of rules and terms can describe a very large space of possible images.
This resembles the generative systems studied in linguistics. Rather than storing every possible sentence, a language provides rules capable of generating an effectively unlimited number of sentences. Heraldry does something similar for visual designs.
For a procedural generator, that suggests an obvious architecture: generate a valid heraldic description first, then render it. In principle, the same blazon could even be handed to several different renderers. They might produce stylistically different lions, shields, or fleurs-de-lis, while all producing recognizable representations of the same arms. The underlying identity lies partly in the abstract description rather than in one exact drawing.
Japanese Mon Take a Different Route
Japanese mon and kamon present a rather different problem. Like European heraldry, mon served as visual identifiers and could be associated with families, individuals, institutions, and political relationships. They appeared on clothing, banners, equipment, buildings, and other objects.
But treating mon as simply “Japanese coats of arms” obscures substantial differences between the traditions. Most importantly for procedural generation, there is no direct equivalent to blazon at the center of the system. Mon are generally highly stylized designs constructed from recognizable motifs: plants, animals, celestial objects, tools, geometric figures, and other forms. Those motifs are abstracted into a compact visual vocabulary and arranged according to recognizable compositional patterns. One of the most famous examples is the Tokugawa mitsuba aoi: three stylized hollyhock (or ginger) leaves arranged rotationally around a central point.
The important thing here is not simply that the design contains three leaves. Its identity comes from the combination of a particular stylized leaf form, repetition, orientation, spacing, symmetry, and overall silhouette. A generator approaching this design as though it were a Western blazon might begin with something like “three hollyhock leaves.”
That description contains some of the correct information, but nowhere near enough to reproduce the mon. The geometry matters. This suggests a different procedural model.
Instead of generating a linguistic description and resolving it into an image, a mon generator can operate much more directly on graphical primitives:
Take a base shape. Duplicate it three times. Rotate each copy around a common origin. Scale and position the elements according to a template. Clip or enclose the result within a circle where appropriate.
The resulting system begins to resemble procedural geometry more than natural-language generation.
Two Different Generation Strategies
This gives us two strikingly different models for generating heraldic designs. Western heraldry can be treated as primarily descriptive. Generate a structured description of an object and then render that description. Japanese mon can be treated as primarily compositional. Generate a visual structure by combining and transforming graphical elements.
That distinction is not absolute. Western heraldry obviously contains extensive compositional rules, and mon have names and conventional classifications. Neither historical tradition was invented as a software architecture. Nevertheless, the distinction is useful when deciding how to represent them computationally.
Consider how each system might represent three repeated objects. In Western heraldry, the important information might include the identity of the charge, its tincture, its number, and its arrangement. “Three roundels argent, two and one” communicates an arrangement that a heraldic artist can interpret. A mon generator might instead express a similar concept geometrically:
- Load the base motif.
- Make three instances.
- Place their origins at a defined radius from the center.
- Rotate the instances by 0, 120, and 240 degrees.
- Scale them until their outlines satisfy the desired spacing.
- Apply any enclosing or masking geometry.
The Western representation is closer to an abstract syntax tree. The Japanese representation is closer to a scene graph. For procedural generation, both are extremely attractive.
Rules Matter More Than Symbol Lists
This comparison also demonstrates why simply collecting historical symbols is insufficient. Western heraldry has rules governing tinctures, field divisions, ordinaries, charge placement, repetition, cadency, marshalling, and many other features. The famous “rule of tincture,” for example, generally discourages placing a metal on a metal or a color on a color. The practical effect is strong visual contrast: a gold lion on a blue field is readily distinguishable, while a red lion on a blue field is less so. A generator that chooses a random field color and then independently chooses a random charge color will therefore produce combinations that violate one of the most recognizable conventions of the system.
The better approach is conditional generation. Choosing the field constrains what can come next. If the field is a color, the generator can preferentially select a metal for a major charge. If the field is divided, another set of possibilities becomes available. If an ordinary is present, the possible placement of other charges changes.
Mon impose different constraints. Symmetry, repetition, enclosure, negative space, and the degree of abstraction become particularly important. A randomly selected flower pasted three times onto a circle is no more convincingly a mon than a randomly selected lion pasted onto a shield is convincingly a coat of arms † Although, you could make the case that this horribly over-simplified version would be an acceptable prototype. I may play around with this. ↩ . In both cases, the generator needs to model relationships rather than merely objects.
And Then There Are the Exceptions
Unfortunately for programmers, historical visual systems are rarely as tidy as their introductory rules make them appear. Western heraldry is full of exceptions, disputed conventions, regional differences, historical developments, and arms that appear to violate rules presented as fundamental. The rule of tincture itself has famous exceptions.
The arms traditionally associated with the Kingdom of Jerusalem place gold crosses on a silver field: metal upon metal. That is not a bug in heraldry. It is evidence that the “rule” is a historical convention rather than a law of physics.
A procedural generator therefore has to decide what sort of system it is modeling. Is it attempting to generate arms that would satisfy a modern herald’s expectations? Arms characteristic of fourteenth-century England? A broad fantasy approximation assembled from several European traditions? Those are different generators.
Mon present the same problem from another direction. A clean taxonomy of motif plus repetition plus enclosure is useful for software, but the historical corpus does not exist to make my TypeScript interfaces convenient. Designs can be altered, combined, simplified, differentiated, or used in multiple forms. Families could use more than one mon, related groups could use variations of a design, and similar motifs could appear independently.
Even the idea that a mon corresponds neatly to one family in the same way that a coat of arms belongs to a particular person entitled to bear arms can be misleading. Real heraldic systems contain history, and history produces irregularity. One possible solution is to distinguish between grammar and corpus.
The grammar describes the normal operations available to the generator. The corpus records historically attested forms, including forms that the general grammar would be unlikely or unable to generate. That approach lets the software say, in effect: “This is how designs of this tradition are usually constructed, but these specific exceptional designs also exist.”
What Should Iron Arachne Actually Generate?
This comparison raises a question for Iron Arachne’s existing crest generator. Should a fantasy crest generator really be modeled primarily on Western blazon? Perhaps not.
Blazon is attractive because it provides an unusually rich formal vocabulary. From a programmer’s perspective, it is tempting to reproduce that vocabulary directly. Generate a field, select tinctures, select charges, determine their attitudes and arrangements, and serialize the result as a blazon. But Iron Arachne’s actual goal is usually to produce an interesting visual artifact for a fictional setting. In that context, the compositional logic demonstrated by mon may be more useful.
That changes the question I ask. Instead of asking, “what heraldic sentence should I generate?” I can ask “what visual relationships should I generate?” A crest could begin with a small set of graphical primitives.
Those primitives could then be reflected, rotated, repeated, nested, intersected, or arranged around an axis. Heraldic charges could themselves become primitives in a larger compositional system. The result would not necessarily be historically valid European heraldry or Japanese mon. It would instead borrow a useful procedural insight from both.
Western heraldry provides a grammar of meaningful categories and relationships. Mon, on the other hand, provide a grammar of visual composition. Combining those ideas may produce a better fantasy symbol generator than faithfully implementing either tradition alone.
How Difficult Are They to Generate?
At first glance, Western heraldry seems easier to generate because so much of its structure has already been formalized in language. A subset of blazon can be represented quite naturally using enums, tagged unions, grammar rules, or an abstract syntax tree. A renderer can walk that structure and produce SVG elements.
The difficulty grows rapidly, however, as the supported vocabulary expands. Charges can have different attitudes. Fields can have complex divisions and treatments. Charges can themselves bear charges.
Marshalling introduces compositions of entire arms. Historical and regional vocabularies differ. Generating some plausible Western arms is relatively easy. Implementing heraldry is not.
Mon have almost the inverse difficulty. A limited mon-like generator is extremely easy to imagine. SVG is particularly well suited to the problem because it already provides paths, groups, transformations, clipping, masks, and reusable definitions. A base motif can be defined once and instantiated repeatedly with transformations.
Reproducing the historical variety of actual mon is much harder. The difficult part is not drawing three rotated copies of a leaf. It is constructing a vocabulary of motifs and transformations that reproduces the visual logic of historical examples without merely tracing and storing thousands of finished designs. The boundary between generating designs and selecting designs from a catalog is where the interesting procedural-generation problem lies.
Can Heraldry Be a Finite State Machine?
One of the things I studied in my graduate program this year is the concept of finite state machines. That got me to thinking about how I could apply them to Iron Arachne. In this case, can either visual identity system be represented as a finite state machine?
For a deliberately restricted subset, sure. A Western generator begins with the field and its tincture, may add an ordinary and its tincture, then chooses charges, their tinctures, and arrangement before completing the arms. Transitions can be constrained by previous choices.
Selecting a color field, for example, can change the permitted or weighted tinctures of a charge. A mon generator begins with a motif, chooses a repetition scheme and symmetry, then settles orientation, enclosure, and any embellishment. Again, earlier choices constrain later ones.
But I suspect that a pure finite state machine is the wrong final abstraction for either system. Both systems are hierarchical. A charge can contain or interact with other charges. A field can be divided into regions that themselves need descriptions.
A mon can contain groups of repeated elements inside larger enclosing or repeated structures. That points toward grammars, trees, or graph-like representations rather than a flat state machine. A finite state machine may be useful for controlling the generation process, while a tree represents the generated design. That distinction is probably worth preserving in Iron Arachne.
The Bigger Lesson
The most useful thing I have learned from comparing these traditions is that procedural generation should not begin by asking what objects exist in a particular domain. It should begin by asking what operations exist. A catalog tells me that heraldry contains lions, eagles, crosses, hollyhocks, chrysanthemums, circles, diamonds, and thousands of other motifs.
A generative system tells me that things can be divided, repeated, mirrored, rotated, enclosed, superimposed, contrasted, grouped, and subordinated to one another. The second list is much more powerful. This is applicable well beyond heraldry.
Whenever I want to procedurally generate something derived from a historical visual tradition, I need to resist the temptation to treat the tradition as an asset library † I have failed to resist this temptation in the past. The first versions of the heraldry generator were basically this. ↩ . The goal should be to identify the rules that produce recognizable structures. The difficult part is determining which of those rules actually belonged to the historical tradition and which are classifications imposed afterward by people trying to explain it.
Future Work: Other Visual Grammars
Japanese mon and Western European heraldry are only two examples of systems that encode identity visually. There are many others worth investigating from the perspective of procedural generation. Each uses a different visual vocabulary and set of conventions to communicate identity.
Scottish tartans provide an obvious example, with identity represented through repeating sequences of colored bands and their intersections. Flags provide another, particularly because vexillology combines geometric composition with a relatively restricted vocabulary of divisions, colors, and symbols. Merchant marks and masons’ marks offer much simpler systems of personal identification † Iron Arachne already generates merchant marks for organizations, but the way the heraldry and merchant mark systems differ has been bothering me for awhile now. ↩ . Military insignia, cattle brands, seals, maker’s marks, and modern corporate logos all solve related problems under different technological and social constraints.
Even writing systems may belong somewhere in this investigation. Once visual identity is understood as a grammar rather than a catalog, the boundary between generating an emblem and generating a glyph becomes surprisingly thin. That is particularly interesting for Iron Arachne, where fictional writing systems, heraldry, flags, and other cultural artifacts ultimately face the same procedural question: what is the smallest useful set of rules from which I can generate something that looks as though it belongs to a coherent visual tradition? I suspect that is a much more productive question than asking how many symbols I can put in a database. This is something I’m working on now, and might be the theme of the next big update to Iron Arachne.
Sources and Further Reading
Bartolus de Saxoferrato. De Insigniis et Armis. c. 1350.
Dower, John W. The Elements of Japanese Design. Weatherhill Inc., 2000.
Friar, Stephen. A New Dictionary of Heraldry. Alphabooks Ltd., 1987.
Turnbull, Stephen. Samurai Heraldry. Osprey Publishing, 2002.
“A Roll of Japanese Armory”. Academy of Saint Gabriel.