Understanding the Problem
What is Resource Serialization in ShiVa3D?
ShiVa3D uses a proprietary format to serialize scenes, materials, AI models, and textures. During export, these resources are transformed into platform-specific formats optimized for performance. However, serialization is highly sensitive to changes in resource references, dependency resolution order, and export settings. A single missing flag or version mismatch can result in invisible assets, logic failures, or broken shaders at runtime.
Symptoms of Serialization Failure
- Assets (models, textures, AI) work in editor but not in exported builds
- Inconsistent behavior across iOS, Android, and Windows
- Crash logs indicating missing resource handles or corrupted buffers
Architectural Implications
Asset Pipeline Complexity
ShiVa3D projects rely on a centralized resource system. Improper management of UUIDs, stale cache files, or duplicate resource names can cause internal mapping failures during serialization. Teams often overlook this complexity in rapid prototyping workflows.
Platform Abstraction Layer
Each target platform interprets compiled ShiVa packages slightly differently. Android and iOS have stricter memory and file path constraints, which amplify any serialization issues originating from PC-based exports.
Diagnostics
Step-by-Step Debugging
- Use the ShiVa Authoring Tool's verbose export logs. Enable
Debug Resource Warnings
in the export profile. - Cross-check exported resource paths in the
.STK
archive using external tools or file inspectors. - Test assets in the standalone ShiVa Player before full deployment to isolate runtime issues.
- Use logging functions in Lua (e.g.,
log.message()
) to verify if resources are loading as expected.
if ( application.getCurrentUserLocale ( ) == "fr" ) then log.message ( "Loaded French assets." ) else log.message ( "Loaded default assets." ) end
Common Pitfalls
Referencing Unsaved or Temporary Assets
Developers sometimes test with assets not properly saved or committed to the resource tree. These assets are not serialized, leading to null references in runtime builds.
Incorrect Use of AI Model References
Copy-pasting AI models between projects without re-registering UUIDs creates mismatches during serialization, causing events or state logic to silently fail.
Version Drift Between Editor and Exporter
If the ShiVa Editor and Authoring Tool are not aligned in version, resource packing may differ, resulting in corrupt or unreadable exports.
Fix Strategy
Standardize Asset Workflows
- Use consistent naming conventions and resource hierarchies.
- Commit all assets before exporting builds.
- Run pre-export validation scripts to check for unresolved references.
Validate Export Profiles
Ensure that the correct compression, resolution, and platform flags are set in export profiles. Use separate profiles for each target platform to avoid collisions.
Rebuild Resource Trees
When corruption is suspected, delete intermediate export files and regenerate the resource tree using the Rebuild Resources
option from the ShiVa Editor.
Best Practices
- Keep the ShiVa Editor and Authoring Tool on the same version at all times.
- Test exports on emulators and real devices for each target platform.
- Use logging aggressively in AI Models to detect runtime failures.
- Archive and version resource trees before major updates.
- Automate asset validation using Lua scripts during build staging.
Conclusion
ShiVa3D's resource serialization issues can derail even well-planned game development projects, especially when building for multiple platforms. These problems require a disciplined workflow, robust validation practices, and a strong understanding of the engine's internal packaging system. By isolating serialization points, leveraging built-in logging, and standardizing export procedures, developers can avoid runtime surprises and ship consistent, high-quality games across platforms.
FAQs
1. Why do assets work in the editor but not in the build?
This usually indicates they were not serialized during export—either because they were unsaved, temporary, or excluded by the export profile settings.
2. How can I debug asset loading at runtime?
Use Lua functions like log.message()
and conditional checks to verify asset availability. You can also simulate the runtime environment using the ShiVa Player.
3. What causes AI model failures in exported builds?
Common causes include UUID mismatches, missing event registrations, or serialization order errors during asset copy/paste operations.
4. Is it safe to use the same export profile across platforms?
No. Each platform has specific constraints (e.g., resolution limits, path lengths). Create dedicated export profiles for Android, iOS, Windows, etc.
5. Can I automate resource validation in ShiVa3D?
Yes. Use Lua scripts to check for null handles, missing references, or asset inconsistencies as part of a pre-deployment QA process.