Jump to content

Entity Component System (ECS)


Dan Milward
 Share

Recommended Posts

What is an ECS?

 

An ECS allows game objects to perform custom operations without any additional manager code.

 

In an ECS, all objects in a game world are represented as entities; their properties are represented as components; and the game has systems to update entities and components.

 

Yes. So why am I posting this?

Because we've just overhauled entities in kiwi.js and written up quite a big post on it. Take a squiz... let me know what you think :)

 

http://www.kiwijs.org/2015/02/kiwijs-v1-2-0-entity-component-system/

 

 

Link to comment
Share on other sites

While you have implemented a good composition over inheritance paradigm here this line bothers me a little

 

and the game has systems to update entities

 

Because in your architecture the logic has been moved from systems to components.

 

Wikipedia:

 

 

Component: the raw data for one aspect of the object (...)

System: "Each System runs continuously (as though each System had its own private thread) and performs global actions on every Entity that possesses a Component of the same aspect as that System."

 

 

And by the aspect we can understand a mask made out of components  - for example - system Movable has a mask reflecting Velocity and Position (components).

Then it loops through all the entities and if they have Velocity and Position components - the logic from that system (Movable) is applied.

 

Anyway - take my point with a pinch of salt as I don't have enough experience with this approach to tell if it will scale well (especially in terms of decoupling).

 

ref: http://www.gamedev.net/page/resources/_/technical/game-programming/understanding-component-entity-systems-r3013

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...