NPC Behavior Data Structures

From PSwiki
Jump to navigation Jump to search

Where the information is located

Database

NPCs

sc_npc_definitions

This table associates a specific behavior with an NPC, In the npctype column you have the same name you find in the npcbehave.xml

Sc_npc_definitionsTable

Points on the map

The world will have a number of waypoints each of the waypoints will be connected with paths. The waypoints are used to navigate on a large scale. E.g. when a NPC is going from home to work it will calculate the route of waypoint to travel to do this. It will use local navigation to get to the closes waypoint. Than the npc will travel using the paths connecting the waypoints. Each path connecting waypoints consist of a number of predefined points, called path points.

Locations
waypoints

Adobe SVG Viewer plugin (for Internet Explorer) or use Firefox, Opera or Safari instead.


tribes

  • tribe_needs
  • tribe_members
  • sc_tribe_resources
  • sc_tribe_memories

Server files (Deprecated)

All information regarding tribes has now been moved into the DB.

npcbehave.xml

data/npcbehave.xml : contains the behaviour types <npctype>

This file contains:

  • NPC Types : defines one type of NPC for example "wanderer", it's a collection of behaviors and reactions to events. Read this page for info: NPC Types
  • Behavior : is a series of operations the NPC will have to perform. Can be a base behaviour like "walk" or a custom one like "thorian_go_to_work". This page Behavior_Operations lists all operations you can use inside a behaviour.
  • Reactions: each NPC can react to an event and trigger a Behaviour. You can read here for more infromation :Behaviors_and_Reactions
  • Timings: we call timings the reactions to time. Like thorian going home at 8 pm.

npcdefs.xml

data/npcdefs.xml : contains definitions for <locations> , <paths> , <waypoints>

This file is deprecated as definition file. All the data has been moved to the DB.