Remix.run Logo
pjmlp 5 days ago

A pattern that relies on OOP constructs like protocols, interfaces, traits, depending on which language is being used.

Arrays and structures mappings isn't ECS, that is Data Oriented Design,

https://en.m.wikipedia.org/wiki/Data-oriented_design

nickitolas 5 days ago | parent [-]

Since you already quoted wikipedia, here's what it says about ECS:

https://en.wikipedia.org/wiki/Entity_component_system

> Entity–component–system (ECS) is a software architectural pattern mostly used in video game development for the representation of game world objects. An ECS comprises entities composed from components of data, with systems which operate on the components.

> Entity: An entity represents a general-purpose object. In a game engine context, for example, every coarse game object is represented as an entity. Usually, it only consists of a unique id. Implementations typically use a plain integer for this

> Common ECS approaches are highly compatible with, and are often combined with, data-oriented design techniques. Data for all instances of a component are contiguously stored together in physical memory, enabling efficient memory access for systems which operate over many entities.

> History > In 1998, Thief: The Dark Project pioneered an ECS.

So, according to wikipedia:

- An entity is typically just a numeric unique id

- Components are typically physically contiguous (i.e an array)

- Their history began with Thief pioneering them in 1998

pjmlp 5 days ago | parent [-]

I was rather expecting code examples, so that we could deconstruct the language primitives being used for the implementation from a CS language semantics point of view.