SlideShare a Scribd company logo
Style & Design Principles
Chapter 03: Component-Based Entity Systems
Nick Prühs
5 Minute Review Session
• What’s the difference between inheritance and
aggregation?
• Explain the three types of polymorphism!
• What’s the difference between cohesion and
coupling?
• What are software design patterns?
• Explain three types of software design patterns,
and name an example for each one!
2 / 58
Assignment Solution #2
DEMO
3 / 58
Objectives
• To understand the disadvantages of inheritance-
based game models
• To learn how to build an aggregation-based game
models
• To understand the advantages and disadvantages of
aggregation-based game models
4 / 58
“Say you’re an engineer…
… set out to create a new Game Object System from scratch, and you’re going to ‘do it right the first time’. You
talk to your designer and say ‘What kind of content are we going to have in this game?’
They respond with ‘Oh lots of stuff, trees, and birds, and bushes, and keys and locks and … <trailing off>’
And your eyes glaze over as you start thinking of fancy C++ ways to solve the problem.
The object oriented programming sages tell you to try to determine Is-A relationships and abstract functionality
and all that other fun stuff. You go to the book store and buy a C++ book just to be sure, and it tells you to fire
up your $5000 UML editor. [...]”
- Scott Bilas
5 / 58
Entities
6 / 57
Entities
7 / 57
Entities
8 / 57
Entities
9 / 57
Entities
10 / 57
Entities
11 / 57
Entities
• Object in your game world
• Can (or cannot)…
• be visible
• move around
• attack
• explode
• be targeted
• become selected
• follow a path
• Common across all genres
12 / 58
Entities
13 / 58
Approach #1: Inheritance
14 / 57
Approach #1: Inheritance
• Entity base class
• That class and its subclasses encapsulate the main
game logic
15 / 58
Example #1: Unreal Engine 3
• Base class Actor
• Rendering
• Animation
• Sound
• Physics
• Almost everything in Unreal is an Actor
• Pawn extends by taking damage
• Projectile extends by spawning impact effects
16 / 58
Drawbacks of
inheritance-based game models
• Diamond of Death
17 / 58
Drawbacks of
inheritance-based game models
• Code added to the root of the inheritance tree
causes big overhead
• Code added to the leafs of the tree tends to get
copied
• Root and leaf classes tend to get very big
18 / 58
Where is Waldo?
public override void Update(float dt)
{
this.SystemManager.Update(dt);
this.EventManager.ProcessEvents(dt);
}
19 / 58
Where is Waldo?
public override void Update(float dt)
{
this.SystemManager.Update(dt);
this.EventManager.ProcessEvents(dt);
}
20 / 58
Where is Waldo?
public override void Update(float dt)
{
base.Update(dt);
this.SystemManager.Update(dt);
this.EventManager.ProcessEvents(dt);
}
21 / 58
Drawbacks of
inheritance-based game models
• Always need to understand all base classes along
the inheritance tree
• Impossible to enforce calling base class functions
• Someone will forget it. Trust me.
• And you’re gonna spend your whole evening finding that one
missing base.Update().
• Deep class hierarchies will more likely run into call
order issues
22 / 58
Inheritance-based game
models are…
• … difficult to develop
• … difficult to maintain
• … difficult to extend
23 / 58
“There are probably
hundreds of ways…
… you could decompose your systems and come up with a set of
classes […], and eventually, all of them are wrong. This isn’t to say
that they won’t work, but games are constantly changing,
constantly invalidating your carefully planned designs. [...]
So you hand off your new Game Object System and go work on
other things.
Then one day your designer says that they want a new type of
“alien” asteroid that acts just like a heat seeking missile, except it’s
still an asteroid.”
- Scott Bilas
24 / 58
“alien” asteroid
25 / 57
Approach #2: Aggregation
26 / 57
Approach #2: Aggregation
27 / 57
Approach #2: Aggregation
• Popular since Gas Powered Games’ Dungeon Siege
• Introduced long before
• Entities are aggregations of components
• Which in turn encapsulate independent functionality
• Corresponds to recommendations by the Gang of Four
• “favor object composition over class inheritance”
• Similar approach is used by the Unity3D game engine
• Just for clarification: Unreal uses components as well, called
ActorComponent
• Got much more prominent in latest UDK release
28 / 58
Approach #2a
• Create an Entity class
• Add references to all available components
• Has obvious disadvantages:
• Many component references will be null pointers for
most entities
• Big unnecessary memory overhead
• Entity class has to be updated each time a new
component is introduced
29 / 58
Approach #2b
• Create an Entity class
• Introduce a common base class for components
• Entities hold a collection of Component objects
• Reduced the memory overhead
• Increased extensibility
• Already gets close to an optimal solution
• easy to build, maintain and debug
• easy to implement new design ideas without breaking
existing code
30 / 58
However, we can do better.
31 / 58
Approach #2c: Entity Systems
32 / 57
Approach #2c: Entity Systems
33 / 58
Approach #2c: Entity Systems
• Game entities are nothing more than just an id
• Thus, no data or methods on entities
• No methods on components, either: all
functionality goes into what is called a system
• PhysicsSystem
• HealthSystem
• FightSystem
• Entirely operate on their corresponding
components
34 / 58
“All the data goes into the
Components.
All of it. Think you can take some “really common”
data, e. g. the x-/y-/z-coordinates of the in-game
object, and put it into the Entity itself? Nope. Don’t
go there. As soon as you start migrating data into the
Entity, you’ve lost. By definition the only valid place
for the data is inside the Component.”
- Adam Martin
35 / 58
Example #2: Simple Fight
36 / 58
Example #2: Simple Fight
37 / 58
Example #2: Simple Fight
38 / 58
Example #2: Simple Fight
39 / 58
Example #2: Simple Fight
40 / 58
Example #2: Simple Fight
41 / 58
Example #2: Simple Fight
42 / 58
Example #2: Simple Fight
43 / 58
Example #2: Simple Fight
44 / 58
Example #2: Simple Fight
45 / 58
Inter-System Communication
Systems communicate by the means of events, only.
• No coupling between systems
• Easy to add or remove systems at any time
• Great architectural advantage for general game
features
• Need multiplayer? Just send the events over the network!
• Need AI? Just make it create events which are handled just
like player input is!
• Need replays? Just write all events with timestamps to a file!
46 / 58
Inter-System Communication
47 / 57
Entity Systems –
Implementation
DEMO
48 / 58
Advantages of Entity Systems
• Update order is obvious
• Components can easily be pooled and re-used
• Independent systems can be updated by separate
threads
• Data can easily be serialized and stored in a
database
49 / 58
Disadvantages of
Entity Systems (?)
• Lookups cause performance hit
• Resist the urge to add cross-component references – this
would make you lose all of the advantages mentioned
before
• Just don’t flood your system with unnecessary
component types – just as you would always do
• Misbelief that it takes longer to “get the job done”
• Used at the InnoGames Game Jam #3 for creating a
multi-platform multi-player real-time tactics game in just
48 hours – spending the little extra effort at the
beginning pays off
• Always.
50 / 58
Future Prospects
• Attribute Tables
• store arbitrary key-value-pairs
• used for initializing all components of an entity
51 / 57
<AttributeTable>
<Attribute keyType="System.String" valueType="System.Single">
<Key>EnemyHealthModificationComponent.EnemyHealthModifier</Key>
<Value>-3</Value>
</Attribute>
<Attribute keyType="System.String" valueType="System.String">
<Key>ActionComponent.Name</Key>
<Value>Take that!</Value>
</Attribute>
</AttributeTable>
Future Prospects
• Blueprints
• consist of a list of components and an attribute table
• created with some kind of editor tool by designers
• used for creating entites at run-time
52 / 57
<Blueprint>
<ComponentTypes>
<ComponentType>FreudBot.Logic.Components.ActionComponent</ComponentType>
<ComponentType>FreudBot.Logic.Components.EnemyHealthModificationComponent</ComponentType>
</ComponentTypes>
<AttributeTable>
<Attribute keyType="System.String" valueType="System.Single">
<Key>EnemyHealthModificationComponent.EnemyHealthModifier</Key>
<Value>-3</Value>
</Attribute>
<Attribute keyType="System.String" valueType="System.String">
<Key>ActionComponent.Name</Key>
<Value>Take that!</Value>
</Attribute>
</AttributeTable>
</Blueprint>
Future Prospects
53 / 57
StarCraft II Galaxy Editor
Future Prospects
54 / 57
StarCraft II Galaxy Editor
Future Prospects
• Hierarchical Attribute Tables
• used for overloading blueprints with specific entity attribute
values
• e.g. reduced initial health
55 / 57
Future Prospects
56 / 57
StarCraft II Galaxy Editor
Future Prospects
public int CreateEntity(Blueprint blueprint, IAttributeTable configuration)
{
int entityId = this.CreateEntity();
// Setup attribute table.
HierarchicalAttributeTable attributeTable = new HierarchicalAttributeTable();
attributeTable.AddParent(blueprint.GetAttributeTable());
attributeTable.AddParent(configuration);
// Add components.
foreach (Type componentType in blueprint.GetAllComponentTypes())
{
// Create component.
IEntityComponent component = (IEntityComponent)Activator.CreateInstance(componentType);
// Add component to entity.
this.AddComponent(entityId, component);
// Initialize component with the attribute table data.
component.InitComponent(attributeTable);
}
// Raise event.
this.game.EventManager.QueueEvent(FrameworkEventType.EntityInitialized, entityId);
return entityId;
}
57 / 57
Takeaway
• inheritance-based game models show a lot of
disadvantages
• entity systems are easy to maintain and debug
• provide great extensibility without the necessity of
modifying existing code
• show better performance characteristics for both
memory and CPU load
• easy to implement commonly used features
• scripting
• serialization
• logging
58 / 57
References
• Mick West. Evolve Your Hierarchy. http://cowboyprogramming.com/2007/01/05/evolve-your-
heirachy/, January 5, 2007.
• Levi Baker. Entity Systems Part 1: Entity and EntityManager.
http://blog.chronoclast.com/2010/12/entity-systems-part-1-entity-and.html, December 24,
2010.
• Kyle Wilson. Game Object Structure: Inheritance vs. Aggregation.
http://gamearchitect.net/Articles/GameObjects1.html, July 3, 2002.
• Adam Martin. Entity Systems are the future of MMOG development – Part 1. http://t-
machine.org/index.php/2007/09/03/entity-systems-are-the-future-of-mmog-development-part-
1/, September 3, 2007.
• Adam Martin. Entity Systems: what makes good Components? good Entities? http://t-
machine.org/index.php/2012/03/16/entity-systems-what-makes-good-components-good-
entities/, March 16, 2012.
• Scott Bilas. A Data-Driven Game Object System.
http://scottbilas.com/files/2002/gdc_san_jose/game_objects_slides_with_notes.pdf, Slides,
GDC 2002.
• Scott Bilas. A Data-Driven Game Object System.
http://scottbilas.com/files/2002/gdc_san_jose/game_objects_paper.pdf, Paper, GDC 2002.
• Insomniac Games. A Dynamic Component Architecture for High Performance Gameplay.
http://www.insomniacgames.com/a-dynamic-component-architecture-for-high-performance-
gameplay/, June 1, 2010.
59 / 57
Thank you for your attention!
Contact
Mail
dev@npruehs.de
Blog
http://www.npruehs.de
Twitter
@npruehs
Github
https://github.com/npruehs
60 / 58

More Related Content

What's hot

サウンドミドルウェアCRI ADX2 Ver3の新機能・使いこなし術のご紹介
サウンドミドルウェアCRI ADX2 Ver3の新機能・使いこなし術のご紹介サウンドミドルウェアCRI ADX2 Ver3の新機能・使いこなし術のご紹介
サウンドミドルウェアCRI ADX2 Ver3の新機能・使いこなし術のご紹介
CRI Middleware
 
Game Programming 07 - Procedural Content Generation
Game Programming 07 - Procedural Content GenerationGame Programming 07 - Procedural Content Generation
Game Programming 07 - Procedural Content Generation
Nick Pruehs
 
Killzone Shadow Fall: Threading the Entity Update on PS4
Killzone Shadow Fall: Threading the Entity Update on PS4Killzone Shadow Fall: Threading the Entity Update on PS4
Killzone Shadow Fall: Threading the Entity Update on PS4
jrouwe
 
Getting started with Burst – Unite Copenhagen 2019
Getting started with Burst – Unite Copenhagen 2019Getting started with Burst – Unite Copenhagen 2019
Getting started with Burst – Unite Copenhagen 2019
Unity Technologies
 
ECS: Streaming and Serialization - Unite LA
ECS: Streaming and Serialization - Unite LAECS: Streaming and Serialization - Unite LA
ECS: Streaming and Serialization - Unite LA
Unity Technologies
 
We Love Performance! How Tic Toc Games Uses ECS in Mobile Puzzle Games
We Love Performance! How Tic Toc Games Uses ECS in Mobile Puzzle GamesWe Love Performance! How Tic Toc Games Uses ECS in Mobile Puzzle Games
We Love Performance! How Tic Toc Games Uses ECS in Mobile Puzzle Games
Unity Technologies
 
Game Programming 11 - Game Physics
Game Programming 11 - Game PhysicsGame Programming 11 - Game Physics
Game Programming 11 - Game Physics
Nick Pruehs
 
ECS architecture with Unity by example - Unite Europe 2016
ECS architecture with Unity by example - Unite Europe 2016ECS architecture with Unity by example - Unite Europe 2016
ECS architecture with Unity by example - Unite Europe 2016
Simon Schmid
 
Unityでソーシャルログイン機能を実装してみた
Unityでソーシャルログイン機能を実装してみたUnityでソーシャルログイン機能を実装してみた
Unityでソーシャルログイン機能を実装してみた
昭仁 賀好
 
Mikrofrontend a Module Federation
Mikrofrontend a Module FederationMikrofrontend a Module Federation
Mikrofrontend a Module Federation
The Software House
 
East Coast DevCon 2014: Concurrency & Parallelism in UE4 - Tips for programmi...
East Coast DevCon 2014: Concurrency & Parallelism in UE4 - Tips for programmi...East Coast DevCon 2014: Concurrency & Parallelism in UE4 - Tips for programmi...
East Coast DevCon 2014: Concurrency & Parallelism in UE4 - Tips for programmi...
Gerke Max Preussner
 
The Next Generation of PhyreEngine
The Next Generation of PhyreEngineThe Next Generation of PhyreEngine
The Next Generation of PhyreEngine
Slide_N
 
React lecture
React lectureReact lecture
React lecture
Christoffer Noring
 
【Unity道場スペシャル 2017京都】最適化をする前に覚えておきたい技術
【Unity道場スペシャル 2017京都】最適化をする前に覚えておきたい技術【Unity道場スペシャル 2017京都】最適化をする前に覚えておきたい技術
【Unity道場スペシャル 2017京都】最適化をする前に覚えておきたい技術
Unity Technologies Japan K.K.
 
【Unite 2018 Tokyo】そろそろ楽がしたい!新アセットバンドルワークフロー&リソースマネージャー詳細解説
【Unite 2018 Tokyo】そろそろ楽がしたい!新アセットバンドルワークフロー&リソースマネージャー詳細解説【Unite 2018 Tokyo】そろそろ楽がしたい!新アセットバンドルワークフロー&リソースマネージャー詳細解説
【Unite 2018 Tokyo】そろそろ楽がしたい!新アセットバンドルワークフロー&リソースマネージャー詳細解説
Unity Technologies Japan K.K.
 
Creating explosive real-time visuals with the Visual Effect Graph – Unite Cop...
Creating explosive real-time visuals with the Visual Effect Graph – Unite Cop...Creating explosive real-time visuals with the Visual Effect Graph – Unite Cop...
Creating explosive real-time visuals with the Visual Effect Graph – Unite Cop...
Unity Technologies
 
State-Based Scripting in Uncharted 2: Among Thieves
State-Based Scripting in Uncharted 2: Among ThievesState-Based Scripting in Uncharted 2: Among Thieves
State-Based Scripting in Uncharted 2: Among Thieves
Naughty Dog
 
アーティスト向けNSightの手引き
アーティスト向けNSightの手引きアーティスト向けNSightの手引き
アーティスト向けNSightの手引き
祐 梶井
 
Introduction to A-Frame
Introduction to A-FrameIntroduction to A-Frame
Introduction to A-Frame
Daosheng Mu
 
Game dev process
Game dev processGame dev process
Game dev process
Yassine Arif
 

What's hot (20)

サウンドミドルウェアCRI ADX2 Ver3の新機能・使いこなし術のご紹介
サウンドミドルウェアCRI ADX2 Ver3の新機能・使いこなし術のご紹介サウンドミドルウェアCRI ADX2 Ver3の新機能・使いこなし術のご紹介
サウンドミドルウェアCRI ADX2 Ver3の新機能・使いこなし術のご紹介
 
Game Programming 07 - Procedural Content Generation
Game Programming 07 - Procedural Content GenerationGame Programming 07 - Procedural Content Generation
Game Programming 07 - Procedural Content Generation
 
Killzone Shadow Fall: Threading the Entity Update on PS4
Killzone Shadow Fall: Threading the Entity Update on PS4Killzone Shadow Fall: Threading the Entity Update on PS4
Killzone Shadow Fall: Threading the Entity Update on PS4
 
Getting started with Burst – Unite Copenhagen 2019
Getting started with Burst – Unite Copenhagen 2019Getting started with Burst – Unite Copenhagen 2019
Getting started with Burst – Unite Copenhagen 2019
 
ECS: Streaming and Serialization - Unite LA
ECS: Streaming and Serialization - Unite LAECS: Streaming and Serialization - Unite LA
ECS: Streaming and Serialization - Unite LA
 
We Love Performance! How Tic Toc Games Uses ECS in Mobile Puzzle Games
We Love Performance! How Tic Toc Games Uses ECS in Mobile Puzzle GamesWe Love Performance! How Tic Toc Games Uses ECS in Mobile Puzzle Games
We Love Performance! How Tic Toc Games Uses ECS in Mobile Puzzle Games
 
Game Programming 11 - Game Physics
Game Programming 11 - Game PhysicsGame Programming 11 - Game Physics
Game Programming 11 - Game Physics
 
ECS architecture with Unity by example - Unite Europe 2016
ECS architecture with Unity by example - Unite Europe 2016ECS architecture with Unity by example - Unite Europe 2016
ECS architecture with Unity by example - Unite Europe 2016
 
Unityでソーシャルログイン機能を実装してみた
Unityでソーシャルログイン機能を実装してみたUnityでソーシャルログイン機能を実装してみた
Unityでソーシャルログイン機能を実装してみた
 
Mikrofrontend a Module Federation
Mikrofrontend a Module FederationMikrofrontend a Module Federation
Mikrofrontend a Module Federation
 
East Coast DevCon 2014: Concurrency & Parallelism in UE4 - Tips for programmi...
East Coast DevCon 2014: Concurrency & Parallelism in UE4 - Tips for programmi...East Coast DevCon 2014: Concurrency & Parallelism in UE4 - Tips for programmi...
East Coast DevCon 2014: Concurrency & Parallelism in UE4 - Tips for programmi...
 
The Next Generation of PhyreEngine
The Next Generation of PhyreEngineThe Next Generation of PhyreEngine
The Next Generation of PhyreEngine
 
React lecture
React lectureReact lecture
React lecture
 
【Unity道場スペシャル 2017京都】最適化をする前に覚えておきたい技術
【Unity道場スペシャル 2017京都】最適化をする前に覚えておきたい技術【Unity道場スペシャル 2017京都】最適化をする前に覚えておきたい技術
【Unity道場スペシャル 2017京都】最適化をする前に覚えておきたい技術
 
【Unite 2018 Tokyo】そろそろ楽がしたい!新アセットバンドルワークフロー&リソースマネージャー詳細解説
【Unite 2018 Tokyo】そろそろ楽がしたい!新アセットバンドルワークフロー&リソースマネージャー詳細解説【Unite 2018 Tokyo】そろそろ楽がしたい!新アセットバンドルワークフロー&リソースマネージャー詳細解説
【Unite 2018 Tokyo】そろそろ楽がしたい!新アセットバンドルワークフロー&リソースマネージャー詳細解説
 
Creating explosive real-time visuals with the Visual Effect Graph – Unite Cop...
Creating explosive real-time visuals with the Visual Effect Graph – Unite Cop...Creating explosive real-time visuals with the Visual Effect Graph – Unite Cop...
Creating explosive real-time visuals with the Visual Effect Graph – Unite Cop...
 
State-Based Scripting in Uncharted 2: Among Thieves
State-Based Scripting in Uncharted 2: Among ThievesState-Based Scripting in Uncharted 2: Among Thieves
State-Based Scripting in Uncharted 2: Among Thieves
 
アーティスト向けNSightの手引き
アーティスト向けNSightの手引きアーティスト向けNSightの手引き
アーティスト向けNSightの手引き
 
Introduction to A-Frame
Introduction to A-FrameIntroduction to A-Frame
Introduction to A-Frame
 
Game dev process
Game dev processGame dev process
Game dev process
 

Viewers also liked

Implementation of Thorup's Linear Time Algorithm for Undirected Single Source...
Implementation of Thorup's Linear Time Algorithm for Undirected Single Source...Implementation of Thorup's Linear Time Algorithm for Undirected Single Source...
Implementation of Thorup's Linear Time Algorithm for Undirected Single Source...
Nick Pruehs
 
Entity System Architecture with Unity - Unity User Group Berlin
Entity System Architecture with Unity - Unity User Group BerlinEntity System Architecture with Unity - Unity User Group Berlin
Entity System Architecture with Unity - Unity User Group Berlin
Simon Schmid
 
Game Programming 04 - Style & Design Principles
Game Programming 04 - Style & Design PrinciplesGame Programming 04 - Style & Design Principles
Game Programming 04 - Style & Design Principles
Nick Pruehs
 
Game Programming 08 - Tool Development
Game Programming 08 - Tool DevelopmentGame Programming 08 - Tool Development
Game Programming 08 - Tool Development
Nick Pruehs
 
Game Programming 13 - Debugging & Performance Optimization
Game Programming 13 - Debugging & Performance OptimizationGame Programming 13 - Debugging & Performance Optimization
Game Programming 13 - Debugging & Performance Optimization
Nick Pruehs
 
Game Models - A Different Approach
Game Models - A Different ApproachGame Models - A Different Approach
Game Models - A Different Approach
Nick Pruehs
 
Game Programming 10 - Localization
Game Programming 10 - LocalizationGame Programming 10 - Localization
Game Programming 10 - Localization
Nick Pruehs
 
What Would Blizzard Do
What Would Blizzard DoWhat Would Blizzard Do
What Would Blizzard Do
Nick Pruehs
 
School For Games 2015 - Unity Engine Basics
School For Games 2015 - Unity Engine BasicsSchool For Games 2015 - Unity Engine Basics
School For Games 2015 - Unity Engine Basics
Nick Pruehs
 
Tool Development A - Git
Tool Development A - GitTool Development A - Git
Tool Development A - Git
Nick Pruehs
 
Game Programming 09 - AI
Game Programming 09 - AIGame Programming 09 - AI
Game Programming 09 - AI
Nick Pruehs
 
Designing an actor model game architecture with Pony
Designing an actor model game architecture with PonyDesigning an actor model game architecture with Pony
Designing an actor model game architecture with Pony
Nick Pruehs
 
Entity System Architecture with Unity - Unite Europe 2015
Entity System Architecture with Unity - Unite Europe 2015Entity System Architecture with Unity - Unite Europe 2015
Entity System Architecture with Unity - Unite Europe 2015
Simon Schmid
 
Game Programming 12 - Shaders
Game Programming 12 - ShadersGame Programming 12 - Shaders
Game Programming 12 - Shaders
Nick Pruehs
 
Clean, fast and simple with Entitas and Unity - Unite Melbourne 2016
Clean, fast and simple with Entitas and Unity - Unite Melbourne 2016Clean, fast and simple with Entitas and Unity - Unite Melbourne 2016
Clean, fast and simple with Entitas and Unity - Unite Melbourne 2016
Simon Schmid
 
Game Development Challenges
Game Development ChallengesGame Development Challenges
Game Development Challenges
Nick Pruehs
 
Eight Rules for Making Your First Great Game
Eight Rules for Making Your First Great GameEight Rules for Making Your First Great Game
Eight Rules for Making Your First Great Game
Nick Pruehs
 
Scrum - but... Agile Game Development in Small Teams
Scrum - but... Agile Game Development in Small TeamsScrum - but... Agile Game Development in Small Teams
Scrum - but... Agile Game Development in Small Teams
Nick Pruehs
 
Game Programming 05 - Development Tools
Game Programming 05 - Development ToolsGame Programming 05 - Development Tools
Game Programming 05 - Development Tools
Nick Pruehs
 
Game Programming 06 - Automated Testing
Game Programming 06 - Automated TestingGame Programming 06 - Automated Testing
Game Programming 06 - Automated Testing
Nick Pruehs
 

Viewers also liked (20)

Implementation of Thorup's Linear Time Algorithm for Undirected Single Source...
Implementation of Thorup's Linear Time Algorithm for Undirected Single Source...Implementation of Thorup's Linear Time Algorithm for Undirected Single Source...
Implementation of Thorup's Linear Time Algorithm for Undirected Single Source...
 
Entity System Architecture with Unity - Unity User Group Berlin
Entity System Architecture with Unity - Unity User Group BerlinEntity System Architecture with Unity - Unity User Group Berlin
Entity System Architecture with Unity - Unity User Group Berlin
 
Game Programming 04 - Style & Design Principles
Game Programming 04 - Style & Design PrinciplesGame Programming 04 - Style & Design Principles
Game Programming 04 - Style & Design Principles
 
Game Programming 08 - Tool Development
Game Programming 08 - Tool DevelopmentGame Programming 08 - Tool Development
Game Programming 08 - Tool Development
 
Game Programming 13 - Debugging & Performance Optimization
Game Programming 13 - Debugging & Performance OptimizationGame Programming 13 - Debugging & Performance Optimization
Game Programming 13 - Debugging & Performance Optimization
 
Game Models - A Different Approach
Game Models - A Different ApproachGame Models - A Different Approach
Game Models - A Different Approach
 
Game Programming 10 - Localization
Game Programming 10 - LocalizationGame Programming 10 - Localization
Game Programming 10 - Localization
 
What Would Blizzard Do
What Would Blizzard DoWhat Would Blizzard Do
What Would Blizzard Do
 
School For Games 2015 - Unity Engine Basics
School For Games 2015 - Unity Engine BasicsSchool For Games 2015 - Unity Engine Basics
School For Games 2015 - Unity Engine Basics
 
Tool Development A - Git
Tool Development A - GitTool Development A - Git
Tool Development A - Git
 
Game Programming 09 - AI
Game Programming 09 - AIGame Programming 09 - AI
Game Programming 09 - AI
 
Designing an actor model game architecture with Pony
Designing an actor model game architecture with PonyDesigning an actor model game architecture with Pony
Designing an actor model game architecture with Pony
 
Entity System Architecture with Unity - Unite Europe 2015
Entity System Architecture with Unity - Unite Europe 2015Entity System Architecture with Unity - Unite Europe 2015
Entity System Architecture with Unity - Unite Europe 2015
 
Game Programming 12 - Shaders
Game Programming 12 - ShadersGame Programming 12 - Shaders
Game Programming 12 - Shaders
 
Clean, fast and simple with Entitas and Unity - Unite Melbourne 2016
Clean, fast and simple with Entitas and Unity - Unite Melbourne 2016Clean, fast and simple with Entitas and Unity - Unite Melbourne 2016
Clean, fast and simple with Entitas and Unity - Unite Melbourne 2016
 
Game Development Challenges
Game Development ChallengesGame Development Challenges
Game Development Challenges
 
Eight Rules for Making Your First Great Game
Eight Rules for Making Your First Great GameEight Rules for Making Your First Great Game
Eight Rules for Making Your First Great Game
 
Scrum - but... Agile Game Development in Small Teams
Scrum - but... Agile Game Development in Small TeamsScrum - but... Agile Game Development in Small Teams
Scrum - but... Agile Game Development in Small Teams
 
Game Programming 05 - Development Tools
Game Programming 05 - Development ToolsGame Programming 05 - Development Tools
Game Programming 05 - Development Tools
 
Game Programming 06 - Automated Testing
Game Programming 06 - Automated TestingGame Programming 06 - Automated Testing
Game Programming 06 - Automated Testing
 

Similar to Style & Design Principles 03 - Component-Based Entity Systems

ITCamp 2011 - Catalin Zima - Common pitfalls in Windows Phone 7 game development
ITCamp 2011 - Catalin Zima - Common pitfalls in Windows Phone 7 game developmentITCamp 2011 - Catalin Zima - Common pitfalls in Windows Phone 7 game development
ITCamp 2011 - Catalin Zima - Common pitfalls in Windows Phone 7 game development
ITCamp
 
Understanding and improving games through machine learning - Natasha Latysheva
Understanding and improving games through machine learning - Natasha LatyshevaUnderstanding and improving games through machine learning - Natasha Latysheva
Understanding and improving games through machine learning - Natasha Latysheva
Lauren Cormack
 
Soc research
Soc researchSoc research
Soc research
Bryan Duggan
 
GDC 2010 - A Dynamic Component Architecture for High Performance Gameplay
GDC 2010 - A Dynamic Component Architecture for High Performance GameplayGDC 2010 - A Dynamic Component Architecture for High Performance Gameplay
GDC 2010 - A Dynamic Component Architecture for High Performance Gameplay
Terrance Cohen
 
Debugging Complex Systems - Erlang Factory SF 2015
Debugging Complex Systems - Erlang Factory SF 2015Debugging Complex Systems - Erlang Factory SF 2015
Debugging Complex Systems - Erlang Factory SF 2015
lpgauth
 
Шлигін Олександр “Розробка ігор в Unity загальні помилки” GameDev Conference ...
Шлигін Олександр “Розробка ігор в Unity загальні помилки” GameDev Conference ...Шлигін Олександр “Розробка ігор в Unity загальні помилки” GameDev Conference ...
Шлигін Олександр “Розробка ігор в Unity загальні помилки” GameDev Conference ...
Lviv Startup Club
 
Style & Design Principles 02 - Design Patterns
Style & Design Principles 02 - Design PatternsStyle & Design Principles 02 - Design Patterns
Style & Design Principles 02 - Design Patterns
Nick Pruehs
 
Debugging multiplayer games
Debugging multiplayer gamesDebugging multiplayer games
Debugging multiplayer games
Maciej Siniło
 
Create a Scalable and Destructible World in HITMAN 2*
Create a Scalable and Destructible World in HITMAN 2*Create a Scalable and Destructible World in HITMAN 2*
Create a Scalable and Destructible World in HITMAN 2*
Intel® Software
 
Optimizing mobile applications - Ian Dundore, Mark Harkness
Optimizing mobile applications - Ian Dundore, Mark HarknessOptimizing mobile applications - Ian Dundore, Mark Harkness
Optimizing mobile applications - Ian Dundore, Mark Harkness
ozlael ozlael
 
0507 057 01 98 * Adana Cukurova Klima Servisleri
0507 057 01 98 * Adana Cukurova Klima Servisleri0507 057 01 98 * Adana Cukurova Klima Servisleri
PowerShell - Be A Cool Blue Kid
PowerShell - Be A Cool Blue KidPowerShell - Be A Cool Blue Kid
PowerShell - Be A Cool Blue Kid
Matthew Johnson
 
Parallelizing Conqueror's Blade
Parallelizing Conqueror's BladeParallelizing Conqueror's Blade
Parallelizing Conqueror's Blade
Intel® Software
 
JProfiler / an introduction
JProfiler / an introductionJProfiler / an introduction
JProfiler / an introduction
Tommaso Torti
 
ChatGPT in Education
ChatGPT in EducationChatGPT in Education
ChatGPT in Education
Victor del Rosal
 
Mastermind design walkthrough
Mastermind design walkthroughMastermind design walkthrough
Mastermind design walkthrough
Amir Shadaab Mohammed
 
cf.Objective() 2017 - Design patterns - Brad Wood
cf.Objective() 2017 - Design patterns - Brad Woodcf.Objective() 2017 - Design patterns - Brad Wood
cf.Objective() 2017 - Design patterns - Brad Wood
Ortus Solutions, Corp
 
GDC 2010 - A Dynamic Component Architecture for High Performance Gameplay - M...
GDC 2010 - A Dynamic Component Architecture for High Performance Gameplay - M...GDC 2010 - A Dynamic Component Architecture for High Performance Gameplay - M...
GDC 2010 - A Dynamic Component Architecture for High Performance Gameplay - M...
Terrance Cohen
 
Mapping Detection Coverage
Mapping Detection CoverageMapping Detection Coverage
Mapping Detection Coverage
Jared Atkinson
 
How and what to unit test
How and what to unit testHow and what to unit test
How and what to unit test
Eugenio Lentini
 

Similar to Style & Design Principles 03 - Component-Based Entity Systems (20)

ITCamp 2011 - Catalin Zima - Common pitfalls in Windows Phone 7 game development
ITCamp 2011 - Catalin Zima - Common pitfalls in Windows Phone 7 game developmentITCamp 2011 - Catalin Zima - Common pitfalls in Windows Phone 7 game development
ITCamp 2011 - Catalin Zima - Common pitfalls in Windows Phone 7 game development
 
Understanding and improving games through machine learning - Natasha Latysheva
Understanding and improving games through machine learning - Natasha LatyshevaUnderstanding and improving games through machine learning - Natasha Latysheva
Understanding and improving games through machine learning - Natasha Latysheva
 
Soc research
Soc researchSoc research
Soc research
 
GDC 2010 - A Dynamic Component Architecture for High Performance Gameplay
GDC 2010 - A Dynamic Component Architecture for High Performance GameplayGDC 2010 - A Dynamic Component Architecture for High Performance Gameplay
GDC 2010 - A Dynamic Component Architecture for High Performance Gameplay
 
Debugging Complex Systems - Erlang Factory SF 2015
Debugging Complex Systems - Erlang Factory SF 2015Debugging Complex Systems - Erlang Factory SF 2015
Debugging Complex Systems - Erlang Factory SF 2015
 
Шлигін Олександр “Розробка ігор в Unity загальні помилки” GameDev Conference ...
Шлигін Олександр “Розробка ігор в Unity загальні помилки” GameDev Conference ...Шлигін Олександр “Розробка ігор в Unity загальні помилки” GameDev Conference ...
Шлигін Олександр “Розробка ігор в Unity загальні помилки” GameDev Conference ...
 
Style & Design Principles 02 - Design Patterns
Style & Design Principles 02 - Design PatternsStyle & Design Principles 02 - Design Patterns
Style & Design Principles 02 - Design Patterns
 
Debugging multiplayer games
Debugging multiplayer gamesDebugging multiplayer games
Debugging multiplayer games
 
Create a Scalable and Destructible World in HITMAN 2*
Create a Scalable and Destructible World in HITMAN 2*Create a Scalable and Destructible World in HITMAN 2*
Create a Scalable and Destructible World in HITMAN 2*
 
Optimizing mobile applications - Ian Dundore, Mark Harkness
Optimizing mobile applications - Ian Dundore, Mark HarknessOptimizing mobile applications - Ian Dundore, Mark Harkness
Optimizing mobile applications - Ian Dundore, Mark Harkness
 
0507 057 01 98 * Adana Cukurova Klima Servisleri
0507 057 01 98 * Adana Cukurova Klima Servisleri0507 057 01 98 * Adana Cukurova Klima Servisleri
0507 057 01 98 * Adana Cukurova Klima Servisleri
 
PowerShell - Be A Cool Blue Kid
PowerShell - Be A Cool Blue KidPowerShell - Be A Cool Blue Kid
PowerShell - Be A Cool Blue Kid
 
Parallelizing Conqueror's Blade
Parallelizing Conqueror's BladeParallelizing Conqueror's Blade
Parallelizing Conqueror's Blade
 
JProfiler / an introduction
JProfiler / an introductionJProfiler / an introduction
JProfiler / an introduction
 
ChatGPT in Education
ChatGPT in EducationChatGPT in Education
ChatGPT in Education
 
Mastermind design walkthrough
Mastermind design walkthroughMastermind design walkthrough
Mastermind design walkthrough
 
cf.Objective() 2017 - Design patterns - Brad Wood
cf.Objective() 2017 - Design patterns - Brad Woodcf.Objective() 2017 - Design patterns - Brad Wood
cf.Objective() 2017 - Design patterns - Brad Wood
 
GDC 2010 - A Dynamic Component Architecture for High Performance Gameplay - M...
GDC 2010 - A Dynamic Component Architecture for High Performance Gameplay - M...GDC 2010 - A Dynamic Component Architecture for High Performance Gameplay - M...
GDC 2010 - A Dynamic Component Architecture for High Performance Gameplay - M...
 
Mapping Detection Coverage
Mapping Detection CoverageMapping Detection Coverage
Mapping Detection Coverage
 
How and what to unit test
How and what to unit testHow and what to unit test
How and what to unit test
 

More from Nick Pruehs

Unreal Engine Basics 06 - Animation, Audio, Visual Effects
Unreal Engine Basics 06 - Animation, Audio, Visual EffectsUnreal Engine Basics 06 - Animation, Audio, Visual Effects
Unreal Engine Basics 06 - Animation, Audio, Visual Effects
Nick Pruehs
 
Unreal Engine Basics 05 - User Interface
Unreal Engine Basics 05 - User InterfaceUnreal Engine Basics 05 - User Interface
Unreal Engine Basics 05 - User Interface
Nick Pruehs
 
Unreal Engine Basics 04 - Behavior Trees
Unreal Engine Basics 04 - Behavior TreesUnreal Engine Basics 04 - Behavior Trees
Unreal Engine Basics 04 - Behavior Trees
Nick Pruehs
 
Unreal Engine Basics 03 - Gameplay
Unreal Engine Basics 03 - GameplayUnreal Engine Basics 03 - Gameplay
Unreal Engine Basics 03 - Gameplay
Nick Pruehs
 
Unreal Engine Basics 02 - Unreal Editor
Unreal Engine Basics 02 - Unreal EditorUnreal Engine Basics 02 - Unreal Editor
Unreal Engine Basics 02 - Unreal Editor
Nick Pruehs
 
Unreal Engine Basics 01 - Game Framework
Unreal Engine Basics 01 - Game FrameworkUnreal Engine Basics 01 - Game Framework
Unreal Engine Basics 01 - Game Framework
Nick Pruehs
 
Game Programming - Cloud Development
Game Programming - Cloud DevelopmentGame Programming - Cloud Development
Game Programming - Cloud Development
Nick Pruehs
 
Game Programming - Git
Game Programming - GitGame Programming - Git
Game Programming - Git
Nick Pruehs
 
Game Programming 01 - Introduction
Game Programming 01 - IntroductionGame Programming 01 - Introduction
Game Programming 01 - Introduction
Nick Pruehs
 
Game Programming 00 - Exams
Game Programming 00 - ExamsGame Programming 00 - Exams
Game Programming 00 - Exams
Nick Pruehs
 

More from Nick Pruehs (10)

Unreal Engine Basics 06 - Animation, Audio, Visual Effects
Unreal Engine Basics 06 - Animation, Audio, Visual EffectsUnreal Engine Basics 06 - Animation, Audio, Visual Effects
Unreal Engine Basics 06 - Animation, Audio, Visual Effects
 
Unreal Engine Basics 05 - User Interface
Unreal Engine Basics 05 - User InterfaceUnreal Engine Basics 05 - User Interface
Unreal Engine Basics 05 - User Interface
 
Unreal Engine Basics 04 - Behavior Trees
Unreal Engine Basics 04 - Behavior TreesUnreal Engine Basics 04 - Behavior Trees
Unreal Engine Basics 04 - Behavior Trees
 
Unreal Engine Basics 03 - Gameplay
Unreal Engine Basics 03 - GameplayUnreal Engine Basics 03 - Gameplay
Unreal Engine Basics 03 - Gameplay
 
Unreal Engine Basics 02 - Unreal Editor
Unreal Engine Basics 02 - Unreal EditorUnreal Engine Basics 02 - Unreal Editor
Unreal Engine Basics 02 - Unreal Editor
 
Unreal Engine Basics 01 - Game Framework
Unreal Engine Basics 01 - Game FrameworkUnreal Engine Basics 01 - Game Framework
Unreal Engine Basics 01 - Game Framework
 
Game Programming - Cloud Development
Game Programming - Cloud DevelopmentGame Programming - Cloud Development
Game Programming - Cloud Development
 
Game Programming - Git
Game Programming - GitGame Programming - Git
Game Programming - Git
 
Game Programming 01 - Introduction
Game Programming 01 - IntroductionGame Programming 01 - Introduction
Game Programming 01 - Introduction
 
Game Programming 00 - Exams
Game Programming 00 - ExamsGame Programming 00 - Exams
Game Programming 00 - Exams
 

Recently uploaded

Poznań ACE event - 19.06.2024 Team 24 Wrapup slidedeck
Poznań ACE event - 19.06.2024 Team 24 Wrapup slidedeckPoznań ACE event - 19.06.2024 Team 24 Wrapup slidedeck
Poznań ACE event - 19.06.2024 Team 24 Wrapup slidedeck
FilipTomaszewski5
 
Christine's Product Research Presentation.pptx
Christine's Product Research Presentation.pptxChristine's Product Research Presentation.pptx
Christine's Product Research Presentation.pptx
christinelarrosa
 
Mutation Testing for Task-Oriented Chatbots
Mutation Testing for Task-Oriented ChatbotsMutation Testing for Task-Oriented Chatbots
Mutation Testing for Task-Oriented Chatbots
Pablo Gómez Abajo
 
PRODUCT LISTING OPTIMIZATION PRESENTATION.pptx
PRODUCT LISTING OPTIMIZATION PRESENTATION.pptxPRODUCT LISTING OPTIMIZATION PRESENTATION.pptx
PRODUCT LISTING OPTIMIZATION PRESENTATION.pptx
christinelarrosa
 
Harnessing the Power of NLP and Knowledge Graphs for Opioid Research
Harnessing the Power of NLP and Knowledge Graphs for Opioid ResearchHarnessing the Power of NLP and Knowledge Graphs for Opioid Research
Harnessing the Power of NLP and Knowledge Graphs for Opioid Research
Neo4j
 
Day 2 - Intro to UiPath Studio Fundamentals
Day 2 - Intro to UiPath Studio FundamentalsDay 2 - Intro to UiPath Studio Fundamentals
Day 2 - Intro to UiPath Studio Fundamentals
UiPathCommunity
 
Essentials of Automations: Exploring Attributes & Automation Parameters
Essentials of Automations: Exploring Attributes & Automation ParametersEssentials of Automations: Exploring Attributes & Automation Parameters
Essentials of Automations: Exploring Attributes & Automation Parameters
Safe Software
 
JavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green MasterplanJavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green Masterplan
Miro Wengner
 
QA or the Highway - Component Testing: Bridging the gap between frontend appl...
QA or the Highway - Component Testing: Bridging the gap between frontend appl...QA or the Highway - Component Testing: Bridging the gap between frontend appl...
QA or the Highway - Component Testing: Bridging the gap between frontend appl...
zjhamm304
 
AppSec PNW: Android and iOS Application Security with MobSF
AppSec PNW: Android and iOS Application Security with MobSFAppSec PNW: Android and iOS Application Security with MobSF
AppSec PNW: Android and iOS Application Security with MobSF
Ajin Abraham
 
"Scaling RAG Applications to serve millions of users", Kevin Goedecke
"Scaling RAG Applications to serve millions of users",  Kevin Goedecke"Scaling RAG Applications to serve millions of users",  Kevin Goedecke
"Scaling RAG Applications to serve millions of users", Kevin Goedecke
Fwdays
 
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
Alex Pruden
 
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-EfficiencyFreshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
ScyllaDB
 
"NATO Hackathon Winner: AI-Powered Drug Search", Taras Kloba
"NATO Hackathon Winner: AI-Powered Drug Search",  Taras Kloba"NATO Hackathon Winner: AI-Powered Drug Search",  Taras Kloba
"NATO Hackathon Winner: AI-Powered Drug Search", Taras Kloba
Fwdays
 
"Choosing proper type of scaling", Olena Syrota
"Choosing proper type of scaling", Olena Syrota"Choosing proper type of scaling", Olena Syrota
"Choosing proper type of scaling", Olena Syrota
Fwdays
 
Demystifying Knowledge Management through Storytelling
Demystifying Knowledge Management through StorytellingDemystifying Knowledge Management through Storytelling
Demystifying Knowledge Management through Storytelling
Enterprise Knowledge
 
From Natural Language to Structured Solr Queries using LLMs
From Natural Language to Structured Solr Queries using LLMsFrom Natural Language to Structured Solr Queries using LLMs
From Natural Language to Structured Solr Queries using LLMs
Sease
 
Christine's Supplier Sourcing Presentaion.pptx
Christine's Supplier Sourcing Presentaion.pptxChristine's Supplier Sourcing Presentaion.pptx
Christine's Supplier Sourcing Presentaion.pptx
christinelarrosa
 
Crafting Excellence: A Comprehensive Guide to iOS Mobile App Development Serv...
Crafting Excellence: A Comprehensive Guide to iOS Mobile App Development Serv...Crafting Excellence: A Comprehensive Guide to iOS Mobile App Development Serv...
Crafting Excellence: A Comprehensive Guide to iOS Mobile App Development Serv...
Pitangent Analytics & Technology Solutions Pvt. Ltd
 
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
Chart Kalyan
 

Recently uploaded (20)

Poznań ACE event - 19.06.2024 Team 24 Wrapup slidedeck
Poznań ACE event - 19.06.2024 Team 24 Wrapup slidedeckPoznań ACE event - 19.06.2024 Team 24 Wrapup slidedeck
Poznań ACE event - 19.06.2024 Team 24 Wrapup slidedeck
 
Christine's Product Research Presentation.pptx
Christine's Product Research Presentation.pptxChristine's Product Research Presentation.pptx
Christine's Product Research Presentation.pptx
 
Mutation Testing for Task-Oriented Chatbots
Mutation Testing for Task-Oriented ChatbotsMutation Testing for Task-Oriented Chatbots
Mutation Testing for Task-Oriented Chatbots
 
PRODUCT LISTING OPTIMIZATION PRESENTATION.pptx
PRODUCT LISTING OPTIMIZATION PRESENTATION.pptxPRODUCT LISTING OPTIMIZATION PRESENTATION.pptx
PRODUCT LISTING OPTIMIZATION PRESENTATION.pptx
 
Harnessing the Power of NLP and Knowledge Graphs for Opioid Research
Harnessing the Power of NLP and Knowledge Graphs for Opioid ResearchHarnessing the Power of NLP and Knowledge Graphs for Opioid Research
Harnessing the Power of NLP and Knowledge Graphs for Opioid Research
 
Day 2 - Intro to UiPath Studio Fundamentals
Day 2 - Intro to UiPath Studio FundamentalsDay 2 - Intro to UiPath Studio Fundamentals
Day 2 - Intro to UiPath Studio Fundamentals
 
Essentials of Automations: Exploring Attributes & Automation Parameters
Essentials of Automations: Exploring Attributes & Automation ParametersEssentials of Automations: Exploring Attributes & Automation Parameters
Essentials of Automations: Exploring Attributes & Automation Parameters
 
JavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green MasterplanJavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green Masterplan
 
QA or the Highway - Component Testing: Bridging the gap between frontend appl...
QA or the Highway - Component Testing: Bridging the gap between frontend appl...QA or the Highway - Component Testing: Bridging the gap between frontend appl...
QA or the Highway - Component Testing: Bridging the gap between frontend appl...
 
AppSec PNW: Android and iOS Application Security with MobSF
AppSec PNW: Android and iOS Application Security with MobSFAppSec PNW: Android and iOS Application Security with MobSF
AppSec PNW: Android and iOS Application Security with MobSF
 
"Scaling RAG Applications to serve millions of users", Kevin Goedecke
"Scaling RAG Applications to serve millions of users",  Kevin Goedecke"Scaling RAG Applications to serve millions of users",  Kevin Goedecke
"Scaling RAG Applications to serve millions of users", Kevin Goedecke
 
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
 
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-EfficiencyFreshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
 
"NATO Hackathon Winner: AI-Powered Drug Search", Taras Kloba
"NATO Hackathon Winner: AI-Powered Drug Search",  Taras Kloba"NATO Hackathon Winner: AI-Powered Drug Search",  Taras Kloba
"NATO Hackathon Winner: AI-Powered Drug Search", Taras Kloba
 
"Choosing proper type of scaling", Olena Syrota
"Choosing proper type of scaling", Olena Syrota"Choosing proper type of scaling", Olena Syrota
"Choosing proper type of scaling", Olena Syrota
 
Demystifying Knowledge Management through Storytelling
Demystifying Knowledge Management through StorytellingDemystifying Knowledge Management through Storytelling
Demystifying Knowledge Management through Storytelling
 
From Natural Language to Structured Solr Queries using LLMs
From Natural Language to Structured Solr Queries using LLMsFrom Natural Language to Structured Solr Queries using LLMs
From Natural Language to Structured Solr Queries using LLMs
 
Christine's Supplier Sourcing Presentaion.pptx
Christine's Supplier Sourcing Presentaion.pptxChristine's Supplier Sourcing Presentaion.pptx
Christine's Supplier Sourcing Presentaion.pptx
 
Crafting Excellence: A Comprehensive Guide to iOS Mobile App Development Serv...
Crafting Excellence: A Comprehensive Guide to iOS Mobile App Development Serv...Crafting Excellence: A Comprehensive Guide to iOS Mobile App Development Serv...
Crafting Excellence: A Comprehensive Guide to iOS Mobile App Development Serv...
 
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
 

Style & Design Principles 03 - Component-Based Entity Systems

  • 1. Style & Design Principles Chapter 03: Component-Based Entity Systems Nick Prühs
  • 2. 5 Minute Review Session • What’s the difference between inheritance and aggregation? • Explain the three types of polymorphism! • What’s the difference between cohesion and coupling? • What are software design patterns? • Explain three types of software design patterns, and name an example for each one! 2 / 58
  • 4. Objectives • To understand the disadvantages of inheritance- based game models • To learn how to build an aggregation-based game models • To understand the advantages and disadvantages of aggregation-based game models 4 / 58
  • 5. “Say you’re an engineer… … set out to create a new Game Object System from scratch, and you’re going to ‘do it right the first time’. You talk to your designer and say ‘What kind of content are we going to have in this game?’ They respond with ‘Oh lots of stuff, trees, and birds, and bushes, and keys and locks and … <trailing off>’ And your eyes glaze over as you start thinking of fancy C++ ways to solve the problem. The object oriented programming sages tell you to try to determine Is-A relationships and abstract functionality and all that other fun stuff. You go to the book store and buy a C++ book just to be sure, and it tells you to fire up your $5000 UML editor. [...]” - Scott Bilas 5 / 58
  • 12. Entities • Object in your game world • Can (or cannot)… • be visible • move around • attack • explode • be targeted • become selected • follow a path • Common across all genres 12 / 58
  • 15. Approach #1: Inheritance • Entity base class • That class and its subclasses encapsulate the main game logic 15 / 58
  • 16. Example #1: Unreal Engine 3 • Base class Actor • Rendering • Animation • Sound • Physics • Almost everything in Unreal is an Actor • Pawn extends by taking damage • Projectile extends by spawning impact effects 16 / 58
  • 17. Drawbacks of inheritance-based game models • Diamond of Death 17 / 58
  • 18. Drawbacks of inheritance-based game models • Code added to the root of the inheritance tree causes big overhead • Code added to the leafs of the tree tends to get copied • Root and leaf classes tend to get very big 18 / 58
  • 19. Where is Waldo? public override void Update(float dt) { this.SystemManager.Update(dt); this.EventManager.ProcessEvents(dt); } 19 / 58
  • 20. Where is Waldo? public override void Update(float dt) { this.SystemManager.Update(dt); this.EventManager.ProcessEvents(dt); } 20 / 58
  • 21. Where is Waldo? public override void Update(float dt) { base.Update(dt); this.SystemManager.Update(dt); this.EventManager.ProcessEvents(dt); } 21 / 58
  • 22. Drawbacks of inheritance-based game models • Always need to understand all base classes along the inheritance tree • Impossible to enforce calling base class functions • Someone will forget it. Trust me. • And you’re gonna spend your whole evening finding that one missing base.Update(). • Deep class hierarchies will more likely run into call order issues 22 / 58
  • 23. Inheritance-based game models are… • … difficult to develop • … difficult to maintain • … difficult to extend 23 / 58
  • 24. “There are probably hundreds of ways… … you could decompose your systems and come up with a set of classes […], and eventually, all of them are wrong. This isn’t to say that they won’t work, but games are constantly changing, constantly invalidating your carefully planned designs. [...] So you hand off your new Game Object System and go work on other things. Then one day your designer says that they want a new type of “alien” asteroid that acts just like a heat seeking missile, except it’s still an asteroid.” - Scott Bilas 24 / 58
  • 28. Approach #2: Aggregation • Popular since Gas Powered Games’ Dungeon Siege • Introduced long before • Entities are aggregations of components • Which in turn encapsulate independent functionality • Corresponds to recommendations by the Gang of Four • “favor object composition over class inheritance” • Similar approach is used by the Unity3D game engine • Just for clarification: Unreal uses components as well, called ActorComponent • Got much more prominent in latest UDK release 28 / 58
  • 29. Approach #2a • Create an Entity class • Add references to all available components • Has obvious disadvantages: • Many component references will be null pointers for most entities • Big unnecessary memory overhead • Entity class has to be updated each time a new component is introduced 29 / 58
  • 30. Approach #2b • Create an Entity class • Introduce a common base class for components • Entities hold a collection of Component objects • Reduced the memory overhead • Increased extensibility • Already gets close to an optimal solution • easy to build, maintain and debug • easy to implement new design ideas without breaking existing code 30 / 58
  • 31. However, we can do better. 31 / 58
  • 32. Approach #2c: Entity Systems 32 / 57
  • 33. Approach #2c: Entity Systems 33 / 58
  • 34. Approach #2c: Entity Systems • Game entities are nothing more than just an id • Thus, no data or methods on entities • No methods on components, either: all functionality goes into what is called a system • PhysicsSystem • HealthSystem • FightSystem • Entirely operate on their corresponding components 34 / 58
  • 35. “All the data goes into the Components. All of it. Think you can take some “really common” data, e. g. the x-/y-/z-coordinates of the in-game object, and put it into the Entity itself? Nope. Don’t go there. As soon as you start migrating data into the Entity, you’ve lost. By definition the only valid place for the data is inside the Component.” - Adam Martin 35 / 58
  • 36. Example #2: Simple Fight 36 / 58
  • 37. Example #2: Simple Fight 37 / 58
  • 38. Example #2: Simple Fight 38 / 58
  • 39. Example #2: Simple Fight 39 / 58
  • 40. Example #2: Simple Fight 40 / 58
  • 41. Example #2: Simple Fight 41 / 58
  • 42. Example #2: Simple Fight 42 / 58
  • 43. Example #2: Simple Fight 43 / 58
  • 44. Example #2: Simple Fight 44 / 58
  • 45. Example #2: Simple Fight 45 / 58
  • 46. Inter-System Communication Systems communicate by the means of events, only. • No coupling between systems • Easy to add or remove systems at any time • Great architectural advantage for general game features • Need multiplayer? Just send the events over the network! • Need AI? Just make it create events which are handled just like player input is! • Need replays? Just write all events with timestamps to a file! 46 / 58
  • 49. Advantages of Entity Systems • Update order is obvious • Components can easily be pooled and re-used • Independent systems can be updated by separate threads • Data can easily be serialized and stored in a database 49 / 58
  • 50. Disadvantages of Entity Systems (?) • Lookups cause performance hit • Resist the urge to add cross-component references – this would make you lose all of the advantages mentioned before • Just don’t flood your system with unnecessary component types – just as you would always do • Misbelief that it takes longer to “get the job done” • Used at the InnoGames Game Jam #3 for creating a multi-platform multi-player real-time tactics game in just 48 hours – spending the little extra effort at the beginning pays off • Always. 50 / 58
  • 51. Future Prospects • Attribute Tables • store arbitrary key-value-pairs • used for initializing all components of an entity 51 / 57 <AttributeTable> <Attribute keyType="System.String" valueType="System.Single"> <Key>EnemyHealthModificationComponent.EnemyHealthModifier</Key> <Value>-3</Value> </Attribute> <Attribute keyType="System.String" valueType="System.String"> <Key>ActionComponent.Name</Key> <Value>Take that!</Value> </Attribute> </AttributeTable>
  • 52. Future Prospects • Blueprints • consist of a list of components and an attribute table • created with some kind of editor tool by designers • used for creating entites at run-time 52 / 57 <Blueprint> <ComponentTypes> <ComponentType>FreudBot.Logic.Components.ActionComponent</ComponentType> <ComponentType>FreudBot.Logic.Components.EnemyHealthModificationComponent</ComponentType> </ComponentTypes> <AttributeTable> <Attribute keyType="System.String" valueType="System.Single"> <Key>EnemyHealthModificationComponent.EnemyHealthModifier</Key> <Value>-3</Value> </Attribute> <Attribute keyType="System.String" valueType="System.String"> <Key>ActionComponent.Name</Key> <Value>Take that!</Value> </Attribute> </AttributeTable> </Blueprint>
  • 53. Future Prospects 53 / 57 StarCraft II Galaxy Editor
  • 54. Future Prospects 54 / 57 StarCraft II Galaxy Editor
  • 55. Future Prospects • Hierarchical Attribute Tables • used for overloading blueprints with specific entity attribute values • e.g. reduced initial health 55 / 57
  • 56. Future Prospects 56 / 57 StarCraft II Galaxy Editor
  • 57. Future Prospects public int CreateEntity(Blueprint blueprint, IAttributeTable configuration) { int entityId = this.CreateEntity(); // Setup attribute table. HierarchicalAttributeTable attributeTable = new HierarchicalAttributeTable(); attributeTable.AddParent(blueprint.GetAttributeTable()); attributeTable.AddParent(configuration); // Add components. foreach (Type componentType in blueprint.GetAllComponentTypes()) { // Create component. IEntityComponent component = (IEntityComponent)Activator.CreateInstance(componentType); // Add component to entity. this.AddComponent(entityId, component); // Initialize component with the attribute table data. component.InitComponent(attributeTable); } // Raise event. this.game.EventManager.QueueEvent(FrameworkEventType.EntityInitialized, entityId); return entityId; } 57 / 57
  • 58. Takeaway • inheritance-based game models show a lot of disadvantages • entity systems are easy to maintain and debug • provide great extensibility without the necessity of modifying existing code • show better performance characteristics for both memory and CPU load • easy to implement commonly used features • scripting • serialization • logging 58 / 57
  • 59. References • Mick West. Evolve Your Hierarchy. http://cowboyprogramming.com/2007/01/05/evolve-your- heirachy/, January 5, 2007. • Levi Baker. Entity Systems Part 1: Entity and EntityManager. http://blog.chronoclast.com/2010/12/entity-systems-part-1-entity-and.html, December 24, 2010. • Kyle Wilson. Game Object Structure: Inheritance vs. Aggregation. http://gamearchitect.net/Articles/GameObjects1.html, July 3, 2002. • Adam Martin. Entity Systems are the future of MMOG development – Part 1. http://t- machine.org/index.php/2007/09/03/entity-systems-are-the-future-of-mmog-development-part- 1/, September 3, 2007. • Adam Martin. Entity Systems: what makes good Components? good Entities? http://t- machine.org/index.php/2012/03/16/entity-systems-what-makes-good-components-good- entities/, March 16, 2012. • Scott Bilas. A Data-Driven Game Object System. http://scottbilas.com/files/2002/gdc_san_jose/game_objects_slides_with_notes.pdf, Slides, GDC 2002. • Scott Bilas. A Data-Driven Game Object System. http://scottbilas.com/files/2002/gdc_san_jose/game_objects_paper.pdf, Paper, GDC 2002. • Insomniac Games. A Dynamic Component Architecture for High Performance Gameplay. http://www.insomniacgames.com/a-dynamic-component-architecture-for-high-performance- gameplay/, June 1, 2010. 59 / 57
  • 60. Thank you for your attention! Contact Mail dev@npruehs.de Blog http://www.npruehs.de Twitter @npruehs Github https://github.com/npruehs 60 / 58