Fiction generator post-mortem: mythology generation

For JuNoGenMo[1] this year, I wrote a small script to generate work in the style of sumerian mythology.

Fiction generator post-mortem: mythology generation

For JuNoGenMo[1] this year, I wrote a small script to generate work in the style of sumerian mythology.

Sumerian mythology, in the form of translated primary sources, has a number of attributes that make it suitable for prose generation. The original sources tend to be extremely repetitive, prone to inserting long lists, and without a strong narrative.

Part of this is the use of exhaustive lists of epithets. For instance, here is a portion of an actual myth:

Grandiloquent lord of heaven and earth, self-reliant, Father Enki, engendered by a bull, begotten by a wild bull, cherished by Enlil, the Great Mountain, beloved by holy An, king, meš tree planted in the Abzu, rising over all lands; great dragon who stands in Eridug, whose shadow covers heaven and earth, a grove of vines extending over the Land, Enki, lord of plenty of the Anuna gods, Nudimmud, mighty one of the E-kur, strong one of heaven and earth! Your great house is founded in the Abzu, the great mooring-post of heaven and earth. Enki, from whom a single glance is enough to unsettle the heart of the mountains; wherever bison are born, where stags are born, where ibex are born, where wild goats are born, in meadows ……, in hollows in the heart of the hills, in green …… unvisited by man, you have fixed your gaze on the heart of the Land as on split reeds.

About eighty percent of that paragraph is a list of alternate names for or attributes of the god Enki. Only the final line, “you have fixed your gaze on the heart of the Land as on split reeds”, is action — and the action in question is looking down.

Other times, the author suddenly descends into exhaustive lists of types of things, as with this section, where he lists musical instruments:

"He made {the lyre, the alĝar instrument, the balaĝ drum with the drumsticks} {(some mss. have instead:) the lyre, the alĝar instrument, the balaĝ drum of your sur priests} {(1 ms. has instead:) your lyre and alĝar instrument, the balaĝ drum with the drumsticks} {(1 ms. has instead:) the lyre, the alĝarinstrument, the balaĝ drum and even the plectrum (?)}, the ḫarḫar, the sabitum, and the …… mirituminstruments offer their best for his holy temple. The …… resounded by themselves with a sweet sound. The holy alĝar instrument of Enki played for him on his own and seven {singers sang} {(some mss. have instead:) tigi drums resounded.}"

The inclusion of editorial notes indicating variations between sources expands this further. (This pattern probably has something to do with the style in which scribes were educated: they spent much of their time transcribing lists of related objects or animals read aloud by a teacher, then later transcribed myths read aloud.)

The style in which sumerian gods are usually named is also well-fitted to generation. Usually, their name is a combination of the word for their general domain and either ‘en’ or ‘nin’ (both of which mean ‘lord’ or ‘master’). Generally speaking, there is also some drift, as gods have their domains overlap with others in the pantheon & take on some of the same epithets. (For instance, Enki, whose domain is water & creativity, is strongly associated with the manufacture of alcoholic beverages, even though that domain is properly owned by Ninkashi — ‘our lady of drinks’.)

Taking inspiration from the use of categorized corpora in Emily Short’s Annals of the Perrigues, I created lists of specific domains associated with sumerian words, then produced lists of epithets associated with those domains. I could then generate a god name and a list of associated epithets of arbitrary length.

Having produced god names, I created templates for stories. Actual sumerian myths are often fairly narratively simple (when they aren’t overly repetitive and complex), and so I turned the plots of some actual myths into templates:

storyTemplates=[ 
"%a% went to the market in %city%. There were %band% %a% met %b%.",
"%a% was sitting on a throne. Around %a% there were %band% and %band% and %band% and the throne was in %city%.",
"%a% and %b% made a bet, wagering %wagers%. %a% won, and %b% became jealous, accusing %a% of cheating. So, %b% and %a% made another bet, and %a% won again. Finally, %b% removed all their clothes and seduced %a%, who gave up their winnings, and %b% left on a magic boat",
"%a% was sad. %b% said, \"%a%, why are you crying?\" %a% didn't respond. %b% said, \"%a%, my %a%, why do you cry? You are %a%, %a% is who is crying. Why should %a% cry?\" %a% saw that %b% was correct. %a% was happy again."
]

The first template here is not based on an existing myth, but the second is based on Enki’s Journey to Nibiru, the third template is based on Enki and Ninmah, and the fourth is based on the final section of Enki and the World Order.

I also substitute in actual city names & constructed musical instrument names. The musical instruments found in sumerian records are often difficult to categorize or describe, since the names used bear no relationship to more modern names with which we have more complete records associated. (This is a common problem with sumerian taxonomies of things — it’s a long-dead language that was completely lost & forgotten for thousands of years, and one in which long lists of names were more common than descriptions. There are lots of plant and animal lists that are similarly obscure.) As a result, I simply generate gibberish names — as meaningful, in most cases, to a scholar of the ancient near east as actual sumerian musical instrument names:

def musicalInstrumentName(): 
return (
random.choice(["b", "c", "d", "f", "g", "h", "j", "k", "l", "m", "n", "p", "r", "s", "t", "w", "z", ""])+
random.choice(["a", "e", "i", "o", "u"])+
random.choice(["b", "c", "d", "f", "g", "h", "j", "k", "l", "m", "n", "p", "r", "s", "t", "w", "z", ""])+
random.choice(["b", "c", "d", "f", "g", "h", "j", "k", "l", "m", "n", "p", "r", "s", "t", "w", "z", ""])+
random.choice(["a", "e", "i", "o", "u"])+ random.choice(["b", "c", "d", "f", "g", "h", "j", "k", "l", "m", "n", "p", "r", "s", "t", "w", "z", ""])+
" "+random.choice(["drums", "lutes", "flutes", "whistles", "reeds", "birds", "singers", "lamentation singers"]))

Finally, I produce titles, based on the common format found in actual titles:

storyNames=[ 
"The lamentation of %a%",
"The lamentation of %a% in %city%",
"%a% and %b%", "%a% and %b% in %city%",
"%a% and the lord of %city%",
"%a% and the priest of %b%"
]

The results aren’t exactly readable, but they are almost precisely as readable as the sumerian myths themselves.

LILNIN AND ENKASHI
Ninki, 
[14 ms have: ,
beloved Ninki,
[22 ms have: ,
whose dung-heaps are the mountains,
whose excrement fertilizes the fields,
beloved Ninki,
whose excrement fertilizes the fields,
[22 ms have: ,
beloved Ninki,
[11 ms have: ,
whose advice is always advisable,
beloved Ninki,
whose excrement fertilizes the fields,
beloved Ninki,
whose domain is the earth,
whose domain is the land,
who sets the nations and draws their borders,
whose plow-furroughs are the valleys,
whose domain is the earth,
beloved Ninki,
whose dung-heaps are the mountains,
whose domain is the earth,
whose domain is the land,
whose advice is always advisable,
whose domain is the earth,
whose dung-heaps are the mountains,
beloved Ninki,
whose dung-heaps are the mountains,
beloved Ninki,
whose hands build the mountains and topple them,
who puts the continents in their places,
who puts the continents in their places
was sad. Kien,
whose domain is the earth,
whose dung-heaps are the mountains,
whose advice is always advisable,
whose dung-heaps are the mountains,
whose domain is the land,
who puts the continents in their places,
whose domain is the land,
whose plow-furroughs are the valleys,
beloved Kien,
whose hands build the mountains and topple them,
whose plow-furroughs are the valleys,
whose excrement fertilizes the fields,
whose advice is always advisable,
whose hands build the mountains and topple them,
who sets the nations and draws their borders,
whose dung-heaps are the mountains,
whose plow-furroughs are the valleys,
whose excrement fertilizes the fields,
beloved Kien,
whose domain is the land,
whose hands build the mountains and topple them,
whose domain is the land,
whose dung-heaps are the mountains,
whose hands build the mountains and topple them,
who puts the continents in their places,
whose excrement fertilizes the fields,
who sets the nations and draws their borders,
whose advice is always advisable,
whose dung-heaps are the mountains,
whose plow-furroughs are the valleys,
who puts the continents in their places,
whose plow-furroughs are the valleys,
beloved Kien,
whose plow-furroughs are the valleys,
Kien,
who sets the nations and draws their borders,
whose hands build the mountains and topple them,
whose domain is the earth,
whose advice is always advisable,
[20 ms have: ,
who puts the continents in their places
said, "Ninki,
whose plow-furroughs are the valleys,
whose advice is always advisable,
who sets the nations and draws their borders,
whose domain is the land
, why are you crying?" Ninki,
who sets the nations and draws their borders,
who puts the continents in their places,
whose advice is always advisable,
[4 ms have: ,
whose dung-heaps are the mountains,
whose excrement fertilizes the fields,
who puts the continents in their places,
who sets the nations and draws their borders
didn't respond. Kien,
whose plow-furroughs are the valleys,
whose advice is always advisable,
whose excrement fertilizes the fields,
whose hands build the mountains and topple them,
whose advice is always advisable,
whose domain is the land,
beloved Kien,
whose domain is the earth,
who sets the nations and draws their borders,
whose domain is the land,
[2 ms have: ,
beloved Kien,
whose domain is the earth,
whose excrement fertilizes the fields,
whose domain is the land
said, "Ninki,
whose advice is always advisable,
beloved Ninki,
whose advice is always advisable,
whose hands build the mountains and topple them,
whose excrement fertilizes the fields,
beloved Ninki,
whose plow-furroughs are the valleys,
beloved Ninki,
whose dung-heaps are the mountains,
whose domain is the earth,
beloved Ninki,
whose plow-furroughs are the valleys,
who puts the continents in their places,
beloved Ninki,
who puts the continents in their places,
whose excrement fertilizes the fields,
beloved Ninki,
whose dung-heaps are the mountains,
whose plow-furroughs are the valleys,
whose advice is always advisable,
whose domain is the earth,
whose excrement fertilizes the fields,
whose advice is always advisable
, my Ninki,
who sets the nations and draws their borders,
beloved Ninki,
whose excrement fertilizes the fields,
Ninki,
whose advice is always advisable,
whose dung-heaps are the mountains,
whose plow-furroughs are the valleys,
whose advice is always advisable,
whose domain is the earth,
whose advice is always advisable,
beloved Ninki,
who puts the continents in their places,
whose plow-furroughs are the valleys,
whose advice is always advisable,
whose dung-heaps are the mountains,
whose domain is the earth,
[8 ms have: ,
whose hands build the mountains and topple them,
[2 ms have: ,
who sets the nations and draws their borders,
whose dung-heaps are the mountains,
beloved Ninki,
whose excrement fertilizes the fields,
who sets the nations and draws their borders
, why do you cry? You are Ninki,
whose excrement fertilizes the fields,
whose advice is always advisable,
whose hands build the mountains and topple them,
whose plow-furroughs are the valleys,
whose excrement fertilizes the fields
, Ninki,
whose plow-furroughs are the valleys,
who sets the nations and draws their borders,
beloved Ninki,
whose advice is always advisable,
who sets the nations and draws their borders,
whose domain is the earth,
whose plow-furroughs are the valleys,
whose hands build the mountains and topple them,
whose advice is always advisable,
beloved Ninki,
whose domain is the land,
who sets the nations and draws their borders,
[2 ms have: ,
who puts the continents in their places,
whose advice is always advisable,
whose domain is the land,
whose hands build the mountains and topple them,
beloved Ninki,
whose excrement fertilizes the fields,
whose advice is always advisable,
[10 ms have: ,
who puts the continents in their places,
whose plow-furroughs are the valleys
is who is crying. Why should Ninki,
[7 ms have: ,
whose excrement fertilizes the fields,
who sets the nations and draws their borders,
whose advice is always advisable,
whose domain is the land,
beloved Ninki,
who sets the nations and draws their borders,
whose hands build the mountains and topple them,
[15 ms have: ,
whose domain is the earth,
whose advice is always advisable,
whose hands build the mountains and topple them,
whose plow-furroughs are the valleys,
beloved Ninki,
whose excrement fertilizes the fields,
whose advice is always advisable,
who sets the nations and draws their borders,
whose plow-furroughs are the valleys,
[18 ms have: ,
beloved Ninki,
whose domain is the land,
beloved Ninki,
whose domain is the earth,
whose excrement fertilizes the fields,
beloved Ninki,
whose plow-furroughs are the valleys,
whose advice is always advisable,
[10 ms have: ,
whose hands build the mountains and topple them,
beloved Ninki,
whose plow-furroughs are the valleys,
Ninki,
whose domain is the land,
whose plow-furroughs are the valleys,
beloved Ninki,
whose excrement fertilizes the fields,
whose plow-furroughs are the valleys,
[9 ms have: ,
whose hands build the mountains and topple them,
whose domain is the land,
whose excrement fertilizes the fields,
beloved Ninki,
whose hands build the mountains and topple them,
whose advice is always advisable
cry?" Ninki,
whose plow-furroughs are the valleys,
who sets the nations and draws their borders,
whose dung-heaps are the mountains,
whose hands build the mountains and topple them,
whose excrement fertilizes the fields,
beloved Ninki,
whose excrement fertilizes the fields,
whose advice is always advisable,
who puts the continents in their places,
whose excrement fertilizes the fields,
beloved Ninki,
whose hands build the mountains and topple them,
whose advice is always advisable,
whose excrement fertilizes the fields,
whose plow-furroughs are the valleys,
who puts the continents in their places,
whose hands build the mountains and topple them,
whose advice is always advisable,
whose plow-furroughs are the valleys,
whose advice is always advisable,
whose hands build the mountains and topple them,
whose plow-furroughs are the valleys,
who puts the continents in their places,
beloved Ninki,
whose domain is the earth,
[11 ms have: ,
whose excrement fertilizes the fields,
beloved Ninki,
whose plow-furroughs are the valleys,
whose domain is the land,
whose dung-heaps are the mountains,
whose advice is always advisable,
whose domain is the land,
beloved Ninki,
who sets the nations and draws their borders,
whose dung-heaps are the mountains,
beloved Ninki,
whose advice is always advisable,
who puts the continents in their places,
whose plow-furroughs are the valleys,
whose excrement fertilizes the fields,
beloved Ninki,
who puts the continents in their places,
whose dung-heaps are the mountains,
whose advice is always advisable,
whose advice is always advisable
saw that Kien,
whose hands build the mountains and topple them,
whose dung-heaps are the mountains,
whose excrement fertilizes the fields,
whose advice is always advisable
was correct. Ninki,
whose excrement fertilizes the fields,
whose advice is always advisable,
beloved Ninki,
Ninki,
beloved Ninki,
who sets the nations and draws their borders,
whose excrement fertilizes the fields,
[11 ms have: ,
whose plow-furroughs are the valleys
was happy again.

Here is the complete generator, and here is a novel-length output. For actual ancient sumerian texts, see the Electronic Text Corpus of Sumerian Literature (ETCSL).

[1] JuNoGenMo is an unofficial off-season version of NaNoGenMo done in June. Theoretically, it’s for people who will be busy in November. In practice, most JuNoGenMo projects are done by people who already do multiple NaNoGenMo projects every year & get impatient about waiting until November to start.