#!/usr/bin/python """ Polynesian_name.py Random name generator. """ from cgitool import * from random import randint import webbrowser INTRO_TEXT = "The following is a set of notes on a randomly-generated fictional magic system -- that is, a set of beliefs and practices about magic -- designed for a fantasy/science fiction setting such as a story or game. It can be wholly or partly true in the context of that setting, or just help to stimulate further ideas. The words \"mage\" and \"mundane\" refer to anyone who can or can't use magic, respectively; exactly what \"magic\" means is the point of this exercise. This generator program is meant as a reaction to fantasy settings like those of \"Final Fantasy,\" \"Lord of the Rings,\" and old-school \"Dungeons and Dragons,\" and what are now cliched representations of magic. Let's come up with something new and creative for our own work!

\nThe notes below may seem inconsistent, but that's a hint that something's inaccurate about them -- people's beliefs are wrong, or the situation is changing due to new discoveries, or you should re-interpret one comment in light of others.

\nThis program's output is public-domain; use it freely. The program itself is by Kris Schnee." OUTRO_TEXT = """Links:
Seventh Sanctum: A collection of random content generators like this.
World Tree, an RPG with a great setting and detailed magic system.
Ars Magica: An RPG with a detailed magic system, especially re: familiars. A version of it's available for free.
Rym: A detailed fantasy/sci-fi RPG setting, maddeningly incomplete, with an emphasis on magical technology.

Other Suggested Reading:
Steve Jackson Games' "GURPS" books (fictional background on many topics, Religion is an especially good one), Stephen Pinker's "How the Mind Works" (a readable guide to a lot of real mysteries), E.O. Wilson's "Consilience: The Unity of Knowledge" (the universals of human culture), and Carl Sagan's "The Demon-Haunted World: Science As a Candle In the Dark" (re: why people believe the things they do).""" ORIGIN = {"Physics":"Magic is part of the way the universe works, and can be studied scientifically.", "Disruption of physics":"Magic works by selectively breaking physical laws, which might disrupt technology. What would cause this effect to exist?", "God(s)":"One or more powerful supernatural beings outside the universe grant certain people a part of their power to alter reality... but why?", "Spirits":"Supernatural beings within the universe lend their aid to certain people; are these beings intelligent, and what are their motives if so?", } POWER_LEVEL = {"Non-existant":"Magic doesn't really exist! Everything below is a lie, a delusion -- but people believe it anyway! Look at the profusion of magical beliefs in the real world for evidence that this is possible. Even though it's fake, it can have major social effects.", "Barely noticable":"Magic is so subtle that skeptics don't believe it exists at all. The true believers happen to be right in this case.", "Minor":"Magic can be a useful supplement to normal physical effort, eg. reinforcing a wall that's been built with solid mundane engineering.", "Major":"Magic is a big part of how the world works. There may be whole industries that rely on it. If mages themselves are rare, they're probably busy crafting magic items or working on big projects.", "Dominant":"Magic IS the world's technology. It's used for all sorts of common, ordinary tasks: locking doors, cutting wood, fetching water." } WHO_HAS_IT = {"No one":"It's unheard of for anyone to have magic nowadays, but in legends and prophecies there are exceptions... There may also be magical artifacts or creatures that mundane humans can find.", "Few people":"Mages are rare and feared for their power. Governments want mages either working for them, or dead.", "Some people":"Magic is common enough that mages aren't abberations, though they still stand out. They may belong to a particular group or bloodline.", "Many people":"Magic is widespread and commonly studied; many magic-related organizations exist.", "Everyone":"Magic is truly democratic! It's so common that people use it in their daily lives, debate it in politics, and study it in school. Magic may be part of the biology of the people's bodies.", } NONHUMANS = {"Humans only":"For some reason, humans (humanoids) are the only species that uses magic. Is this evidence of the nature of the human soul, or something to do with intelligence or the brain?", "Rare creatures":"A few strange creatures like dragons exist that can use magic.", "Certain species":"Whole species of creatures exist that can use magic, or that even depend on it.", "Many species":"Magic is a major part of biology on this world. Plants, animals etc. evolved to use it and can't live without it. Think of creatures that use spells to support their bodies, to sense their environment, or to reproduce." } HOW_GOTTEN = {"Birthright":"Magic comes with a certain bloodline, ethnicity, or humanoid species. Racism is justified in one sense.", "Training":"Magic requires long, hard study and practice. Those who can train mages have a great deal of influence, and may confuse the necessary skills with superstitious rituals -- or ones that encourage loyalty.", "Worship":"Power comes from the gods or spirits, who must be placated on a regular basis. If someone displeases them, is it possible for the gods/spirits to revoke their gift?", "Random":"Some people can use magic better than others, and it's not clear how or why. Their existence baffles scientists and philosophers, who seek a more satisfying explanation." } FORMALITY = {"Discrete spells":"Magic is divided into standard \"spells\" like \"Fireball,\" with fairly consistent power levels and effects. Inventing new effects is a long, hard process and often worth getting the new spell named after yourself.", "Improvised":"There are distinct, named \"spells,\" but it's possible to combine and modify them in various ways.", "Versatile":"There are standard methods of achieving certain magical effects (\"This is how you create ice...\"), but a good mage can use magic to do any specific thing they can think of, within their power, without having to invent a rigidly-defined recipe for it.", "Chaotic":"Magic seems to vary so much among people, times and places that it's hard to describe or study in a consistent way. Magical instruction focuses on how to find useful patterns in one's own magic." } RITUAL = {"Mental effort":"Using magic can be done with a thought, with little mental or physical effort.", "Words and gestures":"A small physical effort is needed for magic; a mage who can't do some physical thing (stereotypically, talk or move their hands) is hampered.", "Props":"Magic requires having certain objects on hand, such as a staff. These can be stolen or destroyed... or secretly replaced.", "Quick ritual":"Magic requires a short series of actions that makes it obvious the mage is doing something and that can be disrupted, eg. a seconds-long dance or chant or a blatant aura-of-powering-up.", "Long ritual":"Great preparation goes into most magic, with fragile props and lots of opportunity for the mage to be interrupted in various ways. Can a mage step aside and have an assistant fill in during a ritual? What happens if someone wanders into the magic circle?" } MAGIC_AND_TECH = {"Mutual interference":"Magic and technology badly disrupt each other. Bringing a simple good-luck charm near a helicopter would make it crash, and gods help you if you trick a kitsune into approaching a nanotech lab.", "One-way interference":"Magic makes technological devices mysteriously break, or the presence of any complex technology suppresses magic -- but not both. A mage is unlikely to also be a user of much technology.", "Specific suppression":"A particular type of magic plays havoc with machines (the Summon Gremlin spell?), and/or a specific technology (a mana vaccuum?) suppresses magic.", "Compatible":"Magic and technology don't interact much at all; there are no specific magic/tech hybrids.", "Synergy":"The only thing better than a giant robot is an ENCHANTED giant robot. Students study magic with an electronic device known as a Speak 'n Spell." } DRAWBACKS = {"Insanity":"Magic tends to drive its users mad, and the most powerful mages are also the ones who are completely nuts. Not good.", "Damnation":"A mage's very soul is in danger from some types of magic; it may be claimed by evil spirits or drawn into an extradimensional Bad Place.", "Aging":"Magic drains the life of its users, making them age rapidly. They'd very much like to find a way to drain the life of something (or someone) else...", "Death":"Magic is so destructive of life that a single spell often kills the caster. What spell is worth dying for?", "Deformity":"Magic deforms a mage in some minor but characteristic way. Hair loss? Skin markings? A visible aura?", "Transformation":"A mage slowly transforms into an animal or magical creature from contact with magic. This can range from horrifying (if it comes with a mental change, shortened lifespan and big teeth) to amusing or even pleasant (for a partial change into something cool).", "Gender Change":"Magic is tied to masculinity or femininity in such a way that casters of one or both sexes find themselves gender-reversed.", "Silly Curse":"Magic has embarassing and unpredictable side effects, eg. making one's clothes vanish, causing bad breath, or summoning harmless but annoying spirits. Maybe they're pranks by the gods.", "Backlash":"Magic is prone to backfiring, which can mean the mage being hit by their own harmful spells, \"mana burned,\" or having beneficial spells go badly wrong.", "Mental Effects":"Magic doesn't cause madness per se, but affects the user's mind in small ways. Translation spells give the mage an accent (especially awkward after casting Speak With Chipmunks), evil spells fill the mage with horrible nightmares, etc.", "Elemental Aura":"The types of magical energy the mage works with surround them for a while after use. Air mages find papers fluttering around them, life mages find themselves *ahem* eager to start families, and summoners find magical creatures drawn to them unbidden.", "Stigma: Evil":"Everybody knows... Mages work with evil forces and are bad people.", "Stigma: Unclean":"Everybody knows... Magic is a dirty thing that no decent person would touch.", "Stigma: Eccentric":"Everybody knows... Mages are weird, nerdy people. Shouldn't they play sports or something instead?", "Stigma: Damned":"Everybody knows... Mages are going straight to Hell for their wicked lifestyle.", "Stigma: Perverted":"Everybody knows... Mages are perverts. What sick person would manipulate reality the way they do?", "Stigma: Monitored":"Everybody knows... Magic is dangerous, and people who are good with it need to be watched lest they do evil with it.", "Limit: Isolation":"Magic is most powerful when the user is alone.", "Limit: Timing":"Magic can only be done at certain times of the day or year, or during even rarer periods (eclipses, cometary visits...).", "Limit: Geography":"Magic is tied to particular places or types of terrain, such as holy sites or mountaintops.", "Limit: Preparation":"Magic requires extensive preparation, whether in long rituals for particular spells or just general practice needed to maintain skill. The work takes up a substantial part of a mage's time.", "Expensive Ingredients":"Magic requires expensive spell components, drugs, or sacrifices that must be replaced frequently or are hard or illegal to get.", "Difficult Casting Circumstances":"A mage can only work under certain difficult circumstances, such as while in severe pain, while drugged, or while absolutely calm.", "Limit: Morality":"A mage must obey a strict set of personal moral rules or risk temporarily or permanently losing their power. Eg., a vow of vegetarianism or poverty. The rules aren't necessarily what we'd call \"virtuous\"...", "Limit: Number of Spells":"A mage only has access to a limited set of powers at any one time, out of a larger potential set. This may be due to incompatibility of some magic items, mental states, times of year etc..", "Duty":"A mage is often bound to serve some teacher or organization. This isn't necessarily bad, as this master may also provide income, protection and equipment.", "Outlawed Spells":"Some important types of magic are legally off-limits. This may be due to simple fear for public safety (*Cough*Dragon Slave*Cough*) or used to enforce a monopoly on some useful magical effect.", "Blind Spot":"Magic seems to be missing a major type of effect that you'd think it would have; eg. an elemental system without fire magic. There may be workarounds, eg. creating wood plus intense light.", "Mages' Weakness":"All heavy magic users have a particular weakness, such as silver, iron or magical wards.", "Secret":"Certain magical secrets must not be revealed. This may be a mystical taboo, or part of a guild mentality -- the Mages' Protective Association of Arcadia tries to suppress those illegal spell-traders.", "Synecdoche":"Spells require some sort of mystic link to the target, such as a lock of their hair.", "Karma":"The good or evil will put into a spell comes back to the caster in some way, so that destructive spells eventually harm the mage. See eg. Haitian Voudoun.", "Limit: Data":"It's important for a mage to keep certain recorded data handy, the way a Rennaissance navigator needed a book of astronomical measurements and a good clock to calculate latitude.", "Calculation":"Magic requires some difficult mental gymnastics, something like poetic composition or mathematics. Not everyone is good at it.", "Specialties":"Mages tend to have a knack for one specific type of magic and to be fairly poor at others.", "Careful What You Wish For":"Magic is very sensitive to detail; getting a spell even slightly wrong can be disasterous.", "Weather":"Magic affects the local weather, and large-scale magic might even cause climate change -- or at least the anti-magic groups say so.", "Spooky":"Magic spooks nearby mundane animals and maybe even people, giving them a vague sense that something is wrong.", "Mana Level Falling":"The world's level of magical power is declining, forcing people to fake their powers or find workarounds. This event is particularly disruptive if magic is tied to religion.", "Mana Level Rising":"The world's level of magical power is growing, whether due to new discoveries or natural fluctuations. Will people be able to make good use of this new power?", } THEME_VERB = ["Create","Destroy","Control","Perceive","Transform","Heal","Sustain"] THEME_NOUN = ["Elemental: Fire/Water/Earth/Air","Elemental: Water/Fire/Earth/Wood/Metal","Elemental: Space/Time/Matter/Energy","Fire","Water","Earth","Air","Wood","Metal","Space","Time","Matter","Energy","Light","Darkness","Life","Death","Mind","Soul","Flesh","Plant","Fungus","Nature","Machine","Stone","Travel","Communication","Food/Drink","Meta-Magic","Sound/Music","Writing/Art","Summoning","Beast","Spirit","Reversal","Order","Chaos","Ice","Explosion","Sand","Storm","Crystal","Sun","Moon","Star"] GROUP_EFFECTS = {"Total interference":"There's an \"observer effect\" such that magic only works when no one else is looking! Hopefully this applies to the casting itself, and not to the EFFECT of that levitation spell! In a world like ours where magic doesn't exist, this is sometimes used as an excuse for why magic doesn't work when a scientist or skeptic tries to test it.", "Partial interference":"Mages casting spells near each other tend to interfere with each other, maybe due to the local spirits being too busy or ambient mana getting used up. There may be an organization devoted to minimizing this interference -- and incidentally, controlling what kinds of spells have priority.", "Specific numbers":"Specific numbers of people have major effects on spells. Eg., the Great Mage had seven followers, so all the spells he designed require exactly seven assistants to cast.", "Synergistic effects":"Mages are especially powerful when working together.", "Strength in numbers":"A large group of willing, possibly mundane spectators can help a mage. Eg., a priestly mage can draw strength from a crowd of worshippers praying to his god. What happens with UNWILLING participants?", } POWER_STORAGE = {"Impossible":"There's no way known to store magical energy; the concept might even be meaningless.", "People power":"The human body stores a certain amount of magical power. Does it regenerate over time, or is there something else that needs to be done? Can mundane people store energy for mages?", "Ritual items":"Certain objects are natural sources of magic energy or useful as batteries. Mages might be over-dependent on foreign crystals, and threatening to drill for mana in endangered dragon preserves.", "Living things":"Many living things store magical energy in their bodies... but how do you get it out? And does it actually get generated by them, or are they absorbing it from somewhere?" } FAMILIARS = {"Can be created":"Some mages create \"familiars\" out of normal animals or spirits, maybe as assistants or for their own amusement.", "Daemon":"A \"familiar\" is intimately linked to, or created from, a mage's soul. It can probably talk and use magic itself, and is intelligent.", "Necessary":"Using most magic actually requires creating a \"familiar,\" which can have major effects on the magic itself, the market for them, and the mage's personal life.", "Alternative":"Creating a \"familiar\" absorbs or ties up most of a mage's magical potential, making it an alternative to direct spell-casting. Can the familiar use magic itself? Why would a mage choose this route, if it's optional?" } ENCHANTED_ITEMS = {"Temporary":"It's possible to put spells temporarily into/onto physical objects for later use.", "Permanent":"It's common among mages to make permanent enchantments such as a ship that's capable of flight without the mage's further effort.", "Obligatory":"The main way to use magic is to make enchanted items, rather than casting spells directly.", "Mundane only":"Only non-mages can use magic items!" } ORDER = ["Where Magic Comes From", "How Powerful Is It?", "Who Has Magic?", "Nonhumans and Magic", "How Is It Gotten?", "Formality", "Ritual", "Magic and Technology", ] SPECIAL = {"Group Effects":GROUP_EFFECTS, "Power Storage":POWER_STORAGE, "Familiars":FAMILIARS, "Enchanted Items":ENCHANTED_ITEMS } ALL = {"Where Magic Comes From":ORIGIN, "How Powerful Is It?":POWER_LEVEL, "Who Has Magic?":WHO_HAS_IT, "Nonhumans and Magic":NONHUMANS, "How Is It Gotten?":HOW_GOTTEN, "Formality":FORMALITY, "Ritual":RITUAL, "Magic and Technology":MAGIC_AND_TECH } def RandomMagicSystem(): s = {} for key in ALL.keys(): field = ALL[key] n = randint(0,len( field.keys() )-1) chosen_key = field.keys()[n] value = ( chosen_key, field[ chosen_key ] ) s[key] = value ## Drawbacks. drawbacks = [] for n in range(2,4): OK = False while not OK: n = randint(0,len(DRAWBACKS.keys())-1) key = DRAWBACKS.keys()[n] if not key in drawbacks: OK = True drawbacks.append( (key, DRAWBACKS[key]) ) s["drawbacks"] = drawbacks ## Special options. how_many_options = len(SPECIAL.keys()) chosen_option_number = randint(1,int(how_many_options*.5)) chosen_option_keys = [] while len(chosen_option_keys) < chosen_option_number: key = SPECIAL.keys()[ randint(0,how_many_options-1) ] if not key in chosen_option_keys: chosen_option_keys.append(key) options = {} for field_name in chosen_option_keys: field = SPECIAL[field_name] n = randint(0,len(field.keys())-1) key = field.keys()[n] value = field[key] options[field_name] = (key, value) s["options"] = options ## Theme. verbs, nouns = [], [] number_of_verbs = randint(1,3) while len(verbs) < number_of_verbs: v = THEME_VERB[ randint(0,len(THEME_VERB)-1) ] if not v in verbs: verbs.append( v ) number_of_nouns = randint(1,3) while len(nouns) < number_of_nouns: n = THEME_NOUN[ randint(0,len(THEME_NOUN)-1) ] if not n in nouns: nouns.append( n ) s["verbs"] = verbs s["nouns"] = nouns return s def FormatMagicSystem(s): text = INTRO_TEXT+"

\n" raw = "-- Magic System --
" ## Main data goes in a table. text += "The Nature of Magic:\n" text += "
" for key in ORDER: text += "" text += "" text += "\n" raw += s[key][1]+" " text += "
"+key+""+s[key][0]+""+s[key][1]+"

" raw += "

" ## Drawbacks. raw += "Drawbacks of magic: " drawbacks = s["drawbacks"] text += "
The Drawbacks of Magic:
\n" for d in drawbacks: text += "-"+d[0]+": "+d[1]+"
\n" raw += d[1]+" " ## Special options. raw += "

Other notes: " options = s["options"] text += "
Special Aspects of Magic:
\n" for o in options.keys(): value = options[o] text += "-"+o+": "+value[0]+" -- "+value[1]+"
\n" raw += value[1]+" " ## Theme. raw += "

Theme: " verbs, nouns = s["verbs"], s["nouns"] text += "
Theme / Elements of Magic:
These are the main actions and substances that magic works with.
\n" text += verbs[0] raw += verbs[0] for v in verbs[1:]: text += " / "+v raw += " / "+v text += ": "+nouns[0] raw += ": "+nouns[0] if len(nouns) > 1: for n in nouns[1:-1]: text += ", "+n raw += ", "+n text += ", and "+nouns[-1]+"." raw += ", and "+nouns[-1]+"." ## Plain-format notes. text += "


A plainly-formatted version of these notes you can copy elsewhere:"+raw+"
" text += "
"+OUTRO_TEXT+"
" return text text = "
\n" text += "
Magic System:
\n" text += "
\n" ## Random content. s = RandomMagicSystem() text += FormatMagicSystem(s) text += GoBackLink("http://kschnee.xepher.net/generators.htm","Back to Generators Page") #### Use this version to test the program offline. ##webpage = ""+text+"" ##webpage_file = open("magic_system.htm","w") ##webpage_file.write(text) ##webpage_file.close() ##webbrowser.open_new("magic_system.htm") ## Use this version online. MakeWebPage( text,title="Magic System Generator")