EldenLOD is a PowerShell-based toolkit designed to automate the process of extracting, renumbering, and repacking Level of Detail (LOD) assets for Elden Ring mods. This suite ensures that mods display correctly at various distances, enhancing the seamless co-op experience.
Latest Enhancement: Complete refactoring with shared module functions, enhanced dry-run mode, comprehensive testing framework, and CI/CD integration.
- Smart Renumbering: Only renumbers files when there's a mismatch between container and content numbers
- Enhanced Dry-Run Mode: Detailed preview showing exactly what changes would be made and why
- Shared Module Architecture: Modular functions for better maintainability and reusability
- Empty TPF Handling: Properly handles intentionally empty texture files
- Flexible Workflow: Choose from Full, ExtractOnly, or RepackOnly processing
- Comprehensive Testing: Automated testing framework with multiple test levels
- CI/CD Integration: GitHub Actions workflow for continuous testing
- Comprehensive Logging: Detailed logs for debugging and verification
- Integration with WitchyBND: Utilizes external tools for archive management
- Error Recovery: Robust error handling and validation
- PowerShell 5.1 or higher (PowerShell 7+ recommended)
- WitchyBND (must be installed and added to your system PATH)
- Extracted Elden Ring game files (UnpackedGame directory)
-
Clone the repository:
git clone https://github.com/shinseiko/EldenLOD.git -
Navigate to the project directory:
cd EldenLOD -
Ensure dependencies are met:
- Verify PowerShell and WitchyBND are correctly installed
- Set up UnpackedGame directory or UnpackedGameDir environment variable
The unified entry point supports different workflow types:
Full Processing (Extract + Repack):
.\Invoke-EldenLOD.ps1 -PartsDir "C:\YourMod\parts" -ExecuteExtract Only:
.\Invoke-EldenLOD.ps1 -PartsDir "C:\YourMod\parts" -WorkflowType ExtractOnly -ExecuteRepack Only:
.\Invoke-EldenLOD.ps1 -PartsDir "C:\YourMod\parts" -WorkflowType RepackOnly -ExecuteDry Run (Preview Changes):
.\Invoke-EldenLOD.ps1 -PartsDir "C:\YourMod\parts"Extract and Process:
.\EldenLOD-Extract.ps1 -partsDir "C:\YourMod\parts" -ExecuteRepack Processed Files:
.\EldenLOD-Repack.ps1 -partsDir "C:\YourMod\parts" -ExecuteFor convenience, you can also use the provided batch files:
Invoke-EldenLOD.bat- Main entry pointEldenLOD-Extract.bat- Extract onlyEldenLOD-Repack.bat- Repack only
- Modular Functions: Moved renumbering logic to
EldenLOD.psm1for better maintainability - Functions:
Invoke-FileRenumbering,Invoke-DdsRenumbering,Update-BndXmlReferences,Update-TpfXmlReferences - Improved Reusability: Consistent parameter handling across all operations
- Detailed Previews: Shows exactly what files would be renamed and why
- Action Descriptions: Displays which XML references would be updated
- Process Insights: Explains container/content mismatches before changes
- CRITICAL FIX: Properly renumbers DDS files inside TPF containers
- Container Sync: Ensures TPF contents match container numbering
- LOD Processing: Correctly handles _L suffix addition for LOD variants
- Multiple Test Levels: Minimal, Simple, and Full test suites
- Automated Validation: Tests both dry-run and execute modes
- CI/CD Integration: GitHub Actions workflow for continuous testing
- Test Runner:
Run-Tests.ps1with detailed reporting and flexible parameters
- Consistent Logic: Execute/DryRun branching throughout all scripts
- Better Validation: Improved TPF empty detection and XML parsing
- Robust Recovery: Graceful handling of missing files and failed operations
EXECUTION REQUIRED:
All scripts require the-Executeswitch to actually perform operations.
Without-Execute, scripts run in dry-run mode and only show what they would do.
BACKUP RECOMMENDED:
Always backup your mod files before processing. The scripts modify files in-place.
CORRECT ORDER:
When using individual scripts, always run Extract before Repack.
EldenLOD/
βββ Invoke-EldenLOD.ps1 # Main entry point (unified workflow)
βββ EldenLOD-Extract.ps1 # Extract and process files
βββ EldenLOD-Repack.ps1 # Repack processed files
βββ EldenLOD.psm1 # Shared module (functions)
βββ Run-Tests.ps1 # Test runner with multiple test levels
βββ *.bat # Windows batch file shortcuts
βββ tests/ # Testing framework
β βββ minimal-test.ps1 # Simple functionality test
β βββ Test-EldenLOD-Simple.ps1 # Comprehensive test framework
β βββ Test-EldenLOD-*.ps1 # Additional test variants
β βββ encumbered/ # Test data and cases
βββ .github/workflows/ # CI/CD pipeline
β βββ test-eldenlod.yml # GitHub Actions workflow
βββ docs/ # Comprehensive documentation
β βββ PROJECT_OVERVIEW.md # Architecture and common mistakes
β βββ FUNCTION_REFERENCE.md # Function documentation
β βββ DEBUGGING_TRAIL.md # Investigation history
β βββ TESTING_FRAMEWORK_COMPLETE.md # Testing implementation guide
βββ EMPTY_TPF_HANDLING.md # Empty TPF documentation
βββ _logs/ # Processing logs
βββ config/ # Configuration files
"No UnpackedGame directory found"
- Set environment variable:
$env:UnpackedGameDir = "C:\Path\To\UnpackedGame" - Or place UnpackedGame folder in your mod's parts directory
- Or use
-UnpackedGameDirparameter
"witchybnd command not found"
- Ensure WitchyBND is installed and in your system PATH
- Try running
witchybnd --helpto verify installation
"TPF extraction failed"
- Check if TPF files are corrupted
- Verify sufficient disk space
- Check log files in
_logsdirectory
All operations are logged to _logs\*.log files:
Extract-And-Patch-LOD.log- Extraction and processing detailsRepack-LOD.log- Repacking operation details
Enable verbose output for more details:
$VerbosePreference = 'Continue'
.\Invoke-EldenLOD.ps1 -Execute -Verbose# Process all files in current directory
.\Invoke-EldenLOD.ps1 -Execute
# Process specific mod directory
.\Invoke-EldenLOD.ps1 -PartsDir "C:\Mods\MyArmorMod\parts" -Execute# Extract and process, but don't repack
.\Invoke-EldenLOD.ps1 -WorkflowType ExtractOnly -Execute
# Then inspect the extracted files before repacking
# .\Invoke-EldenLOD.ps1 -WorkflowType RepackOnly -Execute# See detailed preview of what would be processed without making changes
.\Invoke-EldenLOD.ps1 -PartsDir "C:\Mods\TestMod\parts"
# Output shows:
# - Which files would be renamed and why (container/content mismatches)
# - Which XML references would be updated
# - Which archives would be repacked
# - Which directories would be cleaned up# Run all test levels with detailed reporting
.\Run-Tests.ps1 -Execute
# Run specific test level
.\Run-Tests.ps1 -TestLevel Minimal -Execute
# Run with timeout protection
.\Run-Tests.ps1 -TestLevel Simple -TimeoutSeconds 300 -ExecuteThe project now uses a modular architecture with shared functions in EldenLOD.psm1:
Invoke-FileRenumbering- Handles all non-TPF file types (FLVER, ANIBND, CLM2, HKX, etc.)Invoke-DdsRenumbering- Handles DDS files within TPF containersUpdate-BndXmlReferences- Updates BND4 XML file references after renamingUpdate-TpfXmlReferences- Updates TPF XML file references after DDS renaming
The script compares container BND numbers with internal file numbers:
- Container:
HD_M_1800.partsbnd.dcxexpects number1800 - Contents: TPF contains
HD_M_1620files (number1620) - Action: Rename
1620β1800(mismatch correction)
- Process Preview: Shows exactly which files would be renamed with before/after names
- Mismatch Detection: Explains why renumbering is needed (container vs content number differences)
- XML Updates: Details which XML references would be updated and why
- Action Sequence: Displays the complete processing workflow before execution
- Test Levels: Minimal (basic functionality), Simple (comprehensive), Full (all features)
- Validation: Tests both dry-run preview and actual execution modes
- Automated Reports: Detailed test results with pass/fail status and execution times
- CI/CD Ready: GitHub Actions integration for automated testing on commits
| Type | Description | Use Case |
|---|---|---|
Full |
Extract + Process + Repack | Normal mod processing |
ExtractOnly |
Extract and process only | Debugging, inspection |
RepackOnly |
Repack previously processed files | After manual edits |
- Fixed critical renumbering logic bug
- Enhanced shared module architecture with reusable functions
- Implemented comprehensive testing framework with CI/CD integration
- Enhanced dry-run mode with detailed action previews
- Fixed internal TPF file renumbering issues
- Improved error handling and logging
- Created extensive documentation and debugging guides
- Graphical user interface (GUI) for ease of use
- Batch processing optimization for large mod collections
- Integration with popular mod managers
- Support for additional Elden Ring asset types
- Automated backup and restore functionality
- Performance monitoring and optimization
- Advanced configuration options
The project includes a comprehensive testing framework with multiple test levels:
# Run all tests with detailed reporting
.\Run-Tests.ps1 -Execute
# Run specific test level
.\Run-Tests.ps1 -TestLevel Minimal -Execute # Quick functionality check
.\Run-Tests.ps1 -TestLevel Simple -Execute # Comprehensive testing
.\Run-Tests.ps1 -TestLevel Full -Execute # All features and edge cases
# Run with custom timeout
.\Run-Tests.ps1 -TestLevel Simple -TimeoutSeconds 300 -Execute| Level | Description | Duration | Use Case |
|---|---|---|---|
| Minimal | Basic functionality test | ~30 seconds | Quick validation |
| Simple | Comprehensive test with error handling | ~2-5 minutes | Development testing |
| Full | All features with multiple test cases | ~5-10 minutes | Release validation |
The project includes GitHub Actions workflow (.github/workflows/test-eldenlod.yml) that:
- Runs tests on every commit and pull request
- Tests multiple PowerShell versions
- Validates both Windows and cross-platform compatibility
- Provides detailed test reports and artifacts
Contributions are welcome!
- Fork the repository
- Create a feature branch:
git checkout -b feature/your-feature - Make your changes with clear commit messages
- Test thoroughly with different mod types
- Submit a pull request describing your changes
Please ensure your code follows PowerShell best practices and includes appropriate error handling.
This project is licensed under the MIT License. See LICENSE file for details.
- FromSoftware for creating Elden Ring
- WitchyBND developers for essential archive management tools
- Elden Ring modding community for feedback and testing
- Contributors who helped identify and fix critical bugs
If you encounter issues:
- Check the troubleshooting section above
- Review log files in
_logsdirectory for detailed error information - Run tests to validate your environment:
.\Run-Tests.ps1 -TestLevel Minimal -Execute - Check documentation in the
docs/folder:PROJECT_OVERVIEW.md- Architecture and common mistakesFUNCTION_REFERENCE.md- Function documentation and debuggingDEBUGGING_TRAIL.md- Investigation history and solutions
- Create an issue on GitHub with:
- Full error message and log contents
- Steps to reproduce the issue
- Your environment details (PowerShell version, WitchyBND version)
- Test results from
.\Run-Tests.ps1
# Check your PowerShell version
$PSVersionTable.PSVersion
# Test WitchyBND installation
witchybnd --help
# Validate project functionality
.\Run-Tests.ps1 -TestLevel Minimal -Execute
# Check for common issues
Get-ChildItem -Path $partsDir -Filter "*.partsbnd.dcx" | Measure-ObjectEldenLOD v0.1 Alpha - Enhanced Elden Ring LOD Asset Processing with Comprehensive Testing