SlideShare a Scribd company logo
ENTITY COMPONENT SYSTEM
ARCHITECTUREClean, fast and simple with Entitas and Unity
ARCHITECTURE
why it matters
Simon Schmid
Engineer
Clean, fast and simple with Entitas and Unity - Unite Melbourne 2016
Clean, fast and simple with Entitas and Unity - Unite Melbourne 2016
Clean, fast and simple with Entitas and Unity - Unite Melbourne 2016
Clean, fast and simple with Entitas and Unity - Unite Melbourne 2016
Clean, fast and simple with Entitas and Unity - Unite Melbourne 2016
GAME DEVELOPMENT
is hard
GAME ENGINE
ARCHITECTURE
still?
DESIGN PATTERNS
WHY SHOULD I
care
Clean, fast and simple with Entitas and Unity - Unite Melbourne 2016
Clean, fast and simple with Entitas and Unity - Unite Melbourne 2016
Clean, fast and simple with Entitas and Unity - Unite Melbourne 2016
WHY SHOULD I
care
Clean, fast and simple with Entitas and Unity - Unite Melbourne 2016
ENTITY COMPONENT SYSTEM
ARCHITECTURE
ENTITAS#1 ECS ON GITHUB
ENTITAS
clean
fast
simple
ENTITASINTRODUCTION
Clean, fast and simple with Entitas and Unity - Unite Melbourne 2016
Clean, fast and simple with Entitas and Unity - Unite Melbourne 2016
Clean, fast and simple with Entitas and Unity - Unite Melbourne 2016
Clean, fast and simple with Entitas and Unity - Unite Melbourne 2016
Clean, fast and simple with Entitas and Unity - Unite Melbourne 2016
UNITY COMPONENTS:
Data + Behaviour
ENTITAS COMPONENTS
Data only
public class Archer : Troop {
public int health;
public float speed;
// ...
void Awake() {
// ...
}
void Start() {
// ...
}
void Update() {
// ...
}
}
public class Archer : Troop { // Inheritance
public int health;
public float speed; // Data
// ...
void Awake() {
// ...
} // Initialization
void Start() {
// ...
}
void Update() {
// ... // Update
}
}
// Data only - no behaviour
public class PositionComponent : IComponent {
public Vector3 value;
}
public class MovableComponent : IComponent {
}
+------------------+
| Pool |
|------------------|
| e e | +-----------+
| e e---|----> | Entity |
| e e | |-----------|
| e e e | | Component |
| e e | | | +-----------+
| e e | | Component-|----> | Component |
| e e e | | | |-----------|
| e e e | | Component | | Data |
+------------------+ +-----------+ +-----------+
|
|
| +-------------+
| | e | Groups
| | e e |
+---> | +------------+
| e | | |
| e | e | e |
+--------|----+ e |
| e |
| e e |
+------------+
Clean, fast and simple with Entitas and Unity - Unite Melbourne 2016
LOGIC?
Games are interactive simulations
— Maxim Zaks
public class MovementSystem : IExecuteSystem {
public void Execute() {
var movables = Pools.pool.GetGroup(
Matcher.AllOf(
Matcher.Velocity,
Matcher.Position
));
foreach (var e in movables.GetEntities()) {
var pos = e.position.value;
e.ReplacePosition(pos + e.velocity.value);
}
}
}
SINGLE RESPONSIBILITY
principle
SYSTEMS
Chain of Responsibility
+------------+ +------------+ +------------+ +------------+
| | | | | | | |
| System | +---> | System | +---> | System | +---> | System |
| | | | | | | |
+------------+ +------------+ +------------+ +------------+
SYSTEMS
Chain of Responsibility
|-------------------------------- Game Loop --------------------------------|
+------------+ +------------+ +------------+ +------------+
| | | | | | | |
| System | +---> | System | +---> | System | +---> | System |
| | | | | | | |
+------------+ +------------+ +------------+ +------------+
SYSTEMS IN ENTITAS
- Initialize System
- Execute System
- Reactive System
DEMO
Match One
Clean, fast and simple with Entitas and Unity - Unite Melbourne 2016
ENTITAS
▸ clean
fast
simple
CLEAN
Separation of concerns
Composition over Inheritance
Single responsibility principle
Consistency
SEPARATION OF
CONCERNS
Clean, fast and simple with Entitas and Unity - Unite Melbourne 2016
Composition over
INHERITANCE
Clean, fast and simple with Entitas and Unity - Unite Melbourne 2016
Clean, fast and simple with Entitas and Unity - Unite Melbourne 2016
Clean, fast and simple with Entitas and Unity - Unite Melbourne 2016
Clean, fast and simple with Entitas and Unity - Unite Melbourne 2016
Clean, fast and simple with Entitas and Unity - Unite Melbourne 2016
Clean, fast and simple with Entitas and Unity - Unite Melbourne 2016
Clean, fast and simple with Entitas and Unity - Unite Melbourne 2016
Clean, fast and simple with Entitas and Unity - Unite Melbourne 2016
Clean, fast and simple with Entitas and Unity - Unite Melbourne 2016
Clean, fast and simple with Entitas and Unity - Unite Melbourne 2016
Clean, fast and simple with Entitas and Unity - Unite Melbourne 2016
Clean, fast and simple with Entitas and Unity - Unite Melbourne 2016
Clean, fast and simple with Entitas and Unity - Unite Melbourne 2016
Clean, fast and simple with Entitas and Unity - Unite Melbourne 2016
Clean, fast and simple with Entitas and Unity - Unite Melbourne 2016
Clean, fast and simple with Entitas and Unity - Unite Melbourne 2016
Clean, fast and simple with Entitas and Unity - Unite Melbourne 2016
Clean, fast and simple with Entitas and Unity - Unite Melbourne 2016
Clean, fast and simple with Entitas and Unity - Unite Melbourne 2016
Clean, fast and simple with Entitas and Unity - Unite Melbourne 2016
SINGLE RESPONSIBILITY
principle
public class MovementSystem : IExecuteSystem {
public void Execute() {
var movables = Pools.pool.GetGroup(
Matcher.AllOf(
Matcher.Velocity,
Matcher.Position
));
foreach (var e in movables.GetEntities()) {
var pos = e.position.value;
e.ReplacePosition(pos + e.velocity.value);
}
}
}
it["adds velocity to position"] = () => {
// given
var pool = Pools.sharedInstance.core;
var entity = pool.CreateEntity()
.AddPosition(Vector3.one)
.AddVelocity(Vector3.one);
var system = pool.CreateSystem(new MovementSystem());
// when
system.Execute();
// then
entity.position.value.should_be(new Vector3(2, 2, 2));
};
CONSISTENCY
CLEAN
Separation of concerns
Composition over Inheritance
Single responsibility principle
Consistency
ENTITAS
clean
▸ fast
simple
Clean, fast and simple with Entitas and Unity - Unite Melbourne 2016
UNITY VS ENTITAS: Objects
1000 objects with 2 components
Memory: 9x (2.9 MB vs 0.32 MB)
CPU: 17x (105 ms vs 6 ms)
Clean, fast and simple with Entitas and Unity - Unite Melbourne 2016
ENTITAS VS UNITY: Logic
update 25000 objects
Memory: 5x (36.4 MB vs 7.6 MB)
CPU: 2x (20.5 ms vs 9.6 ms)
UNITY BLOG
10000 Update() calls by Valentin Simonov
ENTITAS
clean
fast
▸ simple
SIMPLE
similar to Unity
simple conventions
easy to add features
Visual Debugging
Reusing code
SYSTEMS
Chain of Responsibility
+------------+ +------------+ +------------+ +------------+
| | | | | | | |
| System | +---> | System | +---> | System | +---> | System |
| | | | | | | |
+------------+ +------------+ +------------+ +------------+
SYSTEMS
Chain of Responsibility
+------------+ +------------+ +------------+
| | | | | |
| System | +---> | System | +------------------------> | System |
| | | | | |
+------------+ +------------+ +------------+
SYSTEMS
Chain of Responsibility
+------------+ +------------+ +------------+ +------------+
| | | | | | | |
| System | +---> | System | +---> | System | +---> | System |
| | | | | | | |
+------------+ +------------+ +------------+ +------------+
SIMPLE
similar to Unity
simple conventions
easy to add features
Visual Debugging
Reusing code
ENTITAS IS
open source
GITHUB.COM/SSCHMID/ENTITAS-CSHARP
WOOGA.COM/JOBS
QUESTIONS?
#ENTITAS
GITHUB.COM/SSCHMID/ENTITAS-CSHARP

More Related Content

What's hot (9)

PDF
Testing a 2D Platformer with Spock
Alexander Tarlinder
 
PPTX
Ac cuda c_6
Josh Wyatt
 
PDF
Java Puzzlers
Mike Donikian
 
PDF
Clustering your Application with Hazelcast
Hazelcast
 
PDF
Guaranteeing Consensus in Distriubuted Systems with CRDTs
Sun-Li Beatteay
 
PPTX
Taking advantage of the Amazon Web Services (AWS) Family
Ben Hall
 
PDF
Vielseitiges In-Memory Computing mit Apache Ignite und Kubernetes
QAware GmbH
 
PDF
Accelerating Local Search with PostgreSQL (KNN-Search)
Jonathan Katz
 
ZIP
とある断片の超動的言語
Kiyotaka Oku
 
Testing a 2D Platformer with Spock
Alexander Tarlinder
 
Ac cuda c_6
Josh Wyatt
 
Java Puzzlers
Mike Donikian
 
Clustering your Application with Hazelcast
Hazelcast
 
Guaranteeing Consensus in Distriubuted Systems with CRDTs
Sun-Li Beatteay
 
Taking advantage of the Amazon Web Services (AWS) Family
Ben Hall
 
Vielseitiges In-Memory Computing mit Apache Ignite und Kubernetes
QAware GmbH
 
Accelerating Local Search with PostgreSQL (KNN-Search)
Jonathan Katz
 
とある断片の超動的言語
Kiyotaka Oku
 

Viewers also liked (20)

PDF
Game Programming 02 - Component-Based Entity Systems
Nick Pruehs
 
PPTX
GameDev 2017 - Анатолій Ландишев "AAA architecture in Unity3D"
Lviv Startup Club
 
PDF
The use of data-oriented programming paradigm in Unity games
DevGAMM Conference
 
PDF
Game Programming 08 - Tool Development
Nick Pruehs
 
PDF
Game Programming 10 - Localization
Nick Pruehs
 
PDF
Game Programming 04 - Style & Design Principles
Nick Pruehs
 
PDF
Game Programming 03 - Git Flow
Nick Pruehs
 
PDF
What Would Blizzard Do
Nick Pruehs
 
PDF
Game Programming 13 - Debugging & Performance Optimization
Nick Pruehs
 
PDF
Game Models - A Different Approach
Nick Pruehs
 
PPTX
Presentation on Operating System & its Components
Mahmuda Rahman
 
PDF
Component-Based Entity Systems (Demo)
Nick Pruehs
 
PDF
Entitas System Architecture with Unity - Maxim Zaks and Simon Schmid
Wooga
 
PDF
Style & Design Principles 03 - Component-Based Entity Systems
Nick Pruehs
 
PDF
Game Programming 07 - Procedural Content Generation
Nick Pruehs
 
PDF
School For Games 2015 - Unity Engine Basics
Nick Pruehs
 
PDF
Tool Development A - Git
Nick Pruehs
 
PDF
Game Programming 09 - AI
Nick Pruehs
 
PDF
EventSystemまわりの話@UnityFukuoka07
Keizo Nagamine
 
PDF
Designing an actor model game architecture with Pony
Nick Pruehs
 
Game Programming 02 - Component-Based Entity Systems
Nick Pruehs
 
GameDev 2017 - Анатолій Ландишев "AAA architecture in Unity3D"
Lviv Startup Club
 
The use of data-oriented programming paradigm in Unity games
DevGAMM Conference
 
Game Programming 08 - Tool Development
Nick Pruehs
 
Game Programming 10 - Localization
Nick Pruehs
 
Game Programming 04 - Style & Design Principles
Nick Pruehs
 
Game Programming 03 - Git Flow
Nick Pruehs
 
What Would Blizzard Do
Nick Pruehs
 
Game Programming 13 - Debugging & Performance Optimization
Nick Pruehs
 
Game Models - A Different Approach
Nick Pruehs
 
Presentation on Operating System & its Components
Mahmuda Rahman
 
Component-Based Entity Systems (Demo)
Nick Pruehs
 
Entitas System Architecture with Unity - Maxim Zaks and Simon Schmid
Wooga
 
Style & Design Principles 03 - Component-Based Entity Systems
Nick Pruehs
 
Game Programming 07 - Procedural Content Generation
Nick Pruehs
 
School For Games 2015 - Unity Engine Basics
Nick Pruehs
 
Tool Development A - Git
Nick Pruehs
 
Game Programming 09 - AI
Nick Pruehs
 
EventSystemまわりの話@UnityFukuoka07
Keizo Nagamine
 
Designing an actor model game architecture with Pony
Nick Pruehs
 
Ad

Similar to Clean, fast and simple with Entitas and Unity - Unite Melbourne 2016 (20)

PPTX
Java parallel programming made simple
Ateji Px
 
PDF
Android Threading
Jussi Pohjolainen
 
PPTX
16. Java stacks and queues
Intro C# Book
 
PDF
【Unite 2017 Tokyo】C#ジョブシステムによるモバイルゲームのパフォーマンス向上テクニック
Unity Technologies Japan K.K.
 
PDF
Advanced iOS Build Mechanics, Sebastien Pouliot
Xamarin
 
PDF
20180904-object-oriented-programming-in-java.pdf
ebtehally95
 
PDF
Sam wd programs
Soumya Behera
 
PDF
From System Modeling to Automated System Testing
Florian Lier
 
PDF
Android Jetpack + Coroutines: To infinity and beyond
Ramon Ribeiro Rabello
 
PPS
Data Structure
sheraz1
 
PPS
Lec 1 Ds
Qundeel
 
PPS
Lec 1 Ds
Qundeel
 
PDF
Entity Component System - a different approach to game and app development
Maxim Zaks
 
PDF
[ROOTCON13] Pilot Study on Semi-Automated Patch Diffing by Applying Machine-L...
Asuka Nakajima
 
PPTX
J2ME Lwuit, Storage & Connections (Ft Prasanjit Dey)
Fafadia Tech
 
PDF
Quick and Dirty GUI Applications using GUIDeFATE
Connie New
 
PDF
Some testing - Everything you should know about testing to go with @pedro_g_s...
Sergio Arroyo
 
PDF
Autosar Basics hand book_v1
Keroles karam khalil
 
PPTX
Collection implementation classes - Arraylist, linkedlist, Stack
RajalakshmiS74
 
PDF
SERENE 2014 School: Resilience in Cyber-Physical Systems: Challenges and Oppo...
SERENEWorkshop
 
Java parallel programming made simple
Ateji Px
 
Android Threading
Jussi Pohjolainen
 
16. Java stacks and queues
Intro C# Book
 
【Unite 2017 Tokyo】C#ジョブシステムによるモバイルゲームのパフォーマンス向上テクニック
Unity Technologies Japan K.K.
 
Advanced iOS Build Mechanics, Sebastien Pouliot
Xamarin
 
20180904-object-oriented-programming-in-java.pdf
ebtehally95
 
Sam wd programs
Soumya Behera
 
From System Modeling to Automated System Testing
Florian Lier
 
Android Jetpack + Coroutines: To infinity and beyond
Ramon Ribeiro Rabello
 
Data Structure
sheraz1
 
Lec 1 Ds
Qundeel
 
Lec 1 Ds
Qundeel
 
Entity Component System - a different approach to game and app development
Maxim Zaks
 
[ROOTCON13] Pilot Study on Semi-Automated Patch Diffing by Applying Machine-L...
Asuka Nakajima
 
J2ME Lwuit, Storage & Connections (Ft Prasanjit Dey)
Fafadia Tech
 
Quick and Dirty GUI Applications using GUIDeFATE
Connie New
 
Some testing - Everything you should know about testing to go with @pedro_g_s...
Sergio Arroyo
 
Autosar Basics hand book_v1
Keroles karam khalil
 
Collection implementation classes - Arraylist, linkedlist, Stack
RajalakshmiS74
 
SERENE 2014 School: Resilience in Cyber-Physical Systems: Challenges and Oppo...
SERENEWorkshop
 
Ad

Recently uploaded (20)

PPTX
GALILEO CRS SYSTEM | GALILEO TRAVEL SOFTWARE
philipnathen82
 
PDF
10 posting ideas for community engagement with AI prompts
Pankaj Taneja
 
PDF
Protecting the Digital World Cyber Securit
dnthakkar16
 
PDF
Applitools Platform Pulse: What's New and What's Coming - July 2025
Applitools
 
PPTX
ASSIGNMENT_1[1][1][1][1][1] (1) variables.pptx
kr2589474
 
PDF
Adobe Illustrator Crack Full Download (Latest Version 2025) Pre-Activated
imang66g
 
PDF
Enhancing Healthcare RPM Platforms with Contextual AI Integration
Cadabra Studio
 
PDF
Generating Union types w/ Static Analysis
K. Matthew Dupree
 
PDF
Download iTop VPN Free 6.1.0.5882 Crack Full Activated Pre Latest 2025
imang66g
 
PPTX
Presentation about variables and constant.pptx
kr2589474
 
PPTX
slidesgo-unlocking-the-code-the-dynamic-dance-of-variables-and-constants-2024...
kr2589474
 
PPT
Why Reliable Server Maintenance Service in New York is Crucial for Your Business
Sam Vohra
 
PDF
Troubleshooting Virtual Threads in Java!
Tier1 app
 
PPTX
Farrell__10e_ch04_PowerPoint.pptx Programming Logic and Design slides
bashnahara11
 
PDF
Balancing Resource Capacity and Workloads with OnePlan – Avoid Overloading Te...
OnePlan Solutions
 
PDF
How to Download and Install ADT (ABAP Development Tools) for Eclipse IDE | SA...
SAP Vista, an A L T Z E N Company
 
PDF
SAP GUI Installation Guide for Windows | Step-by-Step Setup for SAP Access
SAP Vista, an A L T Z E N Company
 
PDF
What companies do with Pharo (ESUG 2025)
ESUG
 
PPTX
Web Testing.pptx528278vshbuqffqhhqiwnwuq
studylike474
 
PDF
SAP GUI Installation Guide for macOS (iOS) | Connect to SAP Systems on Mac
SAP Vista, an A L T Z E N Company
 
GALILEO CRS SYSTEM | GALILEO TRAVEL SOFTWARE
philipnathen82
 
10 posting ideas for community engagement with AI prompts
Pankaj Taneja
 
Protecting the Digital World Cyber Securit
dnthakkar16
 
Applitools Platform Pulse: What's New and What's Coming - July 2025
Applitools
 
ASSIGNMENT_1[1][1][1][1][1] (1) variables.pptx
kr2589474
 
Adobe Illustrator Crack Full Download (Latest Version 2025) Pre-Activated
imang66g
 
Enhancing Healthcare RPM Platforms with Contextual AI Integration
Cadabra Studio
 
Generating Union types w/ Static Analysis
K. Matthew Dupree
 
Download iTop VPN Free 6.1.0.5882 Crack Full Activated Pre Latest 2025
imang66g
 
Presentation about variables and constant.pptx
kr2589474
 
slidesgo-unlocking-the-code-the-dynamic-dance-of-variables-and-constants-2024...
kr2589474
 
Why Reliable Server Maintenance Service in New York is Crucial for Your Business
Sam Vohra
 
Troubleshooting Virtual Threads in Java!
Tier1 app
 
Farrell__10e_ch04_PowerPoint.pptx Programming Logic and Design slides
bashnahara11
 
Balancing Resource Capacity and Workloads with OnePlan – Avoid Overloading Te...
OnePlan Solutions
 
How to Download and Install ADT (ABAP Development Tools) for Eclipse IDE | SA...
SAP Vista, an A L T Z E N Company
 
SAP GUI Installation Guide for Windows | Step-by-Step Setup for SAP Access
SAP Vista, an A L T Z E N Company
 
What companies do with Pharo (ESUG 2025)
ESUG
 
Web Testing.pptx528278vshbuqffqhhqiwnwuq
studylike474
 
SAP GUI Installation Guide for macOS (iOS) | Connect to SAP Systems on Mac
SAP Vista, an A L T Z E N Company
 

Clean, fast and simple with Entitas and Unity - Unite Melbourne 2016