Zaya-Engine Svelte Themes

Zaya Engine

Vulkan PBR forward renderer (C++) paired with a Svelte editor (Electron TypeScript).

Zaya Engine

A small Vulkan game engine with a separate Electron-based editor.

Showcase video on YouTube, click on the image:

Backend (C++) is a Vulkan PBR forward renderer. Frontend (editor, TypeScript) is an Electron app written in Svelte. These layers communicate between each other using a WebSocket.

Features

Renderer (Vulkan)

  • PBR forward renderer
  • HDR equirectangular skybox loading and runtime environment switching
  • SSAO with a normals prepass and separable blur (courtesy of Claude Code)
  • Asset loading via Assimp — .obj, .gltf and other Assimp-supported formats
  • Double-buffered frame-in-flight rendering, dynamic swapchain recreation
  • ImGuizmo transform handles

ECS

  • Built-in components: Transform, MeshRenderer, Camera, Light, Name, LuaScript

Lua scripting (sol2)

  • Per-entity environments with OnStart(entity) / OnUpdate(entity, dt) lifecycle
  • Bound APIs: Entity (get/set position, rotation, scale), Input.isKeyHeld, Time.deltaTime
  • Use via editor's LuaScriptComponent

Editor (Electron + Svelte 5)

  • Native engine viewport embedded inside the Electron window
  • Hierarchy panel, Inspector with per-component editors, Asset browser, Settings view
  • Transform gizmos (translate / rotate / scale)
  • HDR environment picker, mesh import, material editor

Two run modes

  • ZayaEditor — engine + editor bridge for authoring
  • ZayaRuntime — standalone runtime that loads a scene and runs scripts, doesn't load websocket stuff

Architecture

The engine and editor are separate processes that communicate over a local WebSocket.

The editor sends typed commands (e.g. scriptComponent.scriptPath, input.key, transform edits) as JSON; the engine dispatches them through CommandDispatcher to handlers registered by each system. This split means the editor can be developed, hot-reloaded, and restyled entirely in the JS/Svelte ecosystem without rebuilding C++.

Requirements

  • Windows (the engine uses Win32 APIs for window embedding; not portable as-is)
  • Vulkan SDK
  • Visual Studio 2022 with the C++ workload, plus msbuild on PATH
  • premake5 on PATH (for regenerating project files)
  • Node.js with pnpm (npm also works)

Build & run

First-time setup (installs editor dependencies):

pnpm run install:editor

Build the engine and launch the editor:

pnpm run dev:engine

Run only the editor frontend, skipping the engine build (useful for UI work):

pnpm run dev:noengine

Regenerate Visual Studio project files after changing premake5.lua:

pnpm run build:engine

Project layout

engine/             C++ engine sources and vendored dependencies
  src/              First-party engine code
    ECS/            Component pools, scene, systems
    editor/         WebSocket bridge, EditorLayer, gizmos
    runtime/        Standalone runtime entry point
    core/           Window, scene manager, config
  vendor/           assimp, glfw, imgui, ixwebsocket, lua, sol2, ...
editor/             Electron + Svelte editor
  src/main/         Electron main process
  src/renderer/     Svelte UI (Hierarchy, Inspector, Asset browser, ...)
assets/             Sample scenes, meshes, shaders (GLSL + SPIR-V), textures, scripts
config/             Engine.ini

Sample script

-- assets/scripts/example.lua
local speed = 5.0

function OnStart(entity)
    print("OnStart: entity " .. tostring(entity.id))
end

function OnUpdate(entity, dt)
    local pos = entity:getPosition()
    local dx, dz = 0, 0
    if Input.isKeyHeld("W") then dz = dz - speed * dt end
    if Input.isKeyHeld("S") then dz = dz + speed * dt end
    if Input.isKeyHeld("A") then dx = dx - speed * dt end
    if Input.isKeyHeld("D") then dx = dx + speed * dt end
    if dx ~= 0 or dz ~= 0 then
        entity:setPosition(pos.x + dx, pos.y, pos.z + dz)
    end
end

Third-party

Vendored under engine/vendor/: Assimp, GLFW, Dear ImGui + ImGuizmo, IXWebSocket, Lua, sol2, nlohmann/json, simpleini, SPIRV-Reflect, stb. Each retains its original license.

The ECS is based on David Colson's "Making a Simple ECS".

License

MIT — see LICENSE.

Top categories

Loading Svelte Themes