©Andrew Yinger, 2004-2009
Table of ContentsTable of Contents
GURPS® NPC Generator is a tool, or game aid -- typically used by a Game Master -- for quickly generating NPCs (Non-Player Characters) for the GURPS® role-playing system. It can be used create NPCs of varying power for many different genres. The NPC Generator closely follows the GURPS® rules for creating all character types and their attributes -- including their appearance, gender, nationality, stats, skills, advantages, disadvantages, spells, psi powers, and martial arts maneuvers ... even their weapons and armor.
GURPS® NPC Generator is Freeware, which means that you can use it and freely distribute it as you like. If you use the tool frequently and are over-burdened by a nagging sense of morality, feel free to send the author (that's me) a nominal fee of like, oh, 5 or 10 dollars of your hard-earned money. You may contact me at:email@example.com, where I will provide you with a mailing address; it is at this stage that I will forge the cornerstone of a major financial empire.
Purpose and General Philosophy
GURPS® NPC Generator is intended to be used to quickly generate random NPC types of varying power. It is not a player-character generation tool. It is solely intended for the creation of Non-Player Characters. The NPCs generated tend to be realistically balanced and reality-checked (which means, for example, that you will not wind up with an NPC that is a giant, blind, ambidextrous, disease-immune, hemophiliac hermaphrodite dwarf with epilepsy and one arm). Also, one is not able to precisely constrain the point value of a generated NPC. That being said, there is a facility for generating NPCs of varying relative power (see Running the Program). The idea is that the NPCs one may encounter in an adventure are highly variable, their skills and abilities somewhat randomly distributed. In the real world, just because I happen to be a 253 point character, the point value of every NPC or group of NPCs that I may meet will not always conveniently add up to an equal 253 points.
Clearly, the program was conceived and heavily influenced by my biases as a GM. If the players randomly meet a total freaking bad-ass German SS Officer and choose to do battle with him, well then, they asked for it. Nevertheless, given the ability to constrain the relative power level of a given NPC type, it is quite simple to generate NPCs that are well-balanced and fit the genre at hand. ...And, yes, I did originally write the program as a game aid for a campaign set in an exotic WWII genre in the western theatre.
For the online version: click here.
For the windows version: download and unzip the archive into a directory of your choice, and then run
The compiled binary will run on any win32 platform (e.g., Windows 98, NT, 2000, XP, etc.). It has been most extensively tested on Windows 2000. Python source is also available that will allow the tool to run on most Linux and even some Macintosh systems. Contact the author for more info on obtaining the cross-platform source firstname.lastname@example.org.
Running the Program
The NPC Generator uses a standard GUI toolbar to control most of its functionality. Many functions can also be accessed via the File and Action Menus, and have short-cut keys.
Simple procedure to generate an NPC:
To save an NPC to an html/text file, press 'CTRL-S' or click the SaveAs button next to the NPC Type drop-down menu.
To save an NPC to a centralized, remote server (so it can be browsed by the NPCGenBrowser), click the Save to DB button to the right of the SaveAs button.
Command Line Mode
The NPC Generator can also be run in Command Line Mode, its output redirected to a text file.
Usage: NPCGen.exe (alias|*genre a1) [# of npcs] (a2) [n2] (a3...) [n3...] > [filename]
Example: NPCGen.exe as 1 > asoldier.txt
Example: NPCGen.exe *fantasy 100 > fantasy-town.txt
Example: NPCGen.exe pb > kick-ass-npc.txt
Example: NPCGen.exe ss 5 sso 2 > ss-squad.txt
Note that for technical reasons beyond the scope of this discussion (read: installer bug) Command Line output will not appear in a command prompt or terminal window if the stand-alone binary is being used. Therefore, be sure to redirect output to a text file where it can be captured.
Also note that you will need to know the 'alias' of the character type you wish to generate in command-line mode:
Tools and GURPS® Source Books used
GURPS® NPC Generator is written in python (www.python.org) and the GUI front-end is written in wxPython (www.wxpython.org), both open-source and both freely available. The stand-alone binary was compiled using McMillan's Python Installer, freely available at http://www.mcmillan-inc.com/install5_ann.html. The character name files were painstakingly compiled from several sources, most notably from Kate Monk's Onomastikon: http://www.gaminggeeks.org/Resources/KateMonk.
The base-line rules for creating NPCs were developed following those described in GURPS® Basic. Additional rules (e.g., for languages, strength, hit-points, and so on) were taken from GURPS® Compendiums I and II. Fantasy rules were developed using several books: GURPS® Fantasy, GURPS® Undead, GURPS® Magic, and GURPS® Wizards. Martial arts rules were developed using mainly non-cinematic rules from GURPS martial arts. Rules for the more modern genres are based upon those found in GURPS® High Tech, GURPS® WWII, GURPS® Cyberpunk, GURPS® Cabal, GURPS® Voodoo, and GURPS® Psionics. Conspicuously absent is GURPS® Supers, which I hate. Note that many more rules, skills, items, advantages, and disadvantages may be added to the xml data files that come with the program, as the mechanics of NPC Generator are completely data-driven (more on this below).
Contacting The Author
You may contact me email@example.com. Please notify me of any bugs that need to be fixed or additional features and rules you would like to see.
How it All Works
GURPS® NPC Generator is completely (ok, mostly) data-driven, which means that every rule, every character class, type, attribute, weapon and armor and so on can all be found in xml files, typically stored in[installed-directory]/class-data. The XML is extensively cross-referenced, which means that if you want to add a new weapon, for example, to a given character type, you would have to create that weapon in the weapons data file (weapons.xml), and then reference the new weapon in the new NPC type's template data file (say, new-NPCs.xml). More on new NPC template creation can be found below.
Every NPC that is created is automatically given a random first and last name that is appropriate for his or her gender and nationality. Most NPCs simply receive a static first and last name that can be found in a flat text file, typically located in[installed-directory]/names-data. Again, the flat file that is used depends upon the character's sex and nationality. A nationality to gender name map can be found in [installed-directory]/cfg/meta-config.xml. A typical xml entry, or map, for a single nationality looks like so: <half-orc gender="male" type="last" path-infix="names-data" file-paths="English-last.txt, Germanic-last.txt"/>
Note that some name parts can come from one of multiple files (they are comma-delimited in the xml). Non-static, or so-called 'exotic' names are generated using a custom-built exotic name generator (originally intended for creating Yithogu NPCs).
Every NPC that is generated is given a somewhat unique set of appearance characteristics, such as height and weight, hair and eye color. Height and weight for a given character is initially based on his or her strength (as per the rules in GURPS® Basic) and then randomized somewhat. If the character has a certain attribute (such as the dwarfism disadvantage) that would further modify these characteristics, then this is also considered (again, as per GURPS® Basic rules). As of this writing, the following disadvantages will modify a character's proportions: Gigantism, dwarfism, stocky, skinny, fat, and overweight. Also, all female characters are (on average) four inches shorter.
Hair and eye color possibilities are standardized for most NPCs, but can be overridden in a given NPC type's template file (more on this below).
Stats and Attributes
After an NPC's stats (i.e., dexterity, intelligence, health, and strength) are randomly determined (constrained by ranges defined in the NPC type's template file), his or her attributes are then based-off of these. So, for example, a character with a 15 intelligence is likely to have a will of around 15, but not necessarily precisely 15. Attribute deviations may also be constrained in the NPC template data files. Move and speed are initially based upon the character's (DEX + HT) / 4, but may then vary slightly after that -- again, depending upon the range constraints in the template data file.
Advantages and Disadvantages
An NPC's list of advantages and disadvantages is somewhat randomly determined from a master list based on several factors. The number of advantages and disadvantages is constrained in the appropriate template data file. An NPC may also always receive or always be excluded from a given advantage or disadvantage. So a Dwarf Fighter, for example, always has two-levels of the 'stocky' disadvantage. Also, most NPC's have a certain percentage chance of acquiring rare advantages (e.g., eidetic memory) and disadvantages (e.g., epilepsy). Furthermore, many advantage-disadvantage, or disadvantage-disadvantage pairs are mutually exclusive. So a character who is fat may never be skinny, for instance. Advantage and Disadvantage exclusion rules are defined in the[installation-directory]/class-data/attribute-rules.xml file (see below).
Skills and Prerequisite Skills
As per GURPS® rules, skill values are initially derived from an appropriate stat (e.g., acting is based on Intelligence) and is usually further adjusted according to two factors: how difficult the skill is, and, any range constraints for the skill of the NPC's class type. Furthermore, all skill levels are automatically adjusted if the NPC has a relevant advantage or disadvantage. So, for instance, an NPC with animal-empathy will automatically get a +4 bonus applied to his or her animal-handling and riding skills. Also, some skills have prerequisite powers, abilities and even other skills (most notably, spell skills). All of this is handled automatically by the NPC Generator, which determines the appropriate set of prerequisite skills or maneuvers from the[installation-directory]/class-data/attribute-rules.xml file.
Any data that may be needed if the NPC is to engage in combat -- let's face it, the most likely use for a randomly generated NPC -- is succinctly summarized for each NPC. Unencumbered dodge (Note: as of this edit, encumbrance is now taken into account), the NPC's best possible parry, and their base skin damage-resistance (DR) is tabulated for defense. Their basic thrust and swing damage, as well as their punching and kicking damage (all applicable skill bonuses applied) is also determined. And, yes, advantages like combat-reflexes, enhanced-dodge, and enhanced-parry are all taken into account. (And, no, the running skill min-max hack is not used to optimize the character's move score so that he or she may have a better dodge. If you don't know what I am talking about, don't worry about it.)
An Example: the super-Kobold generated above, has the following combat stats:COMBAT --------------------------------------------------------------------------
Note that the NPC's best unarmed parry skill is used to determine parry. Also note that the hyper-reflexes advantage does not always apply to the NPC's dodge score, and is therefore not added by default.
Weapons, Armor, and Other Goodies
Ah, my favorite part about generating random NPCs. First off, an NPC may only have a weapon for which he or she is skilled in (as determined for each weapon in the[installation-directory]/class-data/weapons.xml file). Also, an NPC's possible set of weapons and armor is usually constrained according to his or her class. So, our friend the Kobold, will only get weapons that he or she can handle -- typically light weapons such as short-swords, short-bows, and half-spears. Again, all of this is completely data driven and utterly configurable. All weapon damage is automatically calculated based on strength.
Armor is pretty straight forward. Armor PD and DR applies to the body part that is covered. Weight is listed and is automatically used to determine encumbrance level. (Note: weapon weight is also used to determine encumbrance, but not displayed.)
Magic and Exotic Items
Every NPC has a small percentage chance of acquiring a unique or magical item. This chance is determined by: the type of weapon or armor, the power level of the NPC being generated, and, well, randomness. The characteristics of weapon and armor modifications are carefully constrained by tech level (so, you will not find a German SS Officer sporting a 9mm Luger with a laser sight!). The Kobold's goodies provide a good low-tech example:WEAPONS -------------------------------------------------------------------------
Many of the unique item descriptions are magical abilities straight out of GURPS® Magic. Others are not so obvious. Typically, an ability value is either a special bonus or limits the number of times a day the NPC can use the ability (GM's discretion). Note that any weapon or armor stats that are always affected by a special ability have that ability score modified accordingly and marked with an asterisk, or '*'. In any case, I will give you my interpretation of the Kobold's cool items above. His Knife is a heart-seeker, which means any hit to the vitals automatically hits the heart (always on). It also does +3 damage against any Orc (orc-bane: 3, always on) and doubles any initiative bonuses the Kobold may have (while the weapon is being wielded, of course). The Amulet gives the Kobold the mobility ability (which just means he is effectively immune to the effects of entangling spells, always on). Also, he can invoke the amulet (by spending the requisite fatigue) to block a hand-weapon attack (as per the iron-arm spell) three times a day. In general, the skill of a special ability (where relevant, such as with the iron-arm ability) is 15. These are just rough guidelines. Again, GM's discretion always rules.
How to Build a Custom NPC Template
One of the coolest things that a GM can use this tool for is to create their own custom character templates for generating NPCs. As mentioned several times above, all NPC class type data is ultimately stored in flat XML data files (usually in theclass-data directory, although this too is configurable). If you are new to XML, you may want to check out: http://www.w3.org/XML.
Working with meta-config.xml
The only hard-coded data file name in the system ismeta-config.xml, located in [installation-directory]/cfg. This is the master data file that tells GURPS® NPC Generator where to find all other data files, including the files used for all NPC or class templates, rules, weapons, armor, and generating random character names, as described above.
As of this writing, the following class files are defined in meta-config.xml (Note: need to update this.):<class-file-sets>
Note that currently all class files are stored under a single class-file-set, or list -- that way they can all share the same subdirectory, or 'path-infix', which happens to beclass-data. To add a new custom NPC template, it is recommended that you do so in a new class data file and then add a reference to the new file in this list.
Choosing a Parent Template
The first thing to decide when creating a new NPC template, or xml class, is which parent(s) it will inherit all of its default values from. Usually, it is best to inherit from "Normal Person" (alias: np) which can be found at the top ofstandard-classes.xml. Ultimately, all NPC classes should point back to this base class in their inheritance tree, as all basic skills, advantages and disadvantages are defined here. Incidentally, a convenient way of deciding on a good class parent is by browsing the inheritance tree (by clicking on the right-most button in the NPC Generator tool bar):
As the example above shows, the Dwarf Barbarian NPC template, or class type, directly inherits from Barbarian - Abstract, and Dwarf (in that order -- note that multiple inheritance is supported, more on that below). This was achieved by entering the appropriate class aliases asparents in the following line of xml (which can be found in standard-fantasy.xml):
<class alias="dbrb" parents="brba, dwarf" name="Dwarf Barbarian" nationality="Dwarf" item-mod-inc="1" gender-ratio="76">
A Note on Multiple Inheritance (Note: need to update this. We now use Breadth-First Search.)
What happens if the same sort of attribute is described in more than one of a class's parents? In the above example, both the 'Barbarian - Abstract' and the 'Dwarf' parent classes describe the axe-mace skill and its appropriate range of values. Which set of data takes precedence? The rule here is: depth-first search. The class template parser first looks for the values found in the class template itself (so, the axe-mace skill data inherited from a parent could be overridden here -- which, as it turns out, is in fact the case for the Dwarf Barbarian class), then in the first parent listed, and then in that parent's first parent (the 'grand parent') and so on, until the data -- in this case -- for the axe-mace skill is found. Needless to say, multiple inheritance can be a bit dicey, which is why the NPC generator has the ability to understand so-called 'abstract' classes -- or, classes that are intended solely to hold parent data, and not to stand alone as classes in their own right. In the tree listed above, an abstract class is denoted with a . (Note: to create your own abstract class, use the syntax 'abstract=1' in the class definition header.) For a good example of judicious use of multiple inheritance, see the 'Demigod' template in the exotic-classes.xml file.
Customizing Nationality, Gender and Appearance
Let's look at the initial line of xml that describes a Demigod template:
<class alias="demi" parents="knta, bwiz, pld, necroa" name="Demigod" nationality="exotic" item-mod-inc="94" gender-ratio="58" eyes="golden, white, silver, ruby, jade, sapphire, black">
This class'snationality is defined as 'exotic', a special reserved nationality which uses a custom exotic name generator. Remember, nationality is part of what determines the set of names that your NPC gets to choose from. Also used to determine name is gender; here the 'gender-ratio' is defined as 58, which means that 58% of the Demigod NPC's created will be male.
Finally, both thehair and eyes key words can be used to override default hair and eye color. Note that any such trait must be followed by a list of comma-delimited (", " -- don't forget the space) words.
(Incidentally, 'item-mod-inc' is the increase in chance for the NPC's weapons and armor to be unique or magical ... Demigod's have a 94% increase in chance to receive magic weapons and armor. Each weapon and armor item itself has a 'mod' key, which is added to a class's item-mod-inc value to determine the item's chance for uniqueness -- more on this below.)
Defining Stat and Attributes Ranges: An Intro to Min, Max, and Mode
Defining the range of stat and other attribute values is relatively easy. Here is another example from the Demigod template:<stats>
We want our Demigods to be very powerful, so we constrain the stat (e.g., strength) value ranges using the 'min' and 'max' key words. But what if we want some attribute value or values to be more likely than others? That is where the 'mode' key word comes in. Using mode, we can in effect create a random distribution with a nice bell curve. From the above example, a Demigod can have strength score that ranges from 10 to 26, but is more likely to receive a strength score of 17, 18 or 19.
One can also use the min, max and mode key words to define the number of certain attributes (such as skills, advantages, disadvantages, weapons and armor) that an NPC can receive. Again from the Demigod template:
<armor min="1" max="2"/>
This means that the Demigod will receive from 1 to 2 armor items. (Note that in this example, the actual armor the Demigod may receive is inherited from its parent classes.)
Defining Attributes Using the 'req' key word
For other attributes, you can define the likelihood that an NPC will acquire the trait or attribute. (Note that this cannot be done with stats, as all NPCs have all stats!)
For example, if we want every Demigod to be attractive, we add this requirement to the 'advantages' section of the template:
<attractive min="2" max="4" req="1"/>
Here, 'req="1"' means that every Demigod NPC will be attractive, to some degree. You can also define the percentage likelihood using the 'req' key word: for instance, 'req="33.33"' means that there is a 33.33% chance that an NPC will acquire a given characteristic. 'req="-1"' means that the NPC may never have a given trait. (Note: if you want there to be a 1 percent chance, be sure to prefix the 1 with a zero, like so: 'req="01".)
Creating New Skills
As been mentioned above, all the rules followed by the NPC Generator are data-driven, all defined in XML (with very few exceptions). Therefore, if you want to add a new skill that NPC Generator doesn't yet know about, you will need to add it to theattribute-rules.xml file and then cross-reference it in your new class template.
For example, let's say we want to invent a new language skill for our Demigods. First, we add an entry to the rules file, so NPC Generator knows how the new skill works:
<language-celestial prereqs="awareness:1~2" stat="language-talent, eidetic-memory, intelligence" min="-7"/>
The above example introduces several new concepts. Reading from left to right, we see first the name of the new skill is the XML tag, in this case 'language-celestial'. Then, we add prerequisite skills or advantages (if any). Here, we have decided that anyone who knows the celestial language must have one or two ranks in the awareness advantage: prereqs="awareness:1~2". (Note that attribute ranges in the rules file are delineated with a '~', or tilde, character.) Finally, we add all of the 'stat's (in this case, advantages and disadvantages) that may affect this skill. Since this new skill is a language, this is pretty straight forward: stat="language-talent, eidetic-memory, intelligence". Oh, I almost forgot. The celestial language is super hard to learn, so we define a very low minimum for the skill, -7. (Note that we do not define the maximum; that is done in the class template.)
Now that we have created a new skill, we can reference it in the Demigod template, under the skills section:
<language-celestial min="-2" max="2" req="1"/>
In this case, we make the skill required ('req="1"') and constrain the values to range from --2 to 2.
Creating New Weapons or Armor
Creating a new item, such as a new weapon or piece of armor works very similarly. In the appropriate XML file, you need to first define the new item. Here is an example of a new piece of armor (in thearmor.xml file) that an NPC may receive:
<mcshirt name="Mithril Chain Shirt" mod="7" pd="3" dr="4" area="torso" weight="10lbs" req-mods="lightened, high-quality"/>
In the above example, we have created a "Mithril Chain Shirt", with a short name (to be referenced in the class template file) of 'mcshirt'. mod="7" means that there is an additional 7 percent chance that these items will be magical or unique in some way. We can also ensure that a given item will always receive some magical or special abilities: req-mods="lightened, high-quality" means that a Mithril Chain Shirt will always be lightened and of high-quality. (Note that these special abilities are defined that the end of the armor.xml and weapons.xml files.)
To add this item to a new template, all we have to do now is reference its short name, or 'mcshirt'.