Flecs 3.1 is out!

3.1 query groups can be used to build massive scenes

What is Flecs?

  • Store data for millions of entities in data structures optimized for CPU cache efficiency and composition-first design
  • Find entities for game systems with a high performance query engine that can run in time critical game loops
  • Run code using a multithreaded scheduler that seamlessly combines game systems from reusable modules
  • Builtin support for hierarchies, prefabs and more with entity relationships which speed up game code and reduce boiler plate
  • An ecosystem of tools to profile, visualize, document and debug projects

Who is using Flecs?

https://github.com/clibequilibrium/EquilibriumEngine

Release Highlights

  • Query Groups. Query groups (example) are a feature that let you group entities/tables, for example based on where they are in the world. Groups are cheap to use, so apps can make fast decisions for lots of entities, like whether a group should be rendered. This enables massive worlds where a game is only doing work where needed, like in this scene with more than 1 million entities (renderer source):
Each color represents a different query group
  • Command batching. The new command batching feature significantly reduces how often components are moved around in memory. Without command batching, each time you add or remove a component all components for an entity are moved to another table. With command batching, multiple add/remove operations are combined into a single table move operation, which can speed up apps by a lot!
  • Faster change detection. The change detection feature is now faster to use than ever, with a new query function (ecs_query_next_table) that just iterates tables in the query cache. This significantly reduces overhead of skipping tables for which nothing has changed, and can make a big difference in apps with lots of tables (example usage).
  • Improved Entity DSL. The entity DSL is a text-based format that lets you describe things like assets, scenes and configuration for your games. In Flecs v3.1 the DSL got a bunch of new features, like support for multiline strings, variables and simple arithmetic expressions:
Variables and expressions in the entity DSL
  • Vscode extension. The entity DSL code now looks a lot better with the new vscode extension! To install it, search for “flecs” in the vscode extension browser, or go through the Visual Studio Marketplace.
  • Custom allocators. Most of Flecs internals now use custom thread-specific allocators, which reduces the number of heap allocations by a lot. This measurably improves performance, as custom allocations can be as much as 60x faster than OS allocations.
  • Improved statistics. Flecs now tracks a lot more statistics that tell you exactly what is happening under the hood. The explorer also got a new statistics page which makes better usage of screen space, and shows a description for each statistic:
Statistics of a running application in the Flecs Explorer
  • World cell partitioning. A new feature has been added to the flecs-game module in Flecs hub that can automatically partition a world. This code can be plugged in directly into projects, or used as example code.
  • Group based rendering. The geometry part of the flecs-systems-sokol module in Flecs hub has been rewritten to take advantage of query groups. The module now uses groups for broad-phase visibility tests and change detection.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store