SlideShare a Scribd company logo
Entity Component System - a
different approach to game /
application development
Maxim Zaks @iceX33
Object Oriented Programming
SOLID Principals
Entity Component System - a different approach to game and app development
public class Rectangle
{
public double Width { get; set; }
public double Height { get; set; }
}
public class AreaCalculator
{
public double Area(Rectangle[] shapes)
{
double area = 0;
foreach (var shape in shapes)
{
area += shape.Width*shape.Height;
}
return area;
}
}
public double Area(object[] shapes)
{
double area = 0;
foreach (var shape in shapes)
{
if (shape is Rectangle)
{
Rectangle rectangle = (Rectangle) shape;
area += rectangle.Width*rectangle.Height;
}
else
{
Circle circle = (Circle)shape;
area += circle.Radius * circle.Radius * Math.PI;
}
}
return area;
}
public abstract class Shape
{
public abstract double Area();
}
public class Rectangle : Shape
{
public double Width { get; set; }
public double Height { get; set; }
public override double Area()
{
return Width*Height;
}
}
public class Circle : Shape
{
public double Radius { get; set; }
public override double Area()
{
return Radius*Radius*Math.PI;
}
}
public double Area(Shape[] shapes)
{
double area = 0;
foreach (var shape in shapes)
{
area += shape.Area();
}
return area;
}
OOP -> Abstraction
Wassily Kandinsky: Komposition VIII, 1923. Öl auf Leinwand
Functional Programming
Entity Component System - a different approach to game and app development
rectangleArea :: Float -> Float -> Float
rectangleArea a b = a * b
data Shape = Circle Float | Rectangle Float Float
area :: Shape -> Float
area (Circle r) = pi * r * r
area (Rectangle width height) = width * height
sum $ map area [(Circle 5), (Rectangle 2 3), (Circle 7)]
FP -> Function Composition
Entity Component System
Entity Component System - a different approach to game and app development
struct RadiusComponent {
float value;
}
struct HeightComponent {
float value;
}
struct WidthComponent {
float value;
}
struct AreaComponent {
float value;
}
Compute Circle Area System
• get all entities which have RadiusComponent
• set computed AreaComponent on this entity
Entity Component System - a different approach to game and app development
Compute Rectangle Area System
• get all entities which have WidthComponent and HeightComponent
• set computed AreaComponent on entity
Entity Component System - a different approach to game and app development
Compute Sum of Areas System
• get all entities which have AreaComponent
• compute a sum of values
• do something with it
Systems query for data / get data
injected
Systems don't return
They change sate, or perform side effects
Entity Component System - a different approach to game and app development
Systems don't care about the whole
picture
Entity Component System - a different approach to game and app development
Elephant and the blind men
https://en.wikipedia.org/wiki/Blindmenandanelephant
Interactive vs. pure computation
Systems are executed periodically
How to implement an early exit?
Define better query
• get all entities which have RadiusComponent and don't have
AreaComponent
What happens when value is changed by
outside interaction?
Solutions
• Introduce special components for outside interactions
• Use an ECS which supports reactive systems
What is a reactive system?
Component events
• Added
• Removed
• Replaced
Entity Component System - a different approach to game and app development
ECS vs. FP
• ECS is built for interactive computations
• mutation is ok
• side effects are ok
ECS vs. OOP
Data driven vs. Abstraction
Clean architecture
• SOLID in regards to ECS
Single responsibility principle
Open close principle
Liskov substitution principle
Interface segregation principle
Dependency inversion principle
Lets talk about testability
Lets talk about debug-ability
Lets talk about performance
Entity Component System - a different approach to game and app development
If you want to know more
• Have a look at work Unity3D does https://unity3d.com/unity/
features/job-system-ECS
• Mike Acton @ CppCon 2014 https://www.youtube.com/watch?
v=rX0ItVEVjHc
• Catherine West @ Rust Conf 2018 https://www.youtube.com/
watch?v=aKLntZcp27M
• ECS Lab Discord Server https://discord.gg/eCpyZSg
Thank you!
Maxim Zaks @iceX33
Questions?

More Related Content

What's hot (20)

PPTX
State equations for physical systems
Sarah Krystelle
 
PPT
Ai ch2
Praveen Kumar
 
PDF
Calculus 10th edition anton solutions manual
Reece1334
 
PPT
First order logic
Rushdi Shams
 
PPT
Fast Fourier Transform (FFT) Algorithms in DSP
roykousik2020
 
PDF
인공지능과 딥러닝에 대한 소개
Young-Min kang
 
PPTX
Application of Stack For Expression Evaluation by Prakash Zodge DSY 41.pptx
Prakash Zodge
 
PPTX
Differential Equation
RakibulIslam259
 
PDF
알아두면 쓸데있는 신기한 강화학습 NAVER 2017
Taehoon Kim
 
PPTX
Java Foundations: Maps, Lambda and Stream API
Svetlin Nakov
 
PPTX
Merge sort and quick sort
Shakila Mahjabin
 
PPTX
HVE unit 1.pptx
RanganayakiRamkumar1
 
PDF
Lecture 13 ME 176 6 Steady State Error Re
Leonides De Ocampo
 
PPTX
Heuristic Searching Algorithms Artificial Intelligence.pptx
Swagat Praharaj
 
PPT
Looping in c++
deekshagopaliya
 
PPTX
Hyperbolic functions dfs
Farhana Shaheen
 
PPT
Predicate calculus
Rajendran
 
PPT
5 csp
Mhd Sb
 
PPTX
Runge-Kutta methods with examples
Sajjad Hossain
 
PPTX
Bca 2nd sem u-4 operator overloading
Rai University
 
State equations for physical systems
Sarah Krystelle
 
Calculus 10th edition anton solutions manual
Reece1334
 
First order logic
Rushdi Shams
 
Fast Fourier Transform (FFT) Algorithms in DSP
roykousik2020
 
인공지능과 딥러닝에 대한 소개
Young-Min kang
 
Application of Stack For Expression Evaluation by Prakash Zodge DSY 41.pptx
Prakash Zodge
 
Differential Equation
RakibulIslam259
 
알아두면 쓸데있는 신기한 강화학습 NAVER 2017
Taehoon Kim
 
Java Foundations: Maps, Lambda and Stream API
Svetlin Nakov
 
Merge sort and quick sort
Shakila Mahjabin
 
HVE unit 1.pptx
RanganayakiRamkumar1
 
Lecture 13 ME 176 6 Steady State Error Re
Leonides De Ocampo
 
Heuristic Searching Algorithms Artificial Intelligence.pptx
Swagat Praharaj
 
Looping in c++
deekshagopaliya
 
Hyperbolic functions dfs
Farhana Shaheen
 
Predicate calculus
Rajendran
 
5 csp
Mhd Sb
 
Runge-Kutta methods with examples
Sajjad Hossain
 
Bca 2nd sem u-4 operator overloading
Rai University
 

Similar to Entity Component System - a different approach to game and app development (20)

PPTX
We Love Performance! How Tic Toc Games Uses ECS in Mobile Puzzle Games
Unity Technologies
 
PDF
Entity Component Systems
Yos Riady
 
PDF
Entity Component System
Casper van Beuzekom
 
PDF
Style & Design Principles 03 - Component-Based Entity Systems
Nick Pruehs
 
PPTX
OGDC 2014: Component based entity system mobile game development
GameLandVN
 
PPTX
Enforce Consistency through Application Infrastructure
Florin Coros
 
PPT
NASA' Use of Immersive Environments
Peter Brantley
 
PDF
Component-Based Entity Systems (Demo)
Nick Pruehs
 
PPTX
An Introduction To CQRS
Neil Robbins
 
PDF
Game Programming 02 - Component-Based Entity Systems
Nick Pruehs
 
PDF
breaking_dependencies_the_solid_principles__klaus_iglberger__cppcon_2020.pdf
VishalKumarJha10
 
PPT
Arev05c icfca05lessonslearned
Ahmed Mohamed
 
PPT
The Architect's Two Hats
Ben Stopford
 
PPT
Avoiding Software Insanity
josephnaveen
 
PDF
Entity Component System - for App developers
Maxim Zaks
 
PDF
Open GL T0074 56 sm4
Roziq Bahtiar
 
PDF
Framework Engineering
YoungSu Son
 
PPT
documents.pub_replication-consistency.ppt
wondefirawwolile
 
PPTX
GameDev 2017 - Анатолій Ландишев "AAA architecture in Unity3D"
Lviv Startup Club
 
PDF
[0201699613]visual modeling with rational rose 2000 and uml
Công ty cổ phần ô tô Trường Hải
 
We Love Performance! How Tic Toc Games Uses ECS in Mobile Puzzle Games
Unity Technologies
 
Entity Component Systems
Yos Riady
 
Entity Component System
Casper van Beuzekom
 
Style & Design Principles 03 - Component-Based Entity Systems
Nick Pruehs
 
OGDC 2014: Component based entity system mobile game development
GameLandVN
 
Enforce Consistency through Application Infrastructure
Florin Coros
 
NASA' Use of Immersive Environments
Peter Brantley
 
Component-Based Entity Systems (Demo)
Nick Pruehs
 
An Introduction To CQRS
Neil Robbins
 
Game Programming 02 - Component-Based Entity Systems
Nick Pruehs
 
breaking_dependencies_the_solid_principles__klaus_iglberger__cppcon_2020.pdf
VishalKumarJha10
 
Arev05c icfca05lessonslearned
Ahmed Mohamed
 
The Architect's Two Hats
Ben Stopford
 
Avoiding Software Insanity
josephnaveen
 
Entity Component System - for App developers
Maxim Zaks
 
Open GL T0074 56 sm4
Roziq Bahtiar
 
Framework Engineering
YoungSu Son
 
documents.pub_replication-consistency.ppt
wondefirawwolile
 
GameDev 2017 - Анатолій Ландишев "AAA architecture in Unity3D"
Lviv Startup Club
 
[0201699613]visual modeling with rational rose 2000 and uml
Công ty cổ phần ô tô Trường Hải
 
Ad

More from Maxim Zaks (20)

PDF
Nitty Gritty of Data Serialisation
Maxim Zaks
 
PDF
Wind of change
Maxim Zaks
 
PDF
Data model mal anders
Maxim Zaks
 
PDF
Talk Binary to Me
Maxim Zaks
 
PDF
Beyond JSON - An Introduction to FlatBuffers
Maxim Zaks
 
PDF
Beyond JSON @ Mobile.Warsaw
Maxim Zaks
 
PDF
Beyond JSON @ dot swift 2016
Maxim Zaks
 
PDF
Beyond JSON with FlatBuffers
Maxim Zaks
 
PDF
Basics of Computer Science
Maxim Zaks
 
PDF
Entity system architecture with Unity @Unite Europe 2015
Maxim Zaks
 
PDF
UIKonf App & Data Driven Design @swift.berlin
Maxim Zaks
 
PDF
Swift the implicit parts
Maxim Zaks
 
PDF
Currying in Swift
Maxim Zaks
 
PDF
Promise of an API
Maxim Zaks
 
PDF
96% macoun 2013
Maxim Zaks
 
PDF
Diagnose of Agile @ Wooga 04.2013
Maxim Zaks
 
PDF
Start playing @ mobile.cologne 2013
Maxim Zaks
 
PDF
Under Cocos2D Tree @mdvecon 2013
Maxim Zaks
 
PDF
Don’t do Agile, be Agile @NSConf 2013
Maxim Zaks
 
PDF
Test Essentials @mdevcon 2012
Maxim Zaks
 
Nitty Gritty of Data Serialisation
Maxim Zaks
 
Wind of change
Maxim Zaks
 
Data model mal anders
Maxim Zaks
 
Talk Binary to Me
Maxim Zaks
 
Beyond JSON - An Introduction to FlatBuffers
Maxim Zaks
 
Beyond JSON @ Mobile.Warsaw
Maxim Zaks
 
Beyond JSON @ dot swift 2016
Maxim Zaks
 
Beyond JSON with FlatBuffers
Maxim Zaks
 
Basics of Computer Science
Maxim Zaks
 
Entity system architecture with Unity @Unite Europe 2015
Maxim Zaks
 
UIKonf App & Data Driven Design @swift.berlin
Maxim Zaks
 
Swift the implicit parts
Maxim Zaks
 
Currying in Swift
Maxim Zaks
 
Promise of an API
Maxim Zaks
 
96% macoun 2013
Maxim Zaks
 
Diagnose of Agile @ Wooga 04.2013
Maxim Zaks
 
Start playing @ mobile.cologne 2013
Maxim Zaks
 
Under Cocos2D Tree @mdvecon 2013
Maxim Zaks
 
Don’t do Agile, be Agile @NSConf 2013
Maxim Zaks
 
Test Essentials @mdevcon 2012
Maxim Zaks
 
Ad

Recently uploaded (20)

PDF
Linux Certificate of Completion - LabEx Certificate
VICTOR MAESTRE RAMIREZ
 
PDF
Digger Solo: Semantic search and maps for your local files
seanpedersen96
 
PPTX
Empowering Asian Contributions: The Rise of Regional User Groups in Open Sour...
Shane Coughlan
 
PPTX
Agentic Automation: Build & Deploy Your First UiPath Agent
klpathrudu
 
PDF
HiHelloHR – Simplify HR Operations for Modern Workplaces
HiHelloHR
 
PDF
Alexander Marshalov - How to use AI Assistants with your Monitoring system Q2...
VictoriaMetrics
 
PPTX
In From the Cold: Open Source as Part of Mainstream Software Asset Management
Shane Coughlan
 
PPTX
AEM User Group: India Chapter Kickoff Meeting
jennaf3
 
PDF
Download Canva Pro 2025 PC Crack Full Latest Version
bashirkhan333g
 
PDF
[Solution] Why Choose the VeryPDF DRM Protector Custom-Built Solution for You...
Lingwen1998
 
PDF
MiniTool Partition Wizard Free Crack + Full Free Download 2025
bashirkhan333g
 
PPTX
Transforming Mining & Engineering Operations with Odoo ERP | Streamline Proje...
SatishKumar2651
 
PDF
Odoo CRM vs Zoho CRM: Honest Comparison 2025
Odiware Technologies Private Limited
 
PDF
Top Agile Project Management Tools for Teams in 2025
Orangescrum
 
PPTX
Tally software_Introduction_Presentation
AditiBansal54083
 
PPTX
Agentic Automation Journey Series Day 2 – Prompt Engineering for UiPath Agents
klpathrudu
 
PDF
Online Queue Management System for Public Service Offices in Nepal [Focused i...
Rishab Acharya
 
PPTX
Why Businesses Are Switching to Open Source Alternatives to Crystal Reports.pptx
Varsha Nayak
 
PPTX
Agentic Automation Journey Session 1/5: Context Grounding and Autopilot for E...
klpathrudu
 
PDF
Why Businesses Are Switching to Open Source Alternatives to Crystal Reports.pdf
Varsha Nayak
 
Linux Certificate of Completion - LabEx Certificate
VICTOR MAESTRE RAMIREZ
 
Digger Solo: Semantic search and maps for your local files
seanpedersen96
 
Empowering Asian Contributions: The Rise of Regional User Groups in Open Sour...
Shane Coughlan
 
Agentic Automation: Build & Deploy Your First UiPath Agent
klpathrudu
 
HiHelloHR – Simplify HR Operations for Modern Workplaces
HiHelloHR
 
Alexander Marshalov - How to use AI Assistants with your Monitoring system Q2...
VictoriaMetrics
 
In From the Cold: Open Source as Part of Mainstream Software Asset Management
Shane Coughlan
 
AEM User Group: India Chapter Kickoff Meeting
jennaf3
 
Download Canva Pro 2025 PC Crack Full Latest Version
bashirkhan333g
 
[Solution] Why Choose the VeryPDF DRM Protector Custom-Built Solution for You...
Lingwen1998
 
MiniTool Partition Wizard Free Crack + Full Free Download 2025
bashirkhan333g
 
Transforming Mining & Engineering Operations with Odoo ERP | Streamline Proje...
SatishKumar2651
 
Odoo CRM vs Zoho CRM: Honest Comparison 2025
Odiware Technologies Private Limited
 
Top Agile Project Management Tools for Teams in 2025
Orangescrum
 
Tally software_Introduction_Presentation
AditiBansal54083
 
Agentic Automation Journey Series Day 2 – Prompt Engineering for UiPath Agents
klpathrudu
 
Online Queue Management System for Public Service Offices in Nepal [Focused i...
Rishab Acharya
 
Why Businesses Are Switching to Open Source Alternatives to Crystal Reports.pptx
Varsha Nayak
 
Agentic Automation Journey Session 1/5: Context Grounding and Autopilot for E...
klpathrudu
 
Why Businesses Are Switching to Open Source Alternatives to Crystal Reports.pdf
Varsha Nayak
 

Entity Component System - a different approach to game and app development