Difference between revisions of "WH Flow Graph Documentation"

From Nexus Mods Wiki
Jump to: navigation, search
(Created page with " Quest Flow Graph This page documents the Quest Flow Graph extension to the standard CryEngine Flow Graph. Consult CE documentation if you wish to learn more about standard...")
 
m
 
(10 intermediate revisions by one other user not shown)
Line 1: Line 1:
  
Quest Flow Graph
+
 
 +
 
 +
= Quest Flow Graph =
  
 
This page documents the Quest Flow Graph extension to the standard CryEngine Flow Graph.
 
This page documents the Quest Flow Graph extension to the standard CryEngine Flow Graph.
  
Consult CE documentation if you wish to learn more about standard Flow Graph.
+
Consult [https://docs.cryengine.com/display/SDKDOC2/Home|CE CE documentation] if you wish to learn more about standard Flow Graph.
  
Since Quest Flow Graph operates atop the Quest System, most of the documentation of this tool is in Quest System documentation. This page covers only basic controls and elements of this tool.
+
Since Quest Flow Graph operates atop the Quest System, most of the documentation of this tool is in [[Quest_System_Documentation|Quest System documentation]]. This page covers only basic controls and elements of this tool.
  
 
Flow Graphs consist of a set of nodes and edges. Nodes define states and some implicit logic, or provide additional values from other systems (e.g. references to assets from the game level). Edges define relationship between nodes and the rest of the logic.
 
Flow Graphs consist of a set of nodes and edges. Nodes define states and some implicit logic, or provide additional values from other systems (e.g. references to assets from the game level). Edges define relationship between nodes and the rest of the logic.
  
[[File:|623x266px]]
+
[[File:Quest System Documentation Image1.png|623x266px|Quest System Documentation Image1.png]]
  
 
= New Quest Flow Graph =
 
= New Quest Flow Graph =
  
The first step is to create a new quest smart object in Swift. Follow the naming conventions. Copy or remember that name (hereinafter ''questName'').
+
The first step is to create a new quest smart object in [[KCD_Swift_Documentation|Swift]]. Follow the naming conventions. Copy or remember that name (hereinafter ''questName'').
  
 
Click this option
 
Click this option
  
[[File:|228x340px]]
+
 
 +
[[File:FlowGraph_Documentation_Image2.png]]
  
 
You will be prompted to save a XML file. Name it ''questName.xml''.<br/> It should be stored under ..\Data\Libs\quests\flowgraphs
 
You will be prompted to save a XML file. Name it ''questName.xml''.<br/> It should be stored under ..\Data\Libs\quests\flowgraphs
Line 24: Line 27:
 
An empty Quest FG will be created
 
An empty Quest FG will be created
  
[[File:|610x309px]]
+
[[File:FlowGraph_Documentation_Image3.png]]
  
 
The comment that now states “Not in DB” indicates when was the FG last committed to DB.
 
The comment that now states “Not in DB” indicates when was the FG last committed to DB.
Line 30: Line 33:
 
The FG can now be found under XML folder.
 
The FG can now be found under XML folder.
  
[[File:|321x827px]]
+
[[File:FlowGraph_Documentation_Image4.png]]
  
 
== Move FG to non-default folder ==
 
== Move FG to non-default folder ==
  
This folder view is exclusively meant to store XML backups. However your Quest FG must be stored in DB so you should move the newly created reference to another sister folder. You can choose any folder you wish or create a new one. Creating a new [[idea]][[#_msocom_1|[AG1]]] named after your mod is a good idea.
+
This folder view is exclusively meant to store XML backups. However your Quest FG must be stored in DB so you should move the newly created reference to another sister folder. You can choose any folder you wish or create a new one. Creating a new folder named after your mod is a good idea.
  
 
You move the file this way:
 
You move the file this way:
  
[[File:|311x190px]]
+
[[File:FlowGraph_Documentation_Image5.png]]
  
[[File:|313x134px]]
+
[[File:FlowGraph_Documentation_Image6.png]]
  
 
Result:
 
Result:
  
[[File:|313x834px]]
+
[[File:FlowGraph_Documentation_Image7.png]]
  
 
As a result our new quest is now under new folder but it is still not stored in DB.
 
As a result our new quest is now under new folder but it is still not stored in DB.
Line 54: Line 57:
 
Fire up the quicksearch utility by pressing Q anywhere in the Graph space, and type in objective.
 
Fire up the quicksearch utility by pressing Q anywhere in the Graph space, and type in objective.
  
[[File:|242x90px]]
+
 
 +
[[File:FlowGraph_Documentation_Image8.png]]
  
 
Confirm with Enter. A node of the type Objective is inserted.
 
Confirm with Enter. A node of the type Objective is inserted.
  
[[File:|578x392px]]
+
[[File:FlowGraph_Documentation_Image9.png]]
  
 
Now the quest is valid and you can press the “Export Button”.
 
Now the quest is valid and you can press the “Export Button”.
  
[[File:|486x135px]]
+
[[File:FlowGraph_Documentation_Image10.png]]
  
 
A confirmation window will pop-up after a while and the comment will signalize the time of last commit and username of the last committer.
 
A confirmation window will pop-up after a while and the comment will signalize the time of last commit and username of the last committer.
  
[[File:|623x372px]]
+
[[File:FlowGraph_Documentation_Image11.png]]
  
Every time you make a change you do it locally. Only after Exporting the quest is the Quest FG stored in DB.<br/> <span style="font-size:13.0pt"><span style="line-height:107%">Errors</span></span>
+
Every time you make a change you do it locally. Only after Exporting the quest is the Quest FG stored in DB.
 +
 
 +
==Errors==
  
 
Should your export to DB fail, you will find error messages in the console.<br/> Common errors:
 
Should your export to DB fail, you will find error messages in the console.<br/> Common errors:
Line 77: Line 83:
 
*Exclusive properties set at once (e.g. item category vs item type)  
 
*Exclusive properties set at once (e.g. item category vs item type)  
 
*Clashing IDs  
 
*Clashing IDs  
 +
 +
 +
  
 
= Nodes =
 
= Nodes =
Line 90: Line 99:
 
All other nodes belong to 2 groups
 
All other nodes belong to 2 groups
  
*Asset tracking  
+
'''Asset tracking'''
 +
 
 +
These nodes are plugged via an interface AssetTracked node into “Tracked” port of an Objective node. Add additional asset-related conditions for Objective completion. Examples: if an X number of Y items is picked, or if an NPC dies, or if and NPC enters and Area etc. See the [[Quest_System_Documentation#AssetTracked|asset tracking part of the Quest System documentation]] for more details
  
These nodes are plugged via an interface AssetTracked node into “Tracked” port of an Objective node. Add additional asset-related conditions for Objective completion. Examples: if an X number of Y items is picked, or if an NPC dies, or if and NPC enters and Area etc. &nbsp;See the asset tracking part of the Quest System documentation for more details
+
*AssetTracked  
 +
*AssetItem
 +
*AssetNPC
 +
*AssetPlace
 +
*AssetStatistics
  
*<ul style="list-style-type:circle">
+
'''QuestRewards'''
<li>AssetTracked</li>
 
<li>AssetItem</li>
 
<li>AssetNPC</li>
 
<li>AssetPlace</li>
 
<li>AssetStatistics</li>
 
</ul>  <li>QuestRewards</li>
 
</ul>
 
  
 
These nodes are plugged directly into “Reward” port of an Objective. They give the player the defined reward upon Objective completion.
 
These nodes are plugged directly into “Reward” port of an Objective. They give the player the defined reward upon Objective completion.
  
*<ul style="list-style-type:circle">
+
*RewardAchievement  
<li>RewardAchievement</li>
+
*RewardExp  
<li>RewardExp</li>
+
*RewardItem  
<li>RewardItem</li>
+
*RewardMoney  
<li>RewardMoney</li>
+
*RewardPerk  
<li>RewardPerk</li>
+
*RewardReputation  
<li>RewardReputation</li>
+
*RewardScript  
<li>RewardScript</li>
 
</ul>  </ul>
 
  
For more details on Node relationships and settings see Quest Systems documentation.
+
For more details on Node relationships and settings see [[Quest_System_Documentation|Quest System documentation]].
  
 
= Edges =
 
= Edges =
Line 121: Line 127:
 
An edge, visually an arrowed connection, defines the relationships between nodes. Edges can carry signals or define a value for another node port which requires a value.
 
An edge, visually an arrowed connection, defines the relationships between nodes. Edges can carry signals or define a value for another node port which requires a value.
  
Example:
+
Example:  
 +
 
 +
[[File:FlowGraph Documentation Image12.png|thumb|none|800px|A hidden Objective1 is started immediately after the quest is started. Objective1 tracks if soul rat_bernard has at least 5 apples in inventory. When Objective1 is completed, player is immediately rewarded with 1 apple and the visible Objective2 is started.]]
  
[[File:|623x331px]]
+
An edge can be disabled in context menu when you right-click the dot in its middle. Disabled edges are rendered dashed lines. Disabled edges do nothing. Good for debugging purposes where you want to disable part of the logic without losing the relationship and having to remember it.
  
''A hidden Objective1 is started immediately after the quest is started. Objective1 tracks if soul rat_bernard has at least 5 apples in inventory. When Objective1 is completed, player is immediately rewarded with 1 apple and the visible Objective2 is started.''
 
  
An edge can be disabled in context menu when you right-click the dot in its middle. Disabled edges are rendered dashed lines. Disabled edges do nothing. Good for debugging purposes where you want to disable part of the logic without losing the relationship and having to remember it.
 
  
 
= Debugging =
 
= Debugging =
Line 133: Line 139:
 
By pressing this button
 
By pressing this button
  
[[File:|334x104px]]
+
[[File:FlowGraph Documentation Image13.png|RTENOTITLE]]
  
 
you turn on/off live visual debugging of FG. If you jump into Game Mode you can see the states of all the nodes, which signal edges have already fired, and in what states the tracking is.
 
you turn on/off live visual debugging of FG. If you jump into Game Mode you can see the states of all the nodes, which signal edges have already fired, and in what states the tracking is.
Line 139: Line 145:
 
Result may look like this:
 
Result may look like this:
  
[[File:|623x373px]]
+
[[File:FlowGraph Documentation Image14.png|1000px|RTENOTITLE]]
  
 
Note: If you think you are not being shown the correct state of the flowgraph, which sometimes happen, click on another one and click back. This will force refresh of the entire FG debug info.
 
Note: If you think you are not being shown the correct state of the flowgraph, which sometimes happen, click on another one and click back. This will force refresh of the entire FG debug info.
<div>
+
 
----
+
{{KCDNavigation}}
<div><div class="msocomtxt" id="_com_1" language="JavaScript" onmouseout="msoCommentHide('_com_1')" onmouseover="msoCommentShow('_anchor_1','_com_1')">
+
 
asi "folder"? :) [[#_msoanchor_1|[AG1]]]
 
</div> </div> </div> 
 
 
[[Category:Documentation]]
 
[[Category:Documentation]]

Latest revision as of 13:44, 13 February 2020


Quest Flow Graph

This page documents the Quest Flow Graph extension to the standard CryEngine Flow Graph.

Consult CE documentation if you wish to learn more about standard Flow Graph.

Since Quest Flow Graph operates atop the Quest System, most of the documentation of this tool is in Quest System documentation. This page covers only basic controls and elements of this tool.

Flow Graphs consist of a set of nodes and edges. Nodes define states and some implicit logic, or provide additional values from other systems (e.g. references to assets from the game level). Edges define relationship between nodes and the rest of the logic.

Quest System Documentation Image1.png

New Quest Flow Graph

The first step is to create a new quest smart object in Swift. Follow the naming conventions. Copy or remember that name (hereinafter questName).

Click this option


FlowGraph Documentation Image2.png

You will be prompted to save a XML file. Name it questName.xml.
It should be stored under ..\Data\Libs\quests\flowgraphs

An empty Quest FG will be created

FlowGraph Documentation Image3.png

The comment that now states “Not in DB” indicates when was the FG last committed to DB.

The FG can now be found under XML folder.

FlowGraph Documentation Image4.png

Move FG to non-default folder

This folder view is exclusively meant to store XML backups. However your Quest FG must be stored in DB so you should move the newly created reference to another sister folder. You can choose any folder you wish or create a new one. Creating a new folder named after your mod is a good idea.

You move the file this way:

FlowGraph Documentation Image5.png

FlowGraph Documentation Image6.png

Result:

FlowGraph Documentation Image7.png

As a result our new quest is now under new folder but it is still not stored in DB.

Commit quest to DB

A quest needs to contain at least one Objective node to be committable to DB.

Fire up the quicksearch utility by pressing Q anywhere in the Graph space, and type in objective.


FlowGraph Documentation Image8.png

Confirm with Enter. A node of the type Objective is inserted.

FlowGraph Documentation Image9.png

Now the quest is valid and you can press the “Export Button”.

FlowGraph Documentation Image10.png

A confirmation window will pop-up after a while and the comment will signalize the time of last commit and username of the last committer.

FlowGraph Documentation Image11.png

Every time you make a change you do it locally. Only after Exporting the quest is the Quest FG stored in DB.

Errors

Should your export to DB fail, you will find error messages in the console.
Common errors:

  • Clashing names
  • Some orphaned nodes
  • Incomplete AssetTracked cascade
  • Exclusive properties set at once (e.g. item category vs item type)
  • Clashing IDs



Nodes

List of nodes available in the Quest FG

There are 3 quest-state nodes

  • Begin – Mandatory. Created automatically. Only one per FG is permitted.
  • End - Mandatory. Created automatically. Only one per FG is permitted.
  • Objective – Having at least one is mandatory.

All other nodes belong to 2 groups

Asset tracking

These nodes are plugged via an interface AssetTracked node into “Tracked” port of an Objective node. Add additional asset-related conditions for Objective completion. Examples: if an X number of Y items is picked, or if an NPC dies, or if and NPC enters and Area etc. See the asset tracking part of the Quest System documentation for more details

  • AssetTracked
  • AssetItem
  • AssetNPC
  • AssetPlace
  • AssetStatistics

QuestRewards

These nodes are plugged directly into “Reward” port of an Objective. They give the player the defined reward upon Objective completion.

  • RewardAchievement
  • RewardExp
  • RewardItem
  • RewardMoney
  • RewardPerk
  • RewardReputation
  • RewardScript

For more details on Node relationships and settings see Quest System documentation.

Edges

An edge, visually an arrowed connection, defines the relationships between nodes. Edges can carry signals or define a value for another node port which requires a value.

Example:

A hidden Objective1 is started immediately after the quest is started. Objective1 tracks if soul rat_bernard has at least 5 apples in inventory. When Objective1 is completed, player is immediately rewarded with 1 apple and the visible Objective2 is started.

An edge can be disabled in context menu when you right-click the dot in its middle. Disabled edges are rendered dashed lines. Disabled edges do nothing. Good for debugging purposes where you want to disable part of the logic without losing the relationship and having to remember it.


Debugging

By pressing this button

RTENOTITLE

you turn on/off live visual debugging of FG. If you jump into Game Mode you can see the states of all the nodes, which signal edges have already fired, and in what states the tracking is.

Result may look like this:

RTENOTITLE

Note: If you think you are not being shown the correct state of the flowgraph, which sometimes happen, click on another one and click back. This will force refresh of the entire FG debug info.

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