NPC Behavior Data Structures: Difference between revisions

From PSwiki
Jump to navigation Jump to search
Magodra (talk | contribs)
 
(22 intermediate revisions by 2 users not shown)
Line 1: Line 1:
== Where the information is located ==
== Where the information is located ==


===Server files===
===Database===


==== npcbehave.xml ====
====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=====


data/npcbehave.xml : contains the behaviour types <npctype>
* [[Sc_locationsTable]]
* [[Sc_location_typeTable]]


This file contains:
===== waypoints =====
<uml>
Object sc_waypoints {
  int id
  string name
  string wp_group
  x,y,z,loc_sector_id
  float radius
  string flags
}
Object sc_waypoint_links {
  int id
  string name
  type
  int wp1
  int wp2
  string flags
}
Object sc_path_points {
  int id
  int path_id
  int prev_point
  x,y,z,loc_sector_id
}
Object sc_waypoint_alias {
  int id
  int wp_id
  string alias
}
sc_waypoint_links "1..N" --* "1" sc_waypoints : wp1 = id
sc_waypoint_links "1..N" --* "1" sc_waypoints : wp2 = id
sc_path_points "0..N" --* "1" sc_waypoint_links : path_id = id;
sc_waypoint_alias "0..N" --* "1" sc_waypoints : wp_id = id
</uml>


* '''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 (Deprecated) ====
* [[Sc_waypointsTable]]
* [[Sc_waypoint_linksTable]]
* [[Sc_path_pointsTable]]


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


This file is deprecated as definition file. All the data has been moved to the DB.
* [[TribesTable]]


===Database tables===
* tribe_needs


==== sc_location_type ====
* tribe_members


* sc_tribe_resources


* sc_tribe_memories


==== sc_locations ====
===Server files (Deprecated)===


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


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


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


{|
This file contains:
!Field
!type
!Description
|-
|id
|int
|The ID of the tribe.
|-
|name
|string
|The name of the tribe.
|-
|home_sector_id
|int
|The ID of the sector where the tribe home is located
|-
|home_x
|float
|X-coordinate of the tribe home location
|-
|home_y
|float
|Y-coordinate of the tribe home location
|-
|home_z
|float
|Z-coordinate of the tribe home location
|-
|home_radius
|float
|The radius of the tribe home
|-
|max_size
|int
|The maximum number of tribe memers allowed for this tribe.
|-
|wealth_resource_name
|string
|Name of the resource this tribe treasures most. Collecting this will enable growth capability in the tribe.
|-
|wealth_resource_nick
|string
|Commands like dig use the nick of the resource instead of the name.
|-
|wealth_resource_area
|string
|The name of the Location Type that represents location where the wealth resource might be found.
|-
|wealth_gather_need
|string
|The name of the tribe need that will enable collection of wealth resources. Made the primary need when the tribe has dead members.
|-
|wealth_resource_growth
|float
|When there are no members of the tribe we need a push of resources at this rate to enable reproduction.
|-
|reproduction_cost
|int
|The cost to reproduce.
|}
==== tribe_needs ====


==== tribe_members ====
* '''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.


==== sc_tribe_resources ====
==== npcdefs.xml ====


==== sc_tribe_memories ====
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.


[[Category:Engine documents]]
[[Category:Engine documents]] [[Category:NPCClient Design]] [[Category:NPCClient Scripting]]

Latest revision as of 17:54, 9 April 2013

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


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.