Skip to content

Instantly share code, notes, and snippets.

@paniq
Last active November 6, 2024 09:55
Show Gist options
  • Save paniq/c32ac8447a7cc5c33a45 to your computer and use it in GitHub Desktop.
Save paniq/c32ac8447a7cc5c33a45 to your computer and use it in GitHub Desktop.
Entity Component Systems

Entity Component Systems

collecting links and documents about the topic

Articles

Object Systems (2004, as used in Thief 1998) http://chrishecker.com/images/6/6f/ObjSys.ppt

A Data Driven Game Object System (GDC 2002) http://scottbilas.com/files/2002/gdc_san_jose/game_objects_slides_with_notes.pdf

A Dynamic Component Architecture for High Performance Gameplay (GDC 2010) http://www.insomniacgames.com/a-dynamic-component-architecture-for-high-performance-gameplay/

Building a Data-Oriented Entity System (C++, 2014) http://bitsquid.blogspot.com.au/2014/08/building-data-oriented-entity-system.html http://bitsquid.blogspot.com.au/2014/09/building-data-oriented-entity-system.html http://bitsquid.blogspot.com.au/2014/10/building-data-oriented-entity-system.html http://bitsquid.blogspot.com.au/2014/10/building-data-oriented-entity-system_10.html

Comparison of Doom 1, Quake, and Doom 3 entity references system http://blog.noctua-software.com/entity-references.html

Adam Martin. Entity Systems are the future of MMOG development http://t-machine.org/index.php/2007/09/03/entity-systems-are-the-future-of-mmog-development-part-1/, 2007

Jeff Plummer. A flexible and expandable architecture for computer games https://www.tjhsst.edu/~rlatimer/techlab07/plummer_thesis.pdf , 2004

The Components and Systems of Morgan's Raid http://paulgestwicki.blogspot.ru/2012/03/components-and-systems-of-morgans-raid.html

Dungeon Siege https://web.archive.org/web/20150418070828/http://scottbilas.com/games/dungeon-siege

Data Structures for Entity Systems: Contiguous memory http://t-machine.org/index.php/2014/03/08/data-structures-for-entity-systems-contiguous-memory/

Implementations

Artemis-odb a high performance java based Entity-Component-System framework https://github.com/junkdog/artemis-odb

@lostdj
Copy link

lostdj commented Nov 13, 2015

Some food for thought on "low memory usage, cache friendliness, O(1) access, that sort of stuff" http://t-machine.org/index.php/2014/03/08/data-structures-for-entity-systems-contiguous-memory/

@junkdog
Copy link

junkdog commented Nov 14, 2015

Top of the list: recycle int entity ids, and make sure that component types can be represented by an int too - this opens up to using ids as indices into component arrays, and bitsets can be used in a lot of places - primarily as fast lookup caches.

artemis-odb has a lot java specific stuff, but it does a couple of things I haven't seen elsewhere in open source land:

  • entity subscriptions - i.e. a view of all entities matching a certain component composition - should be interactable from outside systems. Good for stuff like bootstrapping entities etc ("transient" components, like textures, can't be serialized, but this approach makes a generic serialization approach pretty easy):
world.getAspectSubscriptionManager()
    .get(all(Size.class, TextureReference.class).exclude(Renderable.class))
    .addSubscriptionListener(
        new SubscriptionAdapter(world) {
            @Override
            protected void inserted(Entity e) {
                assignRenderable(e);
            }
    });

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment