Hasty Briefsbeta

Bilingual

Show HN: Evolved.lua – An Evolved Entity Component System for Lua

a year ago
  • #Game Development
  • #Lua
  • #ECS
  • evolved.lua is a fast and flexible ECS (Entity-Component-System) library for Lua.
  • It uses an archetype-based approach for storing entities and components in contiguous arrays (SoA) for performance.
  • The library minimizes GC pressure and avoids unnecessary allocations.
  • Provides a simple and intuitive API with self-explanatory functions.
  • Supports complex systems with features like queries, deferred operations, batch operations, and systems processing.
  • Entities and fragments are identifiers, with fragments representing component types.
  • Components are any data attached to entities via fragments.
  • Uses chunks to group entities with the same component sets for efficient processing.
  • Structural changes (adding/removing fragments) migrate entities between chunks and should be minimized for performance.
  • Supports deferred operations to queue structural changes.
  • Batch operations allow efficient modifications across multiple entities.
  • Systems can be organized into groups and processed in specific orders.
  • Provides hooks for component lifecycle events (set, assign, insert, remove).
  • Includes features like tags (fragments without components), unique fragments, and explicit fragments.
  • Supports component duplication and default values.
  • Allows setting destruction policies for fragments (destroy entity or remove fragment).
  • Debug mode helps catch incorrect API usage.
  • Installable via luarocks or by cloning the repository.