Skip to main content

Advanced Usage: Custom Strategy Profiles

The VoiceCulture system supports custom project setups through strategy profiles. If your project uses different asset naming conventions or folder structures, you can define your own parsing logic by creating a custom strategy.

1. What Is a Strategy?

A strategy defines how voice assets are matched to USSVoiceCultureSound entries. It covers:

  • Parsing asset names (e.g., extract actor or culture code)
  • Finding matching assets for auto-population
  • Building expected asset suffixes
  • Displaying pattern examples for UI guidance

Each strategy is implemented as a subclass of USSVoiceCultureStrategy.

2. How Are Strategies Assigned?

Each strategy is linked to a profile via the Editor Settings:

TArray<FSSVoiceStrategyProfile> StrategyProfiles;

Each profile contains:

  • ProfileName – A human-readable name (e.g., "Default", "CompanyX_Naming")
  • StrategyClass – A reference to a class that inherits from USSVoiceCultureStrategy

You can assign or switch between profiles in the VoiceCulture Dashboard, under the Overview tab.

3. Default Strategy Example

The default strategy (USSVoiceCultureStrategy_Default) expects names like:

LVA_{ActorName}_{Suffix}

And voice culture assets like:

A_{Culture}_{ActorName}_{Suffix}

Example

  • VoiceCulture asset: LVA_NPC001_MarketScene01_L01
  • Auto-matching asset: A_EN_NPC001_MarketScene01_L01

The default strategy will:

  • Parse A_EN_NPC001_MarketScene01_L01 into:
    • Prefix = A
    • Culture = EN
    • Suffix = NPC001_MarketScene01_L01
  • Match this suffix against the base asset name
  • Map the matching USoundBase to the "en" entry in the target asset

This logic is handled in:

  • ParseAssetName(...)
  • BuildExpectedAssetSuffix(...)
  • ExecuteAutoPopulate(...)

4. Creating a Custom Strategy

You can create your own strategy in C++ or Blueprint, depending on your project's needs.

In C++

  1. Inherit from USSVoiceCultureStrategy
  2. Override key methods:
    • ParseAssetName(...)
    • ExecuteAutoPopulate(...)
    • BuildExpectedAssetSuffix(...)
  3. Implement UI descriptions:
    • DisplayMatchVoiceCulturePattern()
    • DisplayMatchVoiceCulturePatternExample()
UCLASS()
class YOURMODULE_API UMyCompanyNamingStrategy : public USSVoiceCultureStrategy
{
GENERATED_BODY()

// Override parsing and auto-match logic here
};

In Blueprint

  1. Create a new Blueprint class based on USSVoiceCultureStrategy
  2. Override these native events:
    • ExecuteAutoPopulate
    • ExecuteExtractActorNameFromAsset
    • DisplayMatchVoiceCulturePattern

This is useful for quick prototyping or artist-friendly workflows.

5. Registering Your Strategy

Once your strategy is created:

  1. Go to Editor Preferences > Voice Editor Settings
  2. Add a new entry under Strategy Profiles
  3. Set the ProfileName (e.g., "StudioX_Strategy")
  4. Assign your custom class to the StrategyClass field

The profile will now appear in the dashboard under the profile selector.

6. Strategy UI Integration

The VoiceCulture Dashboard automatically reads your strategy’s display functions:

  • DisplayMatchVoiceCulturePattern() → used in tooltips or headers
  • DisplayMatchVoiceCulturePatternExample() → used for examples
  • DisplayMatchCultureRulePattern() → explains how voice culture is extracted
  • DisplayMatchCultureRulePatternExample() → shows a naming sample

This helps your team understand the strategy’s expectations without digging into code.

7. Tips for Complex Projects

  • Use asset name parts (Prefix, Culture, Suffix) smartly depending on how your naming convention is structured.
  • Use ExecuteExtractActorNameFromAsset() to plug into the Voice Actor tab logic.
  • Leverage ExecuteOptimizedOneCultureAutoPopulateInAsset(...) to implement highly optimized asset matching for batch tools.