-
Notifications
You must be signed in to change notification settings - Fork 19
The RandomBlazon API
The DrawShield suite includes a facility to generate a random blazon. This blazon will be heraldically valid, and also will have an extremely high probability of being drawn correctly by the DrawShield program(!)
It is available from a dedicated page on the drawshield.net site but can also be invoked through a simple API.
The aim of the random generator is to inspire creativity and be the basis for new heraldic designs by:
- Being heraldically valid and syntactically correct
- Having no adjacent tinctures the same
- Choosing from a comprehensive set of choices
- Being drawable by DrawShield without errors or warnings
- Having a preference for the more commonly found features of heraldry
- But the rarer features might still appear occasionally
- Allowing the user to tailor the high level choices available
The API can be invoked by either a GET or POST request to the URL:
https://drawshield.net/include/randomblazon.php
This will return a blazon in plain text which can be used as required, for example it could be re-submitted to the drawshield API to have it drawn in a variety of styles and sizes. With no arguments the generator will simply apply some default tailoring of the options and return a plain text, neatly formatted blazon.
The high level choices made by the generator can be controlled by the user by setting argument options, either in the GET or POST request. For simplicity I will refer to the GET format.
Note that the generator will apply its own set of default values, which may change, and are not all the same. In particular, you should NOT ASSUME that an argument that is not present means that those choices will not be available. If you want to ensure that a particular set of choices is NOT used, then you should explicitly provide the argument and set its value to "off".
In the tables below columns show:
- "Option" gives the name of the argument
- "Meaning" is a brief explanation, and examples
- "Values" shows the available values, and the default value in brackets
- "Size" an estimate of the number of different possible choices
Very crudely, the total number of possible blazons that might be generated can be found by adding the sizes of all the "on" options of each table and multiplying the table totals together. The default values give a range of possible blazons in the hundreds of millions.
Option | Meaning | Values | Size |
---|---|---|---|
tinc-common | Use the most common heraldic colours (Gules, azure...) | on,off (on) | 7 |
tinc-second | Use the secondary heraldic colours (Tenne, murrey...) | on,off (on) | 11 |
tinc-modern | Use modern colours (Copper, iron, buff...) | on,off (off) | 10 |
tinc-treatments | Use any two of the preceeding colours in one of a number of repeating patterns (Fretty, maily...) | on,off (on) | 200 |
tinc-furs | Use any of the known furs (Ermine, potent...) | on,off (on) | 12 |