Difference between revisions of "Player Brain Documentation"

From Nexus Mods Wiki
Jump to: navigation, search
 
(One intermediate revision by the same user not shown)
Line 18: Line 18:
 
*horse-mounting  
 
*horse-mounting  
 
*crime  
 
*crime  
*[[Player_Brain_Documentation#Requests|dudeProx ]]  
+
*[[Player_Brain_Documentation#DudeProx|dudeProx]]  
 
*tutorial  
 
*tutorial  
 
*digging  
 
*digging  
Line 24: Line 24:
 
*hangover teleport  
 
*hangover teleport  
 
*dog interactions  
 
*dog interactions  
*[[Player_Brain_Documentation#DudeProx|Timekeeper]]  
+
*[[Timekeeper_Documentation|Timekeeper]]  
  
 
 
 
 
Line 54: Line 54:
 
[[File:Player request1.png|RTENOTITLE]]
 
[[File:Player request1.png|RTENOTITLE]]
  
 +
 
  
 
== DudeProx ==
 
== DudeProx ==
Line 59: Line 60:
 
DudeProx is a system responsible for:
 
DudeProx is a system responsible for:
  
 +
 
 
<syntaxhighlight lang="xml">
 
<syntaxhighlight lang="xml">
 
Hey, Henry has come to see us!
 
Hey, Henry has come to see us!
Line 72: Line 74:
 
#create a custom role  
 
#create a custom role  
 
#set one of these metarole to that role  
 
#set one of these metarole to that role  
#*in standard situations, use KOMENTAR_NA_JINDRU (english meaning = COMMENT ON HENRY)
+
#*in standard situations, use KOMENTAR_NA_JINDRU (english meaning = COMMENT ON HENRY)  
#*when seeing player in dark without torch, use KOMENTAR_NA_CHOZENI_POTME (english meaning = COMMENT ON WALKING IN DARK)
+
#*when seeing player in dark without torch, use KOMENTAR_NA_CHOZENI_POTME (english meaning = COMMENT ON WALKING IN DARK)  
#*when seeing player in crouching stance, use KOMENTAR_NA_PLIZENI (english meaning = COMMENT ON STEALTH)
+
#*when seeing player in crouching stance, use KOMENTAR_NA_PLIZENI (english meaning = COMMENT ON STEALTH)  
 
#set priority > 0 to your root dialog topic  
 
#set priority > 0 to your root dialog topic  
 
#set the dialog type to ''ingame monolog''  
 
#set the dialog type to ''ingame monolog''  
Line 80: Line 82:
 
The dudeProx logic will kick-in as usual but your new monolog will keep overriding the basic system barks as long as it's valid.
 
The dudeProx logic will kick-in as usual but your new monolog will keep overriding the basic system barks as long as it's valid.
  
&nbsp;
+
&nbsp; {{KCDNavigation}}
  
 
[[Category:Documentation]] [[Category:Kingdom Come Deliverance]]
 
[[Category:Documentation]] [[Category:Kingdom Come Deliverance]]

Latest revision as of 10:09, 19 February 2020

In terms of AI systems the player is similar to an NPC.

Player's entity is called Dude.

Player's brain is defined in DB as player ans its implementatio is in XML file ..\Data\Libs\AI\player.xml

In order to view/edit the brain player, select the player entity in XGEN NPC Editor
Player brain.png
and then select the Subbrain tab.

The player's brain handles several critical systems or their parts. Systems like:

Zoomed out view of the player's subbrain
  • hit reactions
  • perception
  • different types of player requests
  • player dialogs and monologs
  • horse-mounting
  • crime
  • dudeProx
  • tutorial
  • digging
  • horse trading
  • hangover teleport
  • dog interactions
  • Timekeeper

 

 

 

 

 

 

 

Requests

There are several types of requests. You can request things like weapon draw, weapon holster, torch equip and so on. Each has its own message type.

Behavior Request

You can also take the controls out of player's hands and force the player entity to execute a specific behavior, icluding animations, item interaction etc.
This is done by sending a message of custom type player:request to the player entity (variable __player), with members:

  • target - source of the behavior
  • mode set to "tag" (for behavior tree tagname)
  • behavior - name of the behavior

RTENOTITLE

 

DudeProx

DudeProx is a system responsible for:

 

Hey, Henry has come to see us!
                          ~Some NPC~

The system forces NPCs in player's proximity, who recognize the player via perception, to react to the player and the states he might be in appropriate ways.

The major part of it is implemented in sb_daycycles.xml in BehaviorTree dude_prox. The other part can be found in player.xml in BehaviorTree dudeProx. The player's part handles cooldown on dudeprox requests.

This system is frequently used in situations when you need an NPC to shout a specific bark the moment they see the player. All you have to do is:

  1. create a custom role
  2. set one of these metarole to that role
    • in standard situations, use KOMENTAR_NA_JINDRU (english meaning = COMMENT ON HENRY)
    • when seeing player in dark without torch, use KOMENTAR_NA_CHOZENI_POTME (english meaning = COMMENT ON WALKING IN DARK)
    • when seeing player in crouching stance, use KOMENTAR_NA_PLIZENI (english meaning = COMMENT ON STEALTH)
  3. set priority > 0 to your root dialog topic
  4. set the dialog type to ingame monolog

The dudeProx logic will kick-in as usual but your new monolog will keep overriding the basic system barks as long as it's valid.

 

Kingdom Come: Deliverance: Forum | Before you start | Tutorials & Instructions | Basic Mods | Tools | Documentation | Glossary | EULA