SlideShare une entreprise Scribd logo
1  sur  49
Télécharger pour lire hors ligne
Component-based
Entity System
in
Mobile Game Development
Cody Nguyen
(cody.haind@gmail.com)
GameArchitecture
Bigger project needs better architecture
What is
a good architecture?
A good architecture…
• Is easy to understand & maintain
• Welcomes changes
• Maximizes code reuse, minimizes duplication
Why doesVTT need
a good architecture?
Big game (dev-wise)
• Online tower defense, card collection on mobile
Big game (dev-wise)
• > 500 characters w/ different upgrade strategies
Big game (dev-wise)
• > 500 characters w/ different upgrade strategies
Big game (dev-wise)
• > 500 characters w/ different upgrade strategies
Big game (dev-wise)
• > 500 characters w/ different upgrade strategies
Big game (dev-wise)
• Complex items system: equip, enhance, forge
Big game (dev-wise)
• Complex items system: equip, enhance, forge
Big game (dev-wise)
• Complex items system: equip, enhance, forge
Big game (dev-wise)
• 8 game modes for the 500 characters to perform
Big game (dev-wise)
• 8 game modes for the 500 characters to perform
Big game (dev-wise)
• 8 game modes for the 500 characters to perform
Big game (dev-wise)
• 8 game modes for the 500 characters to perform
Big game (dev-wise)
• 8 game modes for the 500 characters to perform
Big game (dev-wise)
• 8 game modes for the 500 characters to perform
Game data & config need to be
human-friendly and easy to change
• Game designers & operators are lazy human beings
Anh Cody ơi
giảm base dam,
tăng máu cho
Thạch Sanh hộ
em
Tự vào admin panel
chỉnh đê!!!
Short on time, while requirements
change fast
• Reuse as much as possible
• Adapt to change
What is the most suitable
architecture forVTT?
OOP?
• Easy to understand
• Suitable for small project
Game objects usually share common (set of) functionalities
Bird Collision,Graphics,Animation,
TouchHandling
Pipe Collision,Graphics, Movement
Ground Collision,Graphics, Movement
Inheritance
Collidable
(Collision)
Pipe
Checkpoint
Renderable
Animatable
(Animation)
Bird
Movable
(Movement)
Pipe Ground
Inheritance
Collidable
(Collision)
Pipe
Checkpoint
Renderable
Animatable
(Animation)
Bird
Movable
(Movement)
Pipe Ground
Mixins or Multiple-inheritance. No!!!
Bird Pipe Ground
Collidable
(Collision)
Renderable
Animatable
(Animation)
Movable
(Movement)
Pipe
Checkpoint
Base Game
Object
It’s hard to create a good OO
architecture for bigger & more
complicated games
• Impossible to build a good OOP class hierachy
• Where to put logic code that process objects of 2+
different classes?
• Easy to make mistake when working in team
Component-based
entity system
Component-based Entity System
• A hot topics in recent years
• Unity3D is an example
Component-based Entity System
• Multitude of ways to
represent & implement
Component-based Entity System
3 components:
• Entity
• Component
• System
Entities – Components
Graphics Anim Move
Along Path
Attack Skill Collection
Bonus
Officer (defend) x x x x x
Officer (run) x x x
Soldier (defend) x x x
Soldier (run) x x x
Animal x x x
• Decompose game entities by capabilities into reusable components
– Components contains only data
– Each entity has an unique ID and a list of components
• Create entities by picking the desired components
Systems
• Divide game aspects into systems
• Systems process only entities they care about in each game loop
Move Along
Path Sys
Animation
Sys
Collection
Bonus Sys Attack Sys Skill Sys
Officer
(defend)
Officer (run)
Soldier
(defend)
Soldier (run) Animal
Entities – Components - Systems
Artemis Entity System
• An open-source Entity System Framework originally
written in Java
• Ported to many languages
Benefits
Goes hand-in-hand with
Data-Driven Methodology
• Components are just data, separated from game logic. Entities are just
bag of components
– Can be stored & retrieved from anywhere
– Human can make changes easily
MongoDB as database
• Flexible data structure, welcomes changes
• Easy synchronization between client / backend
Easy synchronization between client / backend
Easy synchronization between client / backend
Promote multi-threading
• Systems are independent from one another
-> can be run in separate threads
Conclusions
Online Game + Entity System = WIN
References
• A Data-DrivenGame Object System
http://scottbilas.com/files/2002/gdc_san_jose/game_objects_slides.ppt
• Entity Systems are the future of MMOG development
http://t-machine.org/index.php/2007/11/11/entity-systems-are-the-
future-of-mmog-development-part-2/
• EvolveYour Hierarchy
http://cowboyprogramming.com/2007/01/05/evolve-your-heirachy/
• http://gamedev.stackexchange.com/a/31491
THANKYOU!

Contenu connexe

Similaire à OGDC 2014_Entity system in mobile game development_Mr. Cody nguyen

MMO Design Architecture by Andrew
MMO Design Architecture by AndrewMMO Design Architecture by Andrew
MMO Design Architecture by Andrew
Agate Studio
 
Supersize your production pipe enjmin 2013 v1.1 hd
Supersize your production pipe    enjmin 2013 v1.1 hdSupersize your production pipe    enjmin 2013 v1.1 hd
Supersize your production pipe enjmin 2013 v1.1 hd
slantsixgames
 
OGDC 2014: Component based entity system mobile game development
OGDC 2014: Component based entity system mobile game developmentOGDC 2014: Component based entity system mobile game development
OGDC 2014: Component based entity system mobile game development
GameLandVN
 

Similaire à OGDC 2014_Entity system in mobile game development_Mr. Cody nguyen (20)

Sephy engine development document
Sephy engine development documentSephy engine development document
Sephy engine development document
 
a data driven game object system
a data driven game object systema data driven game object system
a data driven game object system
 
GameDev 2017 - Анатолій Ландишев "AAA architecture in Unity3D"
GameDev 2017 - Анатолій Ландишев "AAA architecture in Unity3D"GameDev 2017 - Анатолій Ландишев "AAA architecture in Unity3D"
GameDev 2017 - Анатолій Ландишев "AAA architecture in Unity3D"
 
Game object models - Game Engine Architecture
Game object models - Game Engine ArchitectureGame object models - Game Engine Architecture
Game object models - Game Engine Architecture
 
GDC Europe 2014: Unreal Engine 4 for Programmers - Lessons Learned & Things t...
GDC Europe 2014: Unreal Engine 4 for Programmers - Lessons Learned & Things t...GDC Europe 2014: Unreal Engine 4 for Programmers - Lessons Learned & Things t...
GDC Europe 2014: Unreal Engine 4 for Programmers - Lessons Learned & Things t...
 
Supersize Your Production Pipe
Supersize Your Production PipeSupersize Your Production Pipe
Supersize Your Production Pipe
 
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...
 
Enterprise Tic-Tac-Toe
Enterprise Tic-Tac-ToeEnterprise Tic-Tac-Toe
Enterprise Tic-Tac-Toe
 
Connect (4|n)
Connect (4|n)Connect (4|n)
Connect (4|n)
 
Scale CPU Experiences: Maximize Unity* Performance Using the Entity Component...
Scale CPU Experiences: Maximize Unity* Performance Using the Entity Component...Scale CPU Experiences: Maximize Unity* Performance Using the Entity Component...
Scale CPU Experiences: Maximize Unity* Performance Using the Entity Component...
 
Game Programming 02 - Component-Based Entity Systems
Game Programming 02 - Component-Based Entity SystemsGame Programming 02 - Component-Based Entity Systems
Game Programming 02 - Component-Based Entity Systems
 
MMO Design Architecture by Andrew
MMO Design Architecture by AndrewMMO Design Architecture by Andrew
MMO Design Architecture by Andrew
 
Maximize Your Production Effort (English)
Maximize Your Production Effort (English)Maximize Your Production Effort (English)
Maximize Your Production Effort (English)
 
Supersize your production pipe enjmin 2013 v1.1 hd
Supersize your production pipe    enjmin 2013 v1.1 hdSupersize your production pipe    enjmin 2013 v1.1 hd
Supersize your production pipe enjmin 2013 v1.1 hd
 
My 10 days with Phaser.js - WarsawJS Meetup #13
My 10 days with Phaser.js - WarsawJS Meetup #13My 10 days with Phaser.js - WarsawJS Meetup #13
My 10 days with Phaser.js - WarsawJS Meetup #13
 
Thomas Blair Portfolio
Thomas Blair PortfolioThomas Blair Portfolio
Thomas Blair Portfolio
 
Lecture 02: Layered Architecture of Game Engine | GAMES104 - Modern Game Engi...
Lecture 02: Layered Architecture of Game Engine | GAMES104 - Modern Game Engi...Lecture 02: Layered Architecture of Game Engine | GAMES104 - Modern Game Engi...
Lecture 02: Layered Architecture of Game Engine | GAMES104 - Modern Game Engi...
 
OGDC 2014: Component based entity system mobile game development
OGDC 2014: Component based entity system mobile game developmentOGDC 2014: Component based entity system mobile game development
OGDC 2014: Component based entity system mobile game development
 
This was a triumph: Evolving intelligent bots for videogames. And for Science.
This was a triumph: Evolving intelligent bots for videogames. And for Science. This was a triumph: Evolving intelligent bots for videogames. And for Science.
This was a triumph: Evolving intelligent bots for videogames. And for Science.
 
Soc research
Soc researchSoc research
Soc research
 

Plus de ogdc

OGDC 2014_Sky Garden Mobile conceptualization: From PC to Mobile_Mr. Luc Hoan...
OGDC 2014_Sky Garden Mobile conceptualization: From PC to Mobile_Mr. Luc Hoan...OGDC 2014_Sky Garden Mobile conceptualization: From PC to Mobile_Mr. Luc Hoan...
OGDC 2014_Sky Garden Mobile conceptualization: From PC to Mobile_Mr. Luc Hoan...
ogdc
 
OGDC 2014_Vietnam Mobile Internet 2014: A focus in smartphone game and compar...
OGDC 2014_Vietnam Mobile Internet 2014: A focus in smartphone game and compar...OGDC 2014_Vietnam Mobile Internet 2014: A focus in smartphone game and compar...
OGDC 2014_Vietnam Mobile Internet 2014: A focus in smartphone game and compar...
ogdc
 
OGDC 2014_Vietnam Smartphone game market 2013 overview. From vision to action...
OGDC 2014_Vietnam Smartphone game market 2013 overview. From vision to action...OGDC 2014_Vietnam Smartphone game market 2013 overview. From vision to action...
OGDC 2014_Vietnam Smartphone game market 2013 overview. From vision to action...
ogdc
 
OGDC 2014_User segmentation and Monetization_Mr. Phat hoang
OGDC 2014_User segmentation and Monetization_Mr. Phat hoangOGDC 2014_User segmentation and Monetization_Mr. Phat hoang
OGDC 2014_User segmentation and Monetization_Mr. Phat hoang
ogdc
 
OGDC 2014_Animation workflow with Spine in Tiny Busters_Mr. Huynh Dong Hai
OGDC 2014_Animation workflow with Spine in Tiny Busters_Mr. Huynh Dong HaiOGDC 2014_Animation workflow with Spine in Tiny Busters_Mr. Huynh Dong Hai
OGDC 2014_Animation workflow with Spine in Tiny Busters_Mr. Huynh Dong Hai
ogdc
 
OGDC 2014_Architecting Games in Unity_Mr. Rustum Scammell
OGDC 2014_Architecting Games in Unity_Mr. Rustum ScammellOGDC 2014_Architecting Games in Unity_Mr. Rustum Scammell
OGDC 2014_Architecting Games in Unity_Mr. Rustum Scammell
ogdc
 
OGDC 2014_Hands on experience with Cocos2dx in cross-platform with Farmery_Mr...
OGDC 2014_Hands on experience with Cocos2dx in cross-platform with Farmery_Mr...OGDC 2014_Hands on experience with Cocos2dx in cross-platform with Farmery_Mr...
OGDC 2014_Hands on experience with Cocos2dx in cross-platform with Farmery_Mr...
ogdc
 
OGDC 2014_Optimize or Die: Key disciplines to optimize your mobile game_Mr. P...
OGDC 2014_Optimize or Die: Key disciplines to optimize your mobile game_Mr. P...OGDC 2014_Optimize or Die: Key disciplines to optimize your mobile game_Mr. P...
OGDC 2014_Optimize or Die: Key disciplines to optimize your mobile game_Mr. P...
ogdc
 
OGDC 2014_Why choosing 2D animation for Mobile Game?_Mr. Joe Tran
OGDC 2014_Why choosing 2D animation for Mobile Game?_Mr. Joe TranOGDC 2014_Why choosing 2D animation for Mobile Game?_Mr. Joe Tran
OGDC 2014_Why choosing 2D animation for Mobile Game?_Mr. Joe Tran
ogdc
 
OGDC 2014_ An artist's story_Mr. Vu Cam Cong Danh
OGDC 2014_ An artist's story_Mr. Vu Cam Cong DanhOGDC 2014_ An artist's story_Mr. Vu Cam Cong Danh
OGDC 2014_ An artist's story_Mr. Vu Cam Cong Danh
ogdc
 
OGDC 2014_Tips and Tricks for seasonal events and community building in Drago...
OGDC 2014_Tips and Tricks for seasonal events and community building in Drago...OGDC 2014_Tips and Tricks for seasonal events and community building in Drago...
OGDC 2014_Tips and Tricks for seasonal events and community building in Drago...
ogdc
 
OGDC 2014_Cross platform mobile game application development_Mr. Makku J.Kero
OGDC 2014_Cross platform mobile game application development_Mr. Makku J.KeroOGDC 2014_Cross platform mobile game application development_Mr. Makku J.Kero
OGDC 2014_Cross platform mobile game application development_Mr. Makku J.Kero
ogdc
 
OGDC 2014_Tips and Tricks for seasonal events and community building in Drago...
OGDC 2014_Tips and Tricks for seasonal events and community building in Drago...OGDC 2014_Tips and Tricks for seasonal events and community building in Drago...
OGDC 2014_Tips and Tricks for seasonal events and community building in Drago...
ogdc
 
OGDC 2014_Build your own Particle System_Mr. Nguyen Dang Quang
OGDC 2014_Build your own Particle System_Mr. Nguyen Dang QuangOGDC 2014_Build your own Particle System_Mr. Nguyen Dang Quang
OGDC 2014_Build your own Particle System_Mr. Nguyen Dang Quang
ogdc
 
OGDC 2014_3D Graphic on mobile_Mr. Hoang Minh Truong
OGDC 2014_3D Graphic on mobile_Mr. Hoang Minh TruongOGDC 2014_3D Graphic on mobile_Mr. Hoang Minh Truong
OGDC 2014_3D Graphic on mobile_Mr. Hoang Minh Truong
ogdc
 
OGDC 2014_2D Animation using After Effect for mobile game_Mr. Nguyen Tien Thong
OGDC 2014_2D Animation using After Effect for mobile game_Mr. Nguyen Tien ThongOGDC 2014_2D Animation using After Effect for mobile game_Mr. Nguyen Tien Thong
OGDC 2014_2D Animation using After Effect for mobile game_Mr. Nguyen Tien Thong
ogdc
 

Plus de ogdc (20)

OGDC 2014_Sky Garden Mobile conceptualization: From PC to Mobile_Mr. Luc Hoan...
OGDC 2014_Sky Garden Mobile conceptualization: From PC to Mobile_Mr. Luc Hoan...OGDC 2014_Sky Garden Mobile conceptualization: From PC to Mobile_Mr. Luc Hoan...
OGDC 2014_Sky Garden Mobile conceptualization: From PC to Mobile_Mr. Luc Hoan...
 
OGDC 2014_Vietnam Mobile Internet 2014: A focus in smartphone game and compar...
OGDC 2014_Vietnam Mobile Internet 2014: A focus in smartphone game and compar...OGDC 2014_Vietnam Mobile Internet 2014: A focus in smartphone game and compar...
OGDC 2014_Vietnam Mobile Internet 2014: A focus in smartphone game and compar...
 
OGDC 2014_Vietnam Smartphone game market 2013 overview. From vision to action...
OGDC 2014_Vietnam Smartphone game market 2013 overview. From vision to action...OGDC 2014_Vietnam Smartphone game market 2013 overview. From vision to action...
OGDC 2014_Vietnam Smartphone game market 2013 overview. From vision to action...
 
OGDC 2014_User segmentation and Monetization_Mr. Phat hoang
OGDC 2014_User segmentation and Monetization_Mr. Phat hoangOGDC 2014_User segmentation and Monetization_Mr. Phat hoang
OGDC 2014_User segmentation and Monetization_Mr. Phat hoang
 
OGDC 2014_Animation workflow with Spine in Tiny Busters_Mr. Huynh Dong Hai
OGDC 2014_Animation workflow with Spine in Tiny Busters_Mr. Huynh Dong HaiOGDC 2014_Animation workflow with Spine in Tiny Busters_Mr. Huynh Dong Hai
OGDC 2014_Animation workflow with Spine in Tiny Busters_Mr. Huynh Dong Hai
 
OGDC 2014_Architecting Games in Unity_Mr. Rustum Scammell
OGDC 2014_Architecting Games in Unity_Mr. Rustum ScammellOGDC 2014_Architecting Games in Unity_Mr. Rustum Scammell
OGDC 2014_Architecting Games in Unity_Mr. Rustum Scammell
 
OGDC 2014_Hands on experience with Cocos2dx in cross-platform with Farmery_Mr...
OGDC 2014_Hands on experience with Cocos2dx in cross-platform with Farmery_Mr...OGDC 2014_Hands on experience with Cocos2dx in cross-platform with Farmery_Mr...
OGDC 2014_Hands on experience with Cocos2dx in cross-platform with Farmery_Mr...
 
OGDC 2014_Optimize or Die: Key disciplines to optimize your mobile game_Mr. P...
OGDC 2014_Optimize or Die: Key disciplines to optimize your mobile game_Mr. P...OGDC 2014_Optimize or Die: Key disciplines to optimize your mobile game_Mr. P...
OGDC 2014_Optimize or Die: Key disciplines to optimize your mobile game_Mr. P...
 
OGDC 2014_Why choosing 2D animation for Mobile Game?_Mr. Joe Tran
OGDC 2014_Why choosing 2D animation for Mobile Game?_Mr. Joe TranOGDC 2014_Why choosing 2D animation for Mobile Game?_Mr. Joe Tran
OGDC 2014_Why choosing 2D animation for Mobile Game?_Mr. Joe Tran
 
OGDC 2014_ An artist's story_Mr. Vu Cam Cong Danh
OGDC 2014_ An artist's story_Mr. Vu Cam Cong DanhOGDC 2014_ An artist's story_Mr. Vu Cam Cong Danh
OGDC 2014_ An artist's story_Mr. Vu Cam Cong Danh
 
OGDC 2014_Tips and Tricks for seasonal events and community building in Drago...
OGDC 2014_Tips and Tricks for seasonal events and community building in Drago...OGDC 2014_Tips and Tricks for seasonal events and community building in Drago...
OGDC 2014_Tips and Tricks for seasonal events and community building in Drago...
 
OGDC 2014_Cross platform mobile game application development_Mr. Makku J.Kero
OGDC 2014_Cross platform mobile game application development_Mr. Makku J.KeroOGDC 2014_Cross platform mobile game application development_Mr. Makku J.Kero
OGDC 2014_Cross platform mobile game application development_Mr. Makku J.Kero
 
OGDC 2014_Tips and Tricks for seasonal events and community building in Drago...
OGDC 2014_Tips and Tricks for seasonal events and community building in Drago...OGDC 2014_Tips and Tricks for seasonal events and community building in Drago...
OGDC 2014_Tips and Tricks for seasonal events and community building in Drago...
 
OGDC 2014_Build your own Particle System_Mr. Nguyen Dang Quang
OGDC 2014_Build your own Particle System_Mr. Nguyen Dang QuangOGDC 2014_Build your own Particle System_Mr. Nguyen Dang Quang
OGDC 2014_Build your own Particle System_Mr. Nguyen Dang Quang
 
OGDC 2014_3D Graphic on mobile_Mr. Hoang Minh Truong
OGDC 2014_3D Graphic on mobile_Mr. Hoang Minh TruongOGDC 2014_3D Graphic on mobile_Mr. Hoang Minh Truong
OGDC 2014_3D Graphic on mobile_Mr. Hoang Minh Truong
 
OGDC 2014_2D Animation using After Effect for mobile game_Mr. Nguyen Tien Thong
OGDC 2014_2D Animation using After Effect for mobile game_Mr. Nguyen Tien ThongOGDC 2014_2D Animation using After Effect for mobile game_Mr. Nguyen Tien Thong
OGDC 2014_2D Animation using After Effect for mobile game_Mr. Nguyen Tien Thong
 
OGDC2013_ Tip&trick 3D Graphic_ Mr Pham Ngoc Vu Khanh
OGDC2013_ Tip&trick 3D Graphic_ Mr Pham Ngoc Vu KhanhOGDC2013_ Tip&trick 3D Graphic_ Mr Pham Ngoc Vu Khanh
OGDC2013_ Tip&trick 3D Graphic_ Mr Pham Ngoc Vu Khanh
 
OGDC2013_ After effects in 2D Game Animation - lite _ Mr Nguyen Dang Quang
OGDC2013_ After effects in 2D Game Animation - lite _ Mr Nguyen Dang QuangOGDC2013_ After effects in 2D Game Animation - lite _ Mr Nguyen Dang Quang
OGDC2013_ After effects in 2D Game Animation - lite _ Mr Nguyen Dang Quang
 
OGDC2013_ How to build 3D avatar for Happy Me_ Mr Tran Don Tu
OGDC2013_ How to build 3D avatar for Happy Me_ Mr Tran Don TuOGDC2013_ How to build 3D avatar for Happy Me_ Mr Tran Don Tu
OGDC2013_ How to build 3D avatar for Happy Me_ Mr Tran Don Tu
 
OGDC2013_ Farmery2_ Mr Nguyen Quang Lam
OGDC2013_ Farmery2_ Mr Nguyen Quang LamOGDC2013_ Farmery2_ Mr Nguyen Quang Lam
OGDC2013_ Farmery2_ Mr Nguyen Quang Lam
 

OGDC 2014_Entity system in mobile game development_Mr. Cody nguyen