Best Practices - Grim-/Talented GitHub Wiki

Talent Tree Framework - Best Practices Guide

This guide outlines the recommended practices for organizing and implementing talent trees within the framework.

As always I recommend using the Web App Editor for defining trees but it can be done manually.

Directory Structure

The framework follows a specific directory structure to maintain organization and clarity. Each talent tree should be contained within its own dedicated folder, this allows you to import and export from the Web App without duplicating TalentNodeDefs and TalentDefs.

Defs/
└── ExampleTree/
    ├── Classes/
    │   └── YourClass/
    │       ├── MyTalentGene.xml
    │       ├── YourTreeDefinition.xml
    │       ├── Talents/
    │       │   └── [Talent definitions]
    │       └── Upgrades/
    │           └── [Ability and HediffDefs]

Core Components

Gene Definition

The gene definition (MyTalentGene.xml) serves as the foundation for your talent tree. It should contain:

  • Basic gene information (defName, label, description)
  • Tree configuration and associations
  • Experience system settings
  • UI configuration

Key aspects to consider in your gene definition:

  1. Experience Types

    • Combat-based XP (damage dealt/taken)
    • Skill-based XP
    • Job-based XP
    • Verb-based XP
  2. UI Configuration

    • Bar colors
    • Resource thresholds
    • Tab labels

Tree Definition

The tree definition file (YourTreeDefinition.xml) contains:

  • TalentTreeDef
  • TalentTreeNodeDefs
  • Path configurations

This file defines the structure and relationships between different talents in your tree.

Talents and Upgrades

Organize your talents and upgrades in separate directories:

  • Talents/: Contains individual talent definitions
  • Upgrades/: Houses the actual effects (AbilityDefs, HediffDefs) that talents can grant

Best Practices

  1. Modular Organization

    • Keep all definitions related to a specific talent tree in its dedicated folder
    • Maintain clear separation between talents and their effects
  2. Naming Conventions

    • Use consistent, descriptive names for all definitions
    • Prefix definitions with your mod identifier to avoid conflicts
  3. Experience Configuration

    • Balance experience gain rates carefully
    • Consider different playstyles when setting up experience types
    • Use appropriate base XP values for different activities
  4. Documentation

    • Comment complex configurations
    • Include descriptions for talents and abilities
    • Document any special requirements or dependencies
  5. Compatibility

    • Keep upgrades modular for easier compatibility patches
    • Consider interactions with other mods when designing talents

Additional Considerations

  • Test your talent trees thoroughly with different game scenarios
  • Consider balance implications of talent combinations
  • Ensure clear progression paths within your tree
  • Provide appropriate feedback for talent activation and progression

This structure promotes maintainability and makes it easier to extend or modify your talent trees as needed.