OpenSwordigo is an planned open-source game engine reconstruction. It recreates the proprietary Caver engine from Touch Foo in C++17.
Caver::Scene: Manages root scene objects, camera views, render queues, and viewport projections.Caver::SceneObject: Represents entity nodes using reference counting (Caver::ReferenceCountedObject). It maintains local and world transforms.Caver::ObjectTemplate: Instantiates reusable entity prefabs into scene objects.Caver::ComponentFactory: Maps component names (BackgroundComponent,ModelComponent,GroundMeshComponent,PhysicsObjectComponent) to C++ component classes.
Caver::PVRTCDecoderandCaver::PVRLoader: Decompress hardware PVRTC1 and ETC1 texture streams directly to RGBA8888 pixel buffers.Caver::PODLoader: Reads binary PowerVR.PODmesh containers. It extracts vertex positions, normal vectors, UV coordinates, and element index arrays.
- Uses OpenGL ES 2.0 / OpenGL 3.3 for graphics rendering.
Caver::RenderingContext: Controls state caching, MVP matrices, shader bindings, and draw calls.Caver::ShaderProgram: Compiles and binds OpenGL ES 2.0 vertex and fragment shaders.
- Integrates Lua 5.1 runtime for game scripting.
- Includes LuaFileSystem (
lfs) for file system access. - Includes LuaSocket for network communication.
- Includes TOML-C for configuration file parsing.
- Contains symbol database files (
caver_symbols.txt,caver_rtti.txt,swordigo_defined_symbols.txt). - Includes Ghidra analysis scripts and decompilation files in the
ghidra_scripts/andrln/directories.
The directory layout of OpenSwordigo is shown below:
OpenSwordigo/
├── include/caver/
│ ├── components/ # Engine components (Background, Model, GroundMesh, Physics)
│ ├── graphics/ # OpenGL context, PVRTC decoders, POD loaders, GLES2 shaders
│ ├── math/ # Matrix, vector, and transform math primitives
│ ├── resource/ # Virtual File System (VFS) and custom Protobuf decoder
│ └── scene/ # Scene graph, SceneObject, ObjectTemplate, ComponentFactory
├── src/
│ ├── components/ # C++ component implementations
│ ├── graphics/ # Graphics context and texture/mesh source code
│ ├── math/ # Math calculations and matrix operations
│ ├── resource/ # Asset streaming and protobuf decoding source
│ ├── scene/ # Scene graph logic and component instantiations
│ ├── lua/ # Embedded Lua 5.1 engine source code
│ ├── luafilesystem/ # LuaFileSystem module source code
│ ├── luasocket/ # LuaSocket module source code
│ ├── toml-c/ # TOML parser source code
│ ├── main.cpp # Headless CLI scene parser source (openswordigo_native)
│ └── render_main.cpp # SDL3 OpenGL renderer source (openswordigo_render)
├── ghidra_scripts/ # Reversing scripts and analysis tools
├── caver_symbols.txt # Reconstructed Caver Engine C++ symbol table
├── caver_rtti.txt # RTTI type descriptors and class hierarchy
└── CMakeLists.txt # Primary CMake build configuration file
Before you build OpenSwordigo, install these software tools:
| Tool / Library | Minimum Version | Description |
|---|---|---|
| C++ Compiler | C++17 (GCC 9+, Clang 10+, MSVC 2019+) | Compiles C++ source files. |
| CMake | 3.14 | Configures the build system. |
| SDL3 | 3.0.0 | Controls window creation and user input. |
| OpenGL / GLES2 | 2.0 or 3.3 Core | Renders 2D and 3D graphics. |
| PkgConfig | Any active version | Locates system libraries. |
Follow these steps to compile OpenSwordigo from source code.
Run this command to install the required packages:
sudo apt update
sudo apt install build-essential cmake pkg-config libsdl3-dev libgl1-mesa-devRun this command in the repository root directory:
cmake -B build -S . -DCMAKE_BUILD_TYPE=ReleaseThis command creates a build directory and generates the makefiles.
Run this command to build all targets:
cmake --build build -j$(nproc)The diagram below shows how OpenSwordigo processes game assets and renders graphics:
graph TD
A["Game Assets (.scene, .POD, .pvr)"] --> B["Caver::VFS Asset Engine"]
B --> C["Caver::ProtobufDecoder"]
B --> D["Caver::PODLoader"]
B --> E["Caver::PVRLoader"]
C --> F["Caver::Scene & SceneObject"]
F --> G["Caver::ComponentFactory"]
G --> H["Caver::BackgroundComponent"]
G --> I["Caver::ModelComponent"]
G --> J["Caver::GroundMeshComponent"]
D --> I
E --> H
E --> I
H --> K["Caver::RenderingContext"]
I --> K
J --> K
K --> L["OpenGL ES 2.0 / SDL3 Window"]
OpenSwordigo is an independent open-source project. Developers created this project for educational and software preservation purposes. All trademarks, game assets, artwork, and audio files related to Swordigo belong to Touch Foo.