Node Definition - Grim-/Talented GitHub Wiki
The UpgradeTreeNodeDef
is a fundamental building block in the talent tree system.
It represents individual nodes within a talent tree that players can interact with to gain upgrades and progress through different paths of development.
<Talented.UpgradeTreeNodeDef>
<defName>NodeIdentifier</defName>
<type>NodeType</type>
<upgrades>
<li>UpgradeDefReference</li>
</upgrades>
<sequential>true/false</sequential>
<connections>
<li>ConnectedNodeDefName</li>
</connections>
<hide>true/false</hide>
<prerequisitesToShow></prerequisitesToShow>
</Talented.UpgradeTreeNodeDef>
There are three distinct types of nodes in the system:
-
Start Nodes (
<type>Start</type>
)- Represent the entry points of the talent tree
- Can have multiple start nodes for different starting locations (experimental feature)
- Must be properly connected to subsequent nodes in the tree
-
Branch Nodes (
<type>Branch</type>
)- Special nodes that define the beginning of new branching paths
- Hold information about newly formed branches in the talent tree
- Used to create divergent progression paths
-
Normal Nodes (
<type>Normal</type>
)- Standard nodes that make up the majority of the talent tree
- Connect to other nodes to form progression paths
- Not specialized like Start or Branch nodes
The upgrades
field contains a list of UpgradeDef
references that determine what benefits the player receives when investing talent points in the node:
<upgrades>
<li>UpgradeDefOne</li>
<li>UpgradeDefTwo</li>
<li>UpgradeDefThree</li>
</upgrades>
The sequential
field determines how multiple upgrades in a single node are handled:
- Upgrades replace previous ones as the node levels up
- Only one upgrade is active at a time
- Example: Basic → Advanced → Final, where each tier replaces the previous
<upgrades>
<li>BasicMetabolismUpgrade</li>
<li>AdvancedMetabolismUpgrade</li>
<li>FinalMetabolismUpgrade</li>
</upgrades>
<sequential>true</sequential>
- Upgrades stack with each level
- All previous upgrades remain active
- Example: Level 3 would have all three upgrades active simultaneously
<upgrades>
<li>BasicMetabolismUpgrade</li>
<li>AdvancedMetabolismUpgrade</li>
<li>FinalMetabolismUpgrade</li>
</upgrades>
<sequential>false</sequential>
The connections
field defines how nodes link together in the talent tree:
<connections>
<li>NodeDefName1</li>
<li>NodeDefName2</li>
</connections>
- Each connection represents a possible progression path
- Multiple connections allow for branching paths
- Connections are used for both visual representation and progression logic
- It is very important these connections are set correctly.
Nodes can be hidden or shown based on certain conditions:
<hide>false</hide>
<prerequisitesToShow>
<!-- Add prerequisites here -->
</prerequisitesToShow>
- The
hide
field determines if the node is visible by default -
prerequisitesToShow
can be used to define conditions for revealing the node
-
Naming Convention
- Use clear, descriptive defNames
- Follow a consistent naming pattern for related nodes
-
Tree Structure
- Ensure all nodes are properly connected
- Avoid creating isolated nodes or dead ends
- Test all branching paths for proper progression
-
Upgrade Design
- Choose sequential vs non-sequential carefully based on intended progression
- Balance upgrade power levels across different paths
- Document upgrade effects clearly
-
Performance Considerations
- Minimize the number of prerequisite checks
- Keep upgrade lists reasonably sized
- Consider the impact of many simultaneous non-sequential upgrades
This is a list of UpgradeTreeNodeDefs which establishes the parent(ParasiteBasicMetabolism
)-child (ParasitePathNode1
, SymbiosisPathNode1
) relationship between nodes, this is required for layout and validation purposes.
<connections>
<li>ParasitePathNode1</li>
<li>SymbiosisPathNode1</li>
</connections>
Visibility UpgradeTreeNodes can be hidden until certain other upgrades are obtained, this is mostly to allow for little surprises for the player.