ECS engine in C++ in Lua

This page summarizes the projects mentioned and recommended in the original post on /r/gamedev

Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
  • flecs-lua

    Lua script host for flecs

  • I think this is my best bet if only the maintainer stabilises the library. The last commit says this is still WIP and has some issues https://github.com/flecs-hub/flecs-lua/commit/895d3cb670827236a2740ccd6d4d477b899590df. Shame because the library looks great. The Lua API is pretty much perfect and I'd love to use it. But the repository has had 2 commits in the last 2 years, and the 3.2.x bindings are not stable yet.

  • luaffi

    Discontinued Standalone FFI library for calling C functions from lua. Compatible with the luajit FFI interface.

  • But there are better abstractions available. Look at either luajit's ffi or the standalone luaffi to see how you can define structures from lua that write directly to memory instead of using tables.

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
  • nata

    Entity management for Lua.

  • You could also consider a pure lua ECS like nata. Writing perf-critical stuff in C++ and everything else in lua with completely separate ECS might not be as terrible as it sounds if they're different domains (all rendering done from C++ but all gameplay in lua). You can probably afford to do more in lua than you expect (it's quite fast and most games are quite small).

  • awesome-love2d

    A curated list of amazingly awesome LÖVE libraries, resources and shiny things.

  • love2d is open source and runs on PC and phones. Someone's even ported it to Nintendo3DS/Switch homebrew. nata is the ECS I use, but you can also checkout more libraries on awesome-love2d. I really enjoy using love2d (especially if you enjoy the engine building parts), but one caveat is that major version number bumps will break compatibility. It's usually easy to port and they deprecate functions long in advance. But there's lots of old libraries out there for older versions that won't just work on the latest love2d (like the code for Harvard's CS50 course).

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts