Object-Oriented Entity-Component-System Design

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

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

    Gaming meets modern C++ - a fast and reliable entity component system (ECS) and much more

  • > Anyone solved this before?

    Sure. Take a look at EnTT[1], a popular C++ ECS library. It comes with two main tools to deal with this: Sorting[2] and groups[3]. EnTT gives you a large spectrum of tools with different trade-offs so that you can tune your code based on usage patterns. Obviously different bits of code will have conflicting access patterns, so there's no one-size-fits-all solution, but EnTT lets you optimise the patterns that are most important to you (based on profiling, hopefully).

    [1] https://github.com/skypjack/entt

    [2] Sort one component to be in the same order as another component, so that they can be efficiently accessed together: https://github.com/skypjack/entt/wiki/Crash-Course:-entity-c...

    [3] https://github.com/skypjack/entt/wiki/Crash-Course:-entity-c...

  • habitat

    Modern applications with built-in automation

  • Personal anecdote: Habitat was developed as a sort of application deployment / configuration management tool in Rust, and the architecture there is roughly equivalent to an ECS. I found it a joy to work with and work on. Not sure if it's fundamentally a better software pattern, but it at least meshes with my brain better than how most OO-style software is laid out.

    https://github.com/habitat-sh/habitat

  • 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
  • froggy

    Component Graph System experiment

  • What I found in practice is that many people start using the ECS for speed, and then draw themselves into a corner of the design space. Now they have to weight every step on "how would it work in ECS?", and dedicate effort to fight the ECS paradigm.

    For example, a mesh may contain multiple materials. Is each material chunk a separate entity? Or maybe each bone in a skeleton is a separate entity with its own "parent" and "transform" plus other component.

    One of the different approaches is component graph systems [1]. It lacks the ability to mix and match components, but provides a more natural (and simpler) model to program for.

    [1] https://github.com/kvark/froggy/wiki/Component-Graph-System

  • Hazel

    Hazel Engine

  • IIRC, all those engines provide an ECS that could be compared to entt.

    Also, there is Hazel[0] which is based on entt and is the subject of an amazing youtube series[1].

    IMHO, tinier means less features, at that point what could be considered comparable?

      [0] - https://github.com/TheCherno/Hazel

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