Understanding ShiVa3D Architecture

Core Components

ShiVa3D consists of three major parts:

  • ShiVa Editor: The main development environment for UI, logic, and asset management.
  • Authoring Tool (ShiVa Authoring Tool): Used to export builds for various platforms.
  • Runtime Engine: Platform-specific executable that runs compiled games or simulations.

Plugin and Scripting Model

Game logic in ShiVa is written primarily in LUA, with the option to extend functionality using native plugins written in C/C++. These plugins are critical for integrating third-party SDKs (analytics, ads, IAP) and accessing platform-specific features.

Common Issues in Enterprise Development

1. Cross-Platform Build Failures

One of the most frequent challenges arises when exporting to platforms like Android or iOS. Failures often result from:

  • Mismatched SDK versions (NDK, JDK, Xcode).
  • Incorrect plugin manifest entries or architecture flags.
  • Missing or incorrectly configured export modules in the Authoring Tool.
[Export Error]
Missing ARMv7 plugin binaries for iOS target.

2. Asset Loading Inconsistencies

Assets such as textures, models, and animations may behave differently across platforms due to:

  • Case-sensitive file systems (Linux, Android).
  • Incorrect asset import formats or compression settings.
  • Async loading race conditions not handled in script logic.

3. Runtime Crashes and Memory Leaks

Crashes are often caused by:

  • Unmanaged memory in C++ plugins.
  • Incorrect use of engine APIs (e.g., `object.destroy` before cleanup).
  • Circular references in LUA scripts preventing garbage collection.

Diagnostics and Debugging Techniques

Enable Verbose Logging

Use the Debug Console in the ShiVa Editor or device logs (ADB, Xcode console) to trace lifecycle events, asset loading sequences, and memory usage.

Validate Plugin Integration

Ensure plugin manifests correctly declare supported architectures and functions. Test each plugin in isolation before bundling into main builds.

<plugin name="AdNetworkPlugin" version="1.0" platform="android" arch="armeabi-v7a"/>

Use Platform Profilers

Use tools like Instruments (iOS), Android Profiler, or Valgrind (desktop) to monitor memory, CPU, and I/O during runtime. Profile complex scenes and transitions to identify bottlenecks.

Step-by-Step Troubleshooting Guide

1. Resolve Build Configuration Issues

Ensure all export modules are up-to-date. Validate toolchain paths and use compatible versions of NDK (r19 for stable exports) and Xcode (12.x for iOS 14 support).

2. Standardize Asset Naming and Format

Enforce lowercase, underscore-separated filenames. Convert assets to engine-preferred formats (e.g., PNG for textures, FBX 2011 for models).

3. Audit and Refactor LUA Logic

Modularize scripts to avoid state retention across scenes. Use weak tables or manual cleanup to manage dynamic object references.

local cache = setmetatable({}, { __mode = "v" })
-- allows garbage collection of cached objects

4. Isolate and Test Native Plugins

Create standalone test apps to validate each plugin's memory behavior, API calls, and threading model. Avoid heavy JNI or Objective-C bridging in critical paths.

Best Practices for Scalable ShiVa3D Development

  • Keep plugin interfaces minimal and stable.
  • Version control all resource files and binary exports.
  • Use the Simulation Viewer to validate behavior before committing to mobile builds.
  • Monitor FPS and draw calls across target devices regularly.
  • Batch similar assets and optimize texture atlases for mobile memory constraints.

Conclusion

ShiVa3D offers flexibility and cross-platform reach, but scaling its use in professional-grade projects requires attention to detail in build configuration, asset management, plugin architecture, and runtime performance. By adopting disciplined debugging techniques, validating integrations early, and optimizing scripts and memory usage, developers can maintain stability and performance across diverse deployment targets.

FAQs

1. Why do my ShiVa3D exports fail on Android?

This often results from outdated or mismatched NDK versions, missing plugin binaries, or incorrect manifest declarations. Validate your toolchain and rebuild export modules.

2. How can I detect memory leaks in ShiVa3D?

Use native profiling tools like Valgrind or Instruments. In LUA, monitor table growth and use weak references to assist garbage collection.

3. What causes asset loading failures on mobile?

Most failures stem from file name case mismatches or improper import settings. Ensure consistent naming and test assets on target file systems.

4. Are all ShiVa3D plugins cross-platform?

No, plugins must be built and declared per-platform with correct architecture flags. Validate each target separately in the Authoring Tool.

5. How can I improve performance on mobile devices?

Minimize draw calls, batch textures, avoid runtime object instantiation, and profile regularly with device-native tools.