Skip to content

miguelibero/darmok

Repository files navigation

darmok

Dathon trying to explain the importance of Darmok

C++ game engine combining opensource libraries & tools that I like

currently using:

planned to use:

Trying to target the following platforms:

  • desktop (windows, macos, linux)
  • mobile (iOS, Android) (pending)

Some philosofical decisions (could be controversial)

  • use modern C++ (20) patterns where possible
  • use as much stl as possible (need to look into memory management at some point)
  • no naked pointers
  • throw exceptions for error handling
  • try to keep the API similar to Unity3D (where it makes sense) so that it's easy to port game logic

WARNING: currently in early stages of development

Frequently Asked Questions

  • Will it have feature X?

Depends on what I need. Anyone is welcome to fork and submit PRs.

Current State

I'm still learning CMake, so if you see something that should be fixed please let me know.

Working features

  • bgfx window setup (GLFW on windows & linux)
  • update logic methods with delta time
  • renderer
    • point, spot, directional & ambient lights
    • forward render
      • unlit, gui
      • basic phong
      • PBR metallic-roughness
    • cascaded shadow mapping
    • spot & point light shadows
    • camera culling (frustum, occlusion seems to be broken)
  • entity component scene using entt
    • transform, camera
    • type filtering
    • serialization
    • lights
    • free look
  • sprites and spritesheets
  • loading models using assimp (FBX, gltf, etc...)
  • serializing models from assimp into binary using cereal
  • lua scripting
    • lua debugging
    • coroutines similar to unity
  • multiple UI options
    • imgui for tooling
    • RmlUI for ingame (support for multiple canvases)
  • skeletal animations using ozz (reading from binary)
  • 3d physics using jolt
    • rigidbodies
    • character controller
  • tool to export asset folders
    • shaders & vertex layouts
    • copy files
    • assimp to custom binary model format
    • ozz skeleton & animations
  • dynamic font texture generation
  • play sounds and music (wav & mp3)

Upcoming

  • frame limiting
  • more renderer features
    • bloom
    • deferred, clustered
    • SSAO
  • luajit support (maybe compile using importer)
  • text improvements
    • finish all the TextRenderConfig options
    • dynamic distance field rendering with border support
  • clipboard text support (UTF8)
  • asset loading progress (maybe implement progressive loading)
  • possible refactors
    • maybe replace Data for std::vector<uint8_t> and DataView for std::span<uint8_t>
    • loaders should return unique_ptr
    • move lua bindings to separate library?
    • C++ coroutines could be useful in some places
  • more stuff serialization
    • binary texture atlas
    • material
  • custom UI module (rmlui is nice but slow)

In the future

  • fix occlusion culling
  • more unit tests
  • performance profiling
  • 2d physics
  • instancing
  • 3d physics materials
  • multithreaded updates (Ubisoft)
  • support multiple imgui app components with different transforms
  • spine animations
  • unify use of allocators everywhere
  • progressive asset loaders
  • lua debugging would be nice
  • particle systems (maybe effekseer)
  • more sound options (spatialization, effects)
  • animation root motion
  • openusd scene format support
  • a game editor would be a huge undergoing, but maybe using wxWidgets

Interesting Related Projects

Example code

function init()
    local program = Program.new(StandardProgramType.Forward)

    local scenes = app:add_component(SceneAppComponent)
    local scene = scenes.scene

    local camEntity = scene:create_entity()
    local camTrans = camEntity:add_component(Transform, { 0, 1, -1 })
    camTrans:look_at({ 0, 0, 0 })
    local cam = camEntity:add_component(Camera)
    cam:set_viewport_perspective(60, 0.3, 1000)
    cam:add_component(ForwardRenderer)
    cam:add_component(LightingRenderComponent)

    local lightEntity = scene:create_entity()
    lightEntity:add_component(AmbientLight, 0.2)
    lightEntity:add_component(Transform, { 1, 1, -1 })
    local light = lightEntity:add_component(PointLight, 2)
    light.radius = 5

    local mesh = MeshData.new_sphere():create_mesh(program.vertex_layout)
    scene:create_entity():add_component(Renderable, mesh, program, Color.green)
end