Klump Files
Version History
Build Version | Change Date | Change Type | Description |
---|---|---|---|
676042 | 2025-06-21 | stable | Current version |
Overview
The klump_files
module is an auto-generated registry that contains a list of encrypted klump files available for loading. This module is generated by the klump.py
build script and serves as a manifest for the klump loading system.
File Structure
--Autogenerated by klump.py
return {
-- List of klump file paths
}
Current State
The file currently returns an empty table {}
, indicating no klump files are registered in the current build.
Usage Example
-- Load all registered klump files
local klump_files = require("klump_files")
for _, file in pairs(klump_files) do
local klump_file = string.gsub(file, "klump/", "")
local is_strings = string.sub(klump_file, 1, 8) == "strings/"
if is_strings then
klump_file = string.gsub(klump_file, "strings/", "")
end
local cipher = Profile:GetKlumpCipher(klump_file)
if cipher ~= nil then
if is_strings then
LoadKlumpString(klump_file, cipher, true)
else
LoadKlumpFile(klump_file, cipher, true)
end
end
end
File Format
Standard Klump Files
return {
"klump/images/quagmire_food_inv_images_potato.tex",
"klump/images/quagmire_food_inv_images_hires_potato.tex",
"klump/anim/dynamic/potato.dyn",
-- Additional asset files...
}
String Klump Files
return {
"klump/strings/STRINGS.NAMES.POTATO",
"klump/strings/STRINGS.RECIPE_DESC.POTATO_SOUP",
-- Additional string entries...
}
Generation Process
Build Script Integration
The klump.py
script scans for encrypted assets and generates this file during the build process:
- Asset Discovery: Scans designated directories for
.klump
encrypted files - Path Processing: Generates standardized paths with
klump/
prefix - File Generation: Creates the Lua module with the complete file list
- Build Integration: Updates the file as part of the automated build pipeline
File Categories
Asset Files:
images/
- Texture and image filesanim/dynamic/
- Animation data filessounds/
- Audio files (if applicable)
String Files:
strings/
- Localized text data- Format:
strings/STRINGS.CATEGORY.ITEM_NAME
Integration with Klump System
Loading Process
- Module Import:
require("klump_files")
returns the file list - Path Processing: Removes
klump/
prefix for internal handling - Type Detection: Identifies string files by
strings/
prefix - Cipher Resolution: Retrieves decryption keys from player profile
- Conditional Loading: Only loads files with valid ciphers
Festival Event Context
The klump_files registry is primarily used during festival events:
- Quagmire Festival: Contains food-related assets and strings
- Event Activation: Files are loaded when festivals become active
- Dynamic Content: Enables secure distribution of event-specific content
File Path Conventions
Asset Path Format
klump/[category]/[subcategory]/[filename].[extension]
Examples:
klump/images/quagmire_food_inv_images_potato.tex
klump/anim/dynamic/potato.dyn
String Path Format
klump/strings/[string_hierarchy]
Examples:
klump/strings/STRINGS.NAMES.POTATO
klump/strings/STRINGS.RECIPE_DESC.POTATO_SOUP
Security Considerations
Encrypted Content
- File Encryption: All listed files are encrypted klump assets
- Cipher Dependency: Files cannot be loaded without valid decryption keys
- Access Control: Player profiles control which ciphers are available
Content Distribution
- Secure Distribution: Encrypted files can be distributed without exposing content
- Progressive Unlocking: Content becomes available as players earn ciphers
- Event-Based Access: Ties content availability to festival participation
Performance Impact
Loading Optimization
- Batch Processing: Enables efficient loading of multiple related files
- Conditional Loading: Only attempts to load files with available ciphers
- Progress Tracking: Used with
IsKlumpLoaded()
to prevent duplicate operations
Memory Considerations
- Registry Size: File list is kept minimal to reduce memory overhead
- On-Demand Loading: Files are loaded only when needed during events
- Cleanup Potential: Registry could support unloading unused content
Debugging and Development
Empty Registry State
The current empty state return {}
indicates:
- No encrypted assets are currently registered
- Development/testing environment without klump content
- Possible build configuration excluding encrypted content
Development Workflow
-- Check available klump files during development
local files = require("klump_files")
print("Available klump files:", #files)
for i, file in ipairs(files) do
print(i, file)
end
Related Modules
- klump: Main encrypted file loading system
- json: Used for parsing encrypted string data
- events: Festival event system that triggers klump loading
- Profile: Stores cipher keys for decryption
Build System Integration
Automated Generation
- Script:
klump.py
generates this file automatically - Timing: Updated during build process before asset packaging
- Dependencies: Requires access to encrypted asset directories
- Output: Overwrites existing klump_files.lua with current asset list
Validation
- Asset Verification: Build script validates that listed files exist
- Path Consistency: Ensures all paths follow established conventions
- Cipher Compatibility: Verifies that encryption keys are properly generated
Future Considerations
Potential Enhancements
- Categorization: Group files by event or content type
- Metadata: Include file size, version, or dependency information
- Validation: Add checksums or integrity verification data
Scalability
- Multiple Events: Support for various festival events beyond Quagmire
- Version Management: Handle multiple versions of encrypted content
- Selective Loading: More granular control over which files to load