Redistribute IFA actors to match grid cell sizes using SipherFoliageGridBuilder
Role: World Partition Builder Operator Scope: Level-specific IFA redistribution Platform: Windows (Win64)
This skill reads project paths from skills.config.json at the repository root.
project.root / project.uproject — project locationengine.path / engine.editor_cmd — engine installation
If not found, auto-detect using ue-detect-engine skill and CWD.Run USipherFoliageGridBuilder to redistribute AInstancedFoliageActor instances
based on grid cell sizes defined in FSipherWPGridConfig.
bIsFoliageGrid=true in Project SettingsIMPORTANT:
-Build phase flag/Game/... → C:/Program Files/Git/Game/...)powershell -Command "& '{engine.editor_cmd}' '{project.root}\{project.uproject}' '{LevelPath}' '-run=SipherWorldPartitionBuilderCommandlet' '-Builder=SipherFoliage' '-Build' '-nullrhi' '-nosplash' '-unattended' 2>&1 | Tee-Object -FilePath '{project.root}\Saved\Logs\FoliageGridBuilder.log'"
# Get engine path from registry
$EnginePath = (reg query "HKEY_CURRENT_USER\SOFTWARE\Epic Games\Unreal Engine\Builds" 2>$null | Select-String "REG_SZ" | ForEach-Object { ($_ -split "\s+REG_SZ\s+")[1] } | Select-Object -First 1)
# Run commandlet
& "$EnginePath\Engine\Binaries\Win64\UnrealEditor-Cmd.exe" `
"$PWD\S2.uproject" `
"{LevelPath}" `
"-run=SipherWorldPartitionBuilderCommandlet" `
"-Builder=SipherFoliage" `
"-Build" `
"-nullrhi" "-nosplash" "-unattended" 2>&1 | Tee-Object -FilePath "$PWD\Saved\Logs\FoliageGridBuilder.log"
| Parameter | Description | Default |
|---|---|---|
{LevelPath} | Game path (e.g., /Game/S2/Levels/OpenWorld) | Required |
-Build | REQUIRED phase flag to run the builder | Required |
-GridNames= | Comma-separated grid names to process | All foliage grids |
-ForceRebuild | Force rebuild even if IFAs appear correct | false |
-KeepEmptyIFAs | Keep empty IFAs after redistribution | false |
| Flag | Description |
|---|---|
-Setup | Setup phase only |
-Build | Main build phase - use this for foliage redistribution |
-Composition | Composition phase only |
-Finalize | Finalize phase only |
-Build flag.\Saved\Logs\FoliageGridBuilder.logThe builder checks if each IFA is already correctly positioned within World Partition cells:
Use -ForceRebuild to bypass this check and redistribute all matching IFAs.
========================================
Foliage Grid Build Complete:
Grids processed: 2
Total IFAs processed: 15
Total IFAs skipped (already correct): 8
Total IFAs created: 42
Total IFAs deleted: 7
Total instances redistributed: 156000
========================================
| Tag | Meaning |
|---|---|
[GRID] | Processing a foliage grid |
[MATCH] | IFA matches grid by folder path |
[EXTRACT] | Extracting instances from IFA |
[SPLIT] | Splitting instances into cells |
[CREATE] | Creating new IFA for cell |
[DELETE] | Deleting source IFA |
[CLEAR] | Cleared foliage from IFA (kept empty) |
[DONE] | Grid processing complete |
[SKIP] | IFA already in correct cell (all instances within single cell bounds) |
[KEEP] | Source IFA kept (also used as target) |
[SAVE] | Saving packages |
[SAVED] | Package saved successfully |
[VALIDATE] | Validation check |
[FOLDER] | Setting IFA folder path |
[OVERFLOW] | IFA reached max instances limit |
LogSipherFoliageGridBuilder: Display: [GRID] Processing: LargeWPO (CellSize: 10000)
LogSipherFoliageGridBuilder: Display: [MATCH] IFA: InstancedFoliageActor_25600_-1_-1_-1
LogSipherFoliageGridBuilder: Display: FolderPath: WPO_LARGE
LogSipherFoliageGridBuilder: Display: MatchedPrefix: WPO_LARGE
LogSipherFoliageGridBuilder: Display: [EXTRACT] IFA: InstancedFoliageActor_25600_-1_-1_-1 (spans multiple cells or wrong position)
LogSipherFoliageGridBuilder: Display: FoliageType: FT_SM_EuropeanHornbeam_Forest_07_Autumn03_02
LogSipherFoliageGridBuilder: Display: Instances: 25
LogSipherFoliageGridBuilder: Display: [SPLIT] FoliageType: FT_SM_EuropeanHornbeam_Forest_07_Autumn03_02
LogSipherFoliageGridBuilder: Display: TotalInstances: 25
LogSipherFoliageGridBuilder: Display: CellCount: 9
LogSipherFoliageGridBuilder: Display: [CREATE] New IFA for Cell (-1,-1,-1): InstancedFoliageActor_10000_-1_-1_-1
LogSipherFoliageGridBuilder: Display: Cell (-1,-1,-1): 1 instances -> InstancedFoliageActor_10000_-1_-1_-1
LogSipherFoliageGridBuilder: Display: [DELETE] Source IFA: InstancedFoliageActor_25600_-1_-1_-1
LogSipherFoliageGridBuilder: Display: [DONE] Grid: LargeWPO
LogSipherFoliageGridBuilder: Display: IFAs processed: 6
LogSipherFoliageGridBuilder: Display: Instances redistributed: 88
LogSipherFoliageGridBuilder: Display: [VALIDATE] PASSED: All 13 IFAs have instances in correct cells
LogSipherFoliageGridBuilder: Display: [SAVE] Saving 13 packages...
LogSipherFoliageGridBuilder: Display: [SAVE] Complete: 13 saved, 0 failed
# Process all foliage grids in OpenWorld level
/system-architect:foliage-grid-builder build /Game/S2/Levels/OpenWorld
# Process specific grids only
/system-architect:foliage-grid-builder build /Game/S2/Main_Flow/Teaser/Level/L_Teaser -GridNames=LargeWPO,SmallWPO
# Force rebuild all
/system-architect:foliage-grid-builder build /Game/S2/Levels/OpenWorld -ForceRebuild
# From project root ({project.root})
powershell -Command "& '{engine.editor_cmd}' '{project.root}\{project.uproject}' '/Game/S2/Main_Flow/Teaser/Level/L_Teaser_Temp_Autumn_03' '-run=SipherWorldPartitionBuilderCommandlet' '-Builder=SipherFoliage' '-Build' '-nullrhi' '-nosplash' '-unattended' 2>&1 | Tee-Object -FilePath '{project.root}\Saved\Logs\FoliageGridBuilder.log'"
Enable foliage grid in Project Settings:
WPO_LARGE) will be processed automatically| Error | Solution |
|---|---|
No phase specified. Use -Setup, -Build, -Composition, or -Finalize | Add -Build flag to command (required) |
Path becomes C:/Program Files/Git/Game/... | Use PowerShell instead of Git bash to avoid path conversion |
No foliage grids found | Enable bIsFoliageGrid in Project Settings |
No IFAs match grid | Check IFA folder paths contain one of the grid's FolderPrefixes |
Builder class not found | Rebuild SipherWorldPartitionEditor module |
[OVERFLOW] reached MaxInstances | Increase MaxInstancesPerFoliageActor or use smaller cells |
Saved/Logs/FoliageGridBuilder.logSaved/Logs/FoliageGridBuilder_err.log