Skip to content

Repository files navigation

DevResources - By OpenSwordigo Team

License C++ Standard Build System Graphics API Windowing

1. Description

OpenSwordigo is an planned open-source game engine reconstruction. It recreates the proprietary Caver engine from Touch Foo in C++17.

Scene Graph Architecture

  • 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.

PowerVR Asset Loaders

  • Caver::PVRTCDecoder and Caver::PVRLoader: Decompress hardware PVRTC1 and ETC1 texture streams directly to RGBA8888 pixel buffers.
  • Caver::PODLoader: Reads binary PowerVR .POD mesh containers. It extracts vertex positions, normal vectors, UV coordinates, and element index arrays.

Graphics Engine

  • 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.

2.5 Scripting and Configuration

  • 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.

2.6 Reverse Engineering Data

  • 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/ and rln/ directories.

3. Project Directory Layout

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

4. Software Prerequisites

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.

5. Build Instructions

Follow these steps to compile OpenSwordigo from source code.

Step 1: Install Software Dependencies

On Ubuntu or Debian Linux

Run this command to install the required packages:

sudo apt update
sudo apt install build-essential cmake pkg-config libsdl3-dev libgl1-mesa-dev

Step 2: Configure the CMake Build System

Run this command in the repository root directory:

cmake -B build -S . -DCMAKE_BUILD_TYPE=Release

This command creates a build directory and generates the makefiles.


Step 3: Compile the Target Executables

Run this command to build all targets:

cmake --build build -j$(nproc)

7. Engine Data Flow Architecture

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"]
Loading

9. Legal Notice and Trademarks

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.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages