Monday, January 21, 2008

Building a Persistent World in NWN (1&2) - The Prefabia Project. Part 1

I find myself at a point in my knowledge of building a NeverWinter Nights (1&2) Persistent World that I can now begin to document my thoughts with confidence that some of them are correct. To set the scene, I have played on several good PW's (Mystara, Chronicles of Torn, Melnibone and Aeon), built a PW with friends, and now currently help maintain and improve two more. A reasonable amount of experience and a lot of it hard earned or discussed with others who have suffered the pain of building.

So without getting caught in pointless verbiage, I thought I might as well list the top best practices that are IMHO the are a must for building a PW, or improving one if it is already running. Notes these are my opinion, not much else really but if they save someone else some grief, then they are worth pontificating about.

1. Have a plan.
This seems rather basic, but most people forget to work out the stages and understand what needs to be done first for a world to begin. A plan lays out the steps needed, highlights holes and gives you a good checklist to work to as you achieve milestones. Not hard, but few do it.
A plan to be really effective needs to have critical milestones, resourcing and due dates. Milesstones are stages in your project, where ytou have achived a solid chunk of work. This could easily be core systems decided on, base module built, beta release. The dates tie into these, without dates your project will slip further and further behindand the energy you may have built up with the community is lost. REsources can be hardware and people, get these organised early on, keep your team small.

2. Have an understanding of what your world is going to be and more importantly what it is not.
What your world is, will ultimately determine what systems you add, disable or modify. Hardcore RP worlds have different requirements to Hardcore PVP.

Additionally you need to have a world story of some sort, this is covered later.

3. Identify Base systems and haks for your world
Best to identify these early and select or build what is needed. My preference is source from another builder than craft myself. If you source off the vault, remember to vote as well. Authors respond to requests and queries much more readily if you vote.

Core systems to consider, prior to creating custom classes etc are;

  • Death

  • XP

  • Crafting

  • Anti-hacking clientonenter scritps

  • Persistant database or not

  • Debug scripts

  • Playtesting widgets -

  • DMFI

  • Spawning creatures and placeables

  • HCR systems

4. Create a base module

Nice and straight forward, you have your base systems identified, add them to your base module and get it up and running. You can spend some time optimising the systems and ensuring that the base is very stable and error free. This step is rather critical, as this base module becomes the reference module for all your builders to base their work on.

5. World Setting

Take your time and explore what you want your world setting to be and locate your references. You have a choice of writing your own from scrath, using one of the existing settings or using the setting that the nwn engine uses, which is Forgotten Realms. Writing your own is rather exhausting but rewarding at the same time, however you need to consider everthing. Using a a pre-existing setting works a treat, and you can pick and choose what you want your world to be from the parts. Finially the easiest is to use the FR setting for simplicity sake. NWN already has all the items built with FR descriptions, creatures and placeable fit the FR setting, so a large chunk of your work is done.

6. Naming Standards
To ensure consistency in your world, from scripts to areas, I would suggest that naming standards are a must. Listed below are various standards from official to what was used on the Aeon project. Use these as a basis for your own, or as is.

Script Naming Standards
Modified CODI


Placable
* T - Trigger
* D - Door
* R - Trap
* C - Conversation
* E - Encounter
* I - Item - This script is not placed on an item per se, but called by module level scripts.
* X - No Object - Use this for a script that is called by other scripts. Executable scripts.

This character is followed by a two character short for the event it goes in, by category:

* N, M
o CO - onConversation
o DI - onDisturbed
o PA - onPhysicalAttacked
o SP - onSpawn
o UD - onUserDefined
o SC - OnSpellCastAt
o BL - onBlocked
o DM - onDamaged
o HB - onHeartbeat
o DE - onDeath
o CR - onCombatRoundEnd
o PE - onPerception
o RE - onRest

* A
o EN - onEnter
o EX - onExit
o HB - onHeartbeat
o UD - onUserDefined

* O
o CE - onClientEnter
o CL - onClientLeave
o PR - onPlayerRest
o RS - onRespawn
o DY - onPlayerDying
o DE - onPlayerDeath
o LE - onPlayerLevelUp
o IA - onItemActivated
o IQ - onItemAquired
o UI - onUnaquireItem
o ML - onModuleLoad
o HB - onHeartBeat
o UD - onUserDefined
o EI - onEquipItem

* P
o US - onUsed
o HB - onHeartBeat
o DE - onDeath
o AT - onAttacked
o SC - onSpellCastAt
o DM - onDamaged
o OP - onOpen
o OC - onClosed
o DI - onDisturbed
o LO - onLocked
o UL - onUnlocked
o UD - onUserDefined

* T
o CL - onClick
o EN - onEnter
o EX - onExit
o HB - onHeartBeat
o UD - onUserDefined

* D
o AT - onAreaTransitionClick
o OC - onClosed
o DM - onDamaged
o DE - onDeath
o FO - onFailedToOpen
o HB - onHeartBeat
o LO - onLocked
o OP - onOpened
o AT - onAttacked
o SC - onSpellCastAt
o UL - onUnlocked
o UD - onUserDefined

* R
o DI - onDisarmed
o TT - onTrapTriggered

* E
o EN - onEnter
o EX - onExit
o OE - onExhausted
o HB - onHeartBeat
o UD - onUserDefined

* C
o AT - Actions Taken
o AP - Appears When (StartingConditional Script)
o AB - onConversation Aborted
o EN - onConversation end

* I
o US - Called when the item is used.
o AQ - Called when the item is Aquired.
o UA - Called when the item is UnAquired.

Prefix examples

Module OnClientEnter script prefix: OCE_
Area OnEnter script prefix: AEN_
Placeable OnUsed prefix: PUS_



Consider this post a living document, which I will add to over time.

Acknowledgements to BarryTheHatchet and Relexx