Skip to content

Notes and links for my talk "ECS from Scratch" for IGDA DC, Tues. Sept. 24 2019

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-Apache-2.0
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

mysterycommand/ecs-from-scratch

Repository files navigation

ECS from Scratch

Notes and links for my talk for IGDA DC, Tues. Oct 29, 2019. Slides on Projector.

Outline

  1. Who am I?
    • … and why listen to me?
  2. What is an ECS (and DOD)
    • comparison to OOP
    • entities ("just indexes" - generational indexes)
    • components (just data - e.g. "primitive" or value types)
    • archetypes - groups of components
    • systems - functions that run on queried (by component) groups of entities
    • queries - groups of entities with certain sets of components
    • resources - like "shared components" … usually read only from the perspective of systems
    • jobs - scheduling systems that are dependent on other systems (physics, parent/child transforms)
  3. Why use it?
    • performance
    • prototyping & rapid iteration
    • serializable (and therefore streamable)
  4. A very simple implementation from scratch
    • JavaScript
    • no generational indexing (limited to 2^53 - 1 (or 9,007,199,254,740,991) entities)
    • no querying/caching, all systems run on all entities (in a "world")
    • systems:
      • activate/deactivate - lifetime
      • update - fireworks, boids, metaballs, boundaries?, gravity?
  5. Unity
    • very new (lots of flux - documentation missing or like, immediately out of date)
    • where to start (no GameObjects, no MonoBehaviors) - RuntimeInitializeOnLoadMethod
    • Pure ECS
    • Project Tiny
  6. Other applications
    • Effects & shader graphs
    • Cloud architecture (API as data/components, "functions as a service" as systems)
    • Intersectional feminism?

      a branch of feminism asserting how different aspects of social and political identity discrimination overlap--for example, race with gender. It is a qualitative analytic framework that identifies how interlocking systems of power affect those who are most marginalized in society. --Wikepedia (emphasis mine)

Links

Personal favs

Unity

Source code (GitHub)

Also collected (by me) in a single playlist: Unity DOTS & ECS - Unite Copenhagen 2019

Other implementations

Misc

Some 2D / Sprite stuff:

Notes

See ./notes.

Scratchpad:

const sim = createSim();
sim.addResource('keyboard' /* do something to init the keyboard */);
sim.addResource('mouse' /* do something to init the mouse */);
sim.addResource('gamepad' /* do something to init the gamepad */);

const world = createWorld(sim /* whatev */);
world.addEntities(count, withComponents); // maybe a config, like { count: number, withComponents: Component[] }
world.registerSystem(query, system); // cache & invalidate queries

// use a functional style
// emitters ... a default "is active" component?

About

Notes and links for my talk "ECS from Scratch" for IGDA DC, Tues. Sept. 24 2019

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-Apache-2.0
MIT
LICENSE-MIT

Stars

Watchers

Forks

Packages

No packages published