Lua-driven game engine core built on Raylib, Box2D, and pure chaos energy.
T3 Engine is a C++ game engine project with a scripting-first runtime.
Core systems are bootstrapped in C++, then gameplay behavior is driven through Lua hooks, scene loading, and runtime objects.
Also i will be glad if you join my Discord!
- Hook-based gameplay model (global hooks + per-object hooks).
- Lua-first runtime API (
T3,scene,physics,gui, and more). - Box2D physics with Lua collision callbacks.
- Render pipeline supporting sprites, brushes, models, and shaders.
- Scene loading path that combines XML scene data with Lua setup logic.
- Addon loading for modular logic packs.
flowchart TD
mainEntry["main()"] --> addonsInit["addons::init()"]
addonsInit --> physicsInit["physics::init() + body::init()"]
physicsInit --> netInit["networking::init()"]
netInit --> argsProcess["arguments::process(...)"]
argsProcess --> windowInit["windowClass::init()"]
windowInit --> fsInit["fs::init()"]
fsInit --> luaBoot["lua init + class import"]
luaBoot --> sceneBoot["scene::lua() + scenes::test()"]
sceneBoot --> gameLoop["window->process() loop"]
gameLoop --> hooksRun["Lua hooks: think/physics/gui/input"]
Render/- renderables, sprites, textures, shaders, models, tiles.Physics/- world init, rigidbodies, collision callbacks, ray traces.LUA/- Lua state bootstrap, function bindings, class bridge, intervals.Scene/- scene and tileset loading, XML-driven map logic.Input/- keyboard, pointer, gamepad, mobile input handling.GUI/- GUI classes and manager integrations.Networking/- networking init and function stubs.Addons/- addon discovery and helper functions.
T3 Engine/
|- main.cpp
|- window.h
|- Arguments/
|- Addons/
|- GUI/
|- Input/
|- LUA/
|- Networking/
|- Physics/
|- Render/
|- Scene/
|- Sensors/
|- Errors/
|- Animations/
`- (third-party headers/sources: raygui, json, pugixml, etc.)
The runtime argument parser is defined in Arguments/process.h.
--help- print help information and exit.--say=text- print text to terminal and exit.--lua=code- execute Lua code and exit.--skip-logo- skip the logo sequence.--scene=scenename- force-load a scene.--debug- force debug mode.--windowed- run in windowed mode.--w=width- set window width.--h=height- set window height.
./T3-engine --help
./T3-engine --scene=main --debug --windowed --w=1280 --h=720
./T3-engine --lua="print('hello from lua')"This folder does not currently include a build manifest (CMakeLists.txt, Makefile, etc.), so exact compile/link commands are project-environment dependent.
raylib/rlgl/raymathrayguibox2dlua(C API)LuaBridgepugixmlnlohmann/jsoncpp-httplib(header present)mapbox/earcut(header present)
- Add canonical Linux/Windows build commands.
- Document compiler standard and required flags.
- Pin dependency versions.
- Document expected output binary name/path.
- Add a one-command dev build entrypoint (for example via CMake or Make).
If you are new to this codebase, start here:
main.cpp- startup order and subsystem bootstrap.window.h- runtime loop and hook dispatch.LUA/Manager.h- Lua lifecycle and class imports.Scene/loader.h- scene ingestion and object setup flow.Render/renderable.h- base runtime render object model.
Recommended first steps:
- Run the binary with
--help. - Run a specific scene with
--scene=.... - Trace how hooks fire from input/physics/render ticks.
- Inspect how Lua classes are imported and attached to runtime objects.
- Runtime asset paths are expected by code (
assets/...,scenes/...,addons/...). - Keep docs aligned with behavior in
main.cppandArguments/process.has systems evolve.