Building Creatures

From ALFA
Jump to: navigation, search

First, make sure you need to build it! The ALFA Base Resources and ALFA Campaign Folder projects come with many creatures NWN2 has a visual representation for, so in most cases you don't need to build anything. The ALFA Spawn System also includes functions for setting the name of spawned creatures, so there is often times no reason to create a creature on your own. The fewer creatures in your mod, the smaller and less bloated it will be.

Assuming the creature does need to be created, go ahead and do so as you normally would in the toolset. A few things are different in ALFA, however. Most of this just applies to creatures which are statically spawned, but its probably a good read for any builder.


General Guidelines

Creatures are expected to follow canon specifications as closely as the toolset allows. If you must deviate on the basis of game mechanics, play-testing should be used to make sure the altered creature's CR is set properly. Always post any deviations from canon specifications on our NWN2 tech forums so that others may comment or follow them for consistency's sake. When setting clerical domains and alignment, be sure to base things off of the most popular deity for the creature type. When setting spells and equipment, be sure and follow FR's lore and canon if at all possible. Our first priority is game balance, and then following FR lore.


Naming Conventions

The following conventions will need to be used in naming creature blueprints to avoid any conflicts with other blueprints and to ensure that all content works properly with scripts:

Localized Name

Creature names should not be revealed to players in-game, unless a sufficiently unique creature or equipment model does not exist for the creature being created. In such cases, choose a one or two word descriptive name, but be sure you reveal as little of the meta information about the creature as possible. Size based descriptive words are not necessary since creatues can be scaled in NWN2 to properly reflect their size.

Putting creature names inside {} will make them visible only to builders. This will help builders distinguish between multiple blueprints of the same type and convey important reference information at a glance without revealing any of the information to players in the game. Generally, a creatures name or race, social role or class, gender (if applicable), and challenge rating are useful characteristics to record within {}.

'Example: Larger Kobold {Chieftain CR1} or Male Human {Barbarian CR3}

Template, ResRef, and Tag

See also: ResRef, Tag, and Template

The primary purpose of tag and resref naming conventions is to prevent any naming conflicts. A secondary purpose is to describe the creature in some way. All global creature blueprints must begin with the "abr_cr" prefix to designate them as global blueprints. Server specific blueprints should begin with a 3 digit server number in place of the "abr", so "001_cr" for example. For every subcategory, add a two letter acronym delimited with underscores followed lastly by a descriptive name for the creature itself. This helps to quickly locate blueprints when all we have is its resref. To illustrate, here are a few examples:

Example: A global humanoid creature blueprint: abr_cr_hu_koboldchieftain
Example: A server NPC blueprint on server 01: 001_cr_np_zhents_fzoul

Descriptions

A creature's description should be the PHYSICAL description in the creature's sourcebook entry, plus anything important a PC should notice specifically about the creature that isn't obvious by looking at it in-game. It should not flat-out identify what the creature's textbook name is, however.

Good example: "This tall, thin humanoid is defined by sleek, alien features. Its gray skin smells of decay."
Bad example: "A Bodak, looking around for prey."

Comment

To identify and track blueprint versions, it's best to write your name and the date you modified the blueprint in the comments area.

Example: Created By: John Doe, Date Modified: 2006-12-20

For global blueprints, you should also include a link to this wiki page so builders that are unfamiliar with conventions or configuration options can easily find them.


Event Handlers

The default basemod creatures should already have these handlers in place, so if you are copying an existing blueprint, you probably don't need to do anything here. To start off with, make sure the creature's event scripts are all set correctly. The default scripts are:

  • acf_cre_onphysicallyattacked
  • acf_cre_ondamaged
  • acf_cre_ondeath
  • acf_cre_onconversation
  • acf_cre_oninventorydisturbed
  • acf_cre_onendcombatround
  • acf_cre_onheartbeat
  • acf_cre_onblocked
  • acf_cre_onperception
  • acf_cre_onrested
  • acf_cre_onspawnin
  • acf_cre_onspellcastat
  • acf_cre_onuserdefined

Remember the lower-level creatures of a given race are always vastly more numerous than their higher-level bretheren. Make more versions of them, especially the level 1 warriors, with different sorts of appearances and equipment.


Behavior

Behavioral information for each creature should be present on the creature in the form of a non-droppable, non-pickpocketable blank scroll named after the creature or its race/organization. The tag and resref of the item should be abr_it_cd_<description>. Put as much information here as you can stand, but it should all come from canon sources. You'd typically only need one information scroll per race or organization (only one for goblins, one for kobolds, one for Zhentarim, etc.), unless the creature is unique.

Behavior Types

See also: Using Local Variables

If the creature is expected to fight at any point, determining how we expect the creature to behave in a fight is also important. Create a local string on the creature named ACR_CREATURE_BEHAVIOR, and set the value of that string to one of the following values.

  • BEHAVIOR_TYPE_TANK if you wish your creature to move to the front line and try to hold it. In narrow passages, tanks will attempt to clog the passage. In open fields, tanks will fan out to try to keep as many enemies as possible "covered" as evenly as possible.
  • BEHAVIOR_TYPE_FLANK if you wish your creature to actively seek people who are fighting others, and to strike them in melee from behind.
  • BEHAVIOR_TYPE_SHOCK if you wish your creature to run in past the front line with reckless abandon, prioritizing "soft" enemy targets.
  • BEHAVIOR_TYPE_BUFFS if you wish your creature to focus on support magic for allies. Or, opportunistically, healing.
  • BEHAVIOR_TYPE_MEDIC if you wish your creature to focus on healing magic for allies. Or, opportunistically, support magic.
  • BEHAVIOR_TYPE_SKIRMISH if you wish your creature to fight at range until enemies close, and then switching to melee.
  • BEHAVIOR_TYPE_ARCHER if you wish your creature to only fight at range.
  • BEHAVIOR_TYPE_CONTROL if you wish your creature to focus on special powers that alter the battlefield, attempting to use things like grease, entangle, and summon monster to stop enemies from getting around.
  • BEHAVIOR_TYPE_NUKE if you wish your creature to use its strongest magical abilities to repeatedly hit the strongest enemy it can find.
  • BEHAVIOR_TYPE_MINDLESS if your creature is mindless, and fights fearlessly without strategy or concern for personal safety.
  • BEHAVIOR_TYPE_ANIMAL if your creature is an animal, and fights without strategy (but still doesn't want to die).
  • BEHAVIOR_TYPE_COWARD if your creature is a coward, and runs away from conflict.


Equipment

See also: Using Local Variables

A few things should be kept in mind when creating a creature's equipment. The first thing is, what drops? Generally its best if a creature drops all of its non-armor equipment, for realism's sake if nothing else. However, in many cases its best not to drop armor with a creature, especially if that creature is going to be used as a static spawn. Armor is heavy and expensive, so it presents stronger PCs with ways of gaining income while preventing weaker PCs from doing so, creating a wealth gap. Furthermore, its price means it sometimes adds significantly to the wealth of a spawns drop, possibly making the spawn drop more wealth than it should. Also, its rather logical that killing a creature will damage its armor reasonably often. Finally, removing armor from a corpse would be a time-consuming afair, and carrying it would not be easy. This would not be something done often (unless the armor is especially valuable or magical, which it shouldn't be anyway in the case of a static spawn).

Now, about spawn drops. The good news is in most circumstances, you don't have to add loot to a creature for static spawns! If the value of the equipment the creature uses is reasonable, you probably don't have to think about loot at all. Loot is created automatically with scripts, based on many variables in an attempt to match up believable loot (if any) to your creature. The value of the loot is based off of the value of the creature's dropped equipment and its CR, so setting the CR correctly is vital. If the creature is a static spawn, please try to use this built-in loot system unless there is very good reason not to. If a spawn does not use this loot system, it may need to be updated if ALFA's wealth standards for static spawns change in the future.

To disable the loot system, set the ACR_LOOT_DISABLE local integer variable on the creature to a value of 1. If you want to modify the amount of loot droped, set the ACR_LOOT_CR_MOD local float variable to the desired value. This alters the creature's CR for the purposes of calculating loot drops (whether it is positive or negative). Setting it to 1.0 would produce loot as if the creature had a CR of 1 higher than it does, and setting it to -1.0 would produce the opposite effect, loot as if the creature was 1 CR point lower.

Always set "Leave Lootable Corpse" to true, and "No Permanent Death" to true. Set the corpse decay time to 7200000.

Note that regardless of these settings, all creatures always drop the items in their inventory which are flagged droppable. The loot system never actually removes items from any creature.

Note that if the amount of wealth a creature drops (as set by the builder) exceeds the amount a static spawn of its CR should drop, a warning is printed out in the server's log file. Naturally if the creature isn't a static spawn, this can be ignored.


Challenge Rating

See also: Challenge Rating

Also known as "CR", this is vital. Fortunately NWN2 usually gets a creature's CR close to what it should be on its own. Sometimes it doesn't however, so be sure to understand the concept of CR before proceding further.

A creature's of a certain CR should roughly be as powerful as other creatures of the same CR included in ALFA's base creatures. Even if the creature is not spawned statically, the CR must be set correctly for DMs to be able to tell its relatively balance in a fight, and for XP to be awarded properly. If the creature is spawned statically, its loot will be generated based on its CR. If you don't think you know what a creatures CR should be, do some testing for yourself, or ask someone! A good way to test is to use some of your PCs (either controlled by their players or by yourself with their character files locally on your machine).

Do NOT lower a creatures CR because you want to prevent farming abuse, or to lower a PC's rewards for slaying it. If PCs are gaining too much from a spawn of some sort which has its CR set correctly, the problem is in the way the spawn is set up and not the creature itself. Artificially lowered CRs are not only a good way to under-reward PCs for risking their lives, but sometimes lead to accidental PC deaths if the DM spawning the creatures doesn't know the true strength of the creature (until his PCs are face down in their own blood).


Perception Range

If the creature's perception range is less than the PC's (ie less than "long") by any meaningful margin, the exploitability of the spawn increases dramatically. For this reason, its generally best to set a creature's percept range to "long". The "long" range has been adjusted to be slightly less than a PC's, allowing the PC to react to the monster without the computer having an advantage in reaction time.


Custom Scripting

Most people can skip this. If you're not using the standard AI scripts ALFA uses on creatures, you'll need to make sure you include ALFA's code into your scripts. You do this by including the file acr_cre_events_i.nss, and calling a different function for each event type. These functions are:

  • ACR_OnCreatureSpawn()
  • ACR_OnCreatureSpellCastAt()
  • ACR_OnCreaturePhysicalAttacked()
  • ACR_OnCreatureDamaged()
  • ACR_OnCreatureDeath()
  • ACR_OnCreatureBlockedByDoor()
  • ACR_OnCreatureCombatRoundEnd()
  • ACR_OnCreatureConversation()
  • ACR_OnCreatureDisturbed()
  • ACR_OnCreatureHeartBeat()
  • ACR_OnCreatureRested()
  • ACR_OnCreaturePerception()
  • ACR_OnCreatureUserDefined()

Its absolutely vital to the functioning of ALFA that these scripts are called on each of their events! So make sure they are in there.

Configuration Options

See also: Using Local Variables

These are the additional configuration options allowed by the ACR. They are edited by changing local variables on the creature's blueprint.

  • ACR_LOOT_DISABLE (integer) If set to a nonzero value, the creature is not given any loot drops by the loot system at all. If unset, it is.
  • ACR_LOOT_CR_MOD (float) This value modifies the creatures CR for the purposes of calculating the amount of loot dropped. If positive, it adds to the CR and increases the value of the loot dropped. If negative, it subtracts from the CR.
  • ACR_CRE_RANDOM_ABILITIES (integer) If set to a nonzero value, the creature is spawned with randomized ability scores. The blueprint is treated as the "average" for the resulting scores.
  • ACR_CRE_RANDOM_ALIGNMENT (integer) If set to a nonzero value, the creature is spawned with randomized alignment. The blueprint is treated as the "average" for this, and alignment will never differ from the blueprint by more than one step.
  • ACR_CRE_ISUNDEAD (integer) If set to a nonzero value, this creature will be considered undead for all scripting purposes. It will still need undead creature properties assigned.
  • ACR_CRE_SPAWN_DAMAGED (integer) If set to a nonzero value, the creature will not heal to full health upon spawn-in. This variable allows you to equip your monsters with creature items/equipment that provides health bonuses without them spawning harmed.
  • ACR_CREATURE_AQUATIC (integer) If set to a nonzero value, the creature will be able to breath in or out of water, and be made to assume that its land speed is also its swim speed

These options are available in NWN2 by default:

  • X2_SPECIAL_COMBAT_AI_SCRIPT (string) See the "x2_ai_demo" module for details.
  • X2_SPELL_RANDOM (integer) Setting this variable on a spellcaster creature will make its spelluse a bit more random, but their spell selection may not always be appropriate to the situation anymore.
  • X2_L_SPAWN_USE_STEALTH (integer) Set to 1 to make the creature activate stealth mode after spawn.
  • X2_L_SPAWN_USE_SEARCH (integer) Set to 1 to make the creature activate detect mode after spawn.
  • X2_L_SPAWN_USE_AMBIENT (integer) Set to 1 to make the creature play mobile ambient animations after spawn. Use this if you want your creature to roam around the area attempting to use other objects. This simulates random movement.
  • X2_L_SPAWN_USE_AMBIENT_IMMOBILE (integer) Set to 1 to make the creature play immobile ambient animations after spawn.
  • X1_L_IMMUNE_TO_DISPEL (integer) Set to 1 to make the creature immune to dispel magic.
  • X2_L_IS_INCORPOREAL (integer) Set this variable to 1 on a creature to make it walk through other creatures.
  • X2_L_NUMBER_OF_ATTACKS (integer) Set this variable to 1 - 6 to override the number of attacks a creature has based on its BAB.
  • X2_L_BEH_MAGIC (integer) The value of this variable is added to the chance that a creature will use magic in combat. Set to 100 for always, 0 for never.
  • X2_L_BEH_OFFENSE (integer) The higher value of this variable, the higher the chance that the creature will use offensive abilities in combat. Set to 0 to make them flee.
  • X2_L_BEH_COMPASSION (integer) The higher value of this variable, the higher the chance that the creature will aid friendly creatures in combat.


Other Considerations

  • Set the creature's CR accurately.
  • Unless there is a very good reason to, don't create static spawns with "save or die" spells or abilities. The most obvious of these are instant death spells or petrifications, but holdings, sleep spells, fear and confusion often qualify as well. ALFA has much slower advancement than the d20 rules were meant for, and with a 5% chance to fail any saving throw, "save or die" abilities can too-easily kill even powerful PCs with weak creatures.
  • The above isn't so critical if static spawns with "save or die" abilities are avoidable. For example, basilisks can turn a creature to stone with a failed fort save. But they are also slow, lazy creatures, so often times anyone approaching within range of the basilisk's petrification attack is asking for it, and deserves no mercy.
  • Unless there is good reason to, try not to make creatures who's power deviates too significantly from creatures of the same type in ALFA's standard pallet. Not only does this harm the believability and immersion in the world, but it causes some disgruntled PC deaths ("looked like a normal Kobold to me, but it had an Attack Bonus of +12?").
  • If you do make creatures with a significantly different power level from others of their type, make sure they have some visual difference from their kin so as to not surprise that party of PC1s with those nasty +12 AB kobolds.
  • If you make a Fey, Elemental or Incoporeal Undead Creature, Check the 'Spirit Override' box in the properties tab. This allows the 'Chastise Spirits' ability to function properly.
  • If you are making a creature that uses a vfx solely to show what it is like a Willowisp, use the Willowwisp appearance and set the vfx accordingly. Do not use the Invisible Man appearance as it will not render the vfx ingame.
  • If you are making a creature that is just armor or held weapons, use the invisible man appearance and equip the items you wish to have seen.
  • Did I mention the CR must be set correctly?
  • When in doubt, play test your creations! Its really all about play balance, and keeping the ALFA experience as consistent as possible between all our different builders with their own assumptions about how to build.

See Also

  • Video Tutorial: Recorded live stream Q&A and creature creation process.