# Entity-Component-System (ECS) for UE4

**URL:** <https://forums.unrealengine.com/t/entity-component-system-ecs-for-ue4/106058>\
**Category:** Game Development\
**Tags:** unreal-engine\
**Created:** [February 5, 2018, 7:08pm UTC](https://forums.unrealengine.com/t/entity-component-system-ecs-for-ue4/106058 "2018-02-05T19:08:28Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![WHSolv](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@WHSolv](https://forums.unrealengine.com/u/WHSolv)\
**Post date:** [February 5, 2018, 7:08pm UTC](https://forums.unrealengine.com/t/entity-component-system-ecs-for-ue4/106058/1 "2018-02-05T19:08:28Z")

</div>

Hey, folks!

**Introduction**  
In case you don’t know what **ECS** is about: [wiki](https://en.wikipedia.org/wiki/Entity%E2%80%93component%E2%80%93system), **much** more]([Entity Component Systems · GitHub](https://gist.github.com/paniq/c32ac8447a7cc5c33a45)).  
The main advantage is **extendibility** : you literally can add or remove the features almost w/o thinking about architecture, it won’t break your game. It becomes really handy when you yet to know all the game’s features, mechanics, etc. However, it is not the only one.  
Second cool “feature” is \*\*Data-Oriented \*\*approach, in short it means the processing data will be structured in CPU-friendly

Where ECS really shoots is MOBA-like games – e.g., «Overwatch» uses ECS]([http://gad.qq.com/article/detail/28682](http://gad.qq.com/article/detail/28682)) (reachable 5-th of Febraury, 2018). However, ECS can be used mostly in any genre. There are still discussions about tough logic (multithreading, pseudo-AI, real-time physics, etc.), but I believe it isn’t a reason not to get common with ECS.

As far as I know **Unity** is going to add this approach to official build (if they haven’t added it), moreover, there is already **[Entitas](https://github.com/sschmid/Entitas-CSharp)** and other stuff.  
What is more important, there is **nothing ready-to-use for UE4** , however, there are tons of ECS-frameworks for C++ ([Artemis](https://github.com/vinova/Artemis-Cpp), [EntityX](https://github.com/alecthomas/entityx), [Anax](https://github.com/miguelmartin75/anax), [SRombauts’](https://github.com/SRombauts/ecs), [redxdev’s](https://github.com/redxdev/ECS), [EnTT](https://github.com/skypjack/entt), [etc.](https://github.com/search?l=C%2B%2B&o=desc&p=3&q=ecs&s=updated&type=Repositories&utf8=%E2%9C%93)).

**Plot**  
Since one doesn’t want to just add another layer on top of the UE4, we are going to сreate a plug-in that works directly with the core Engine’s pipeline (if it will shoot of course).  
For this, I see a several problems (i.e., tasks) for ECS-module-to-UE4 integration (step-by-step plan):

- understand (grasp entirely) how ECS should work
- either adapt existing C++ solution (I think of EnTT), or implement it from scratch
- find the exact spot(s) where the module should touch UE4
- provide a layer for UE4 C++ API (including code generation and stuff)
- provide intuitive GUI for end-user (or end-developer), i.e., plug-in with all the ECS-managers
- get the feedback, fix the bugs, improve the module, etc.

**Summary**  
Problem: there is no ECS pipeline in UE4.  
Solution: GUI plug-in for UE4.

Update [2018.02.17]  
I’ve found [UGameEngine](https://docs.unrealengine.com/latest/INT/API/Runtime/Engine/Engine/UGameEngine/) to make custom Game Loop cycle, and [UEditorEngine](https://docs.unrealengine.com/latest/INT/API/Editor/UnrealEd/Editor/UEditorEngine/) \ [UUnrealEdEngine](https://docs.unrealengine.com/latest/INT/API/Editor/UnrealEd/Editor/UUnrealEdEngine/index.html) to work with Editor directly (however, I think new GUI plug-in can be made a bit more easily, like [that](https://wiki.unrealengine.com/An_Introduction_to_UE4_Plugins)).  
The one thing I am not sure is if it it’s possible (i.e., easy enough to work around) to change DefaultEngine.ini from plug-in side.  
Moreover, I’ve connected EnTT to UE4 – looks like it works pretty well.

Update [2018.03.25]  
For some reason custom GameLoop doesn’t want to be compiled. If anyone has success in this subject, please, write here or PM. [HR][/HR]  
**Extra**  
If you have any advices, considerations, notes, or thoughts, please, share.

---

<div class="post-metadata">

**Author:** ![Kanc](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Kanc](https://forums.unrealengine.com/u/Kanc)\
**Post date:** [February 5, 2018, 9:59pm UTC](https://forums.unrealengine.com/t/entity-component-system-ecs-for-ue4/106058/2 "2018-02-05T21:59:01Z")

</div>

Hi,

I’m a bit confuse. What is the different between an ECS and the current Unreal system?? I mean, you have Actors who could works like an Entiy class and you have components which can be added to your Actor class.

I’m not questioning the system, just want to be more informed.

Thanks

---

<div class="post-metadata">

**Author:** ![OptimisticMonkey](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/optimisticmonkey/32/906571_2.png) [@OptimisticMonkey](https://forums.unrealengine.com/u/OptimisticMonkey)\
**Post date:** [February 6, 2018, 12:59am UTC](https://forums.unrealengine.com/t/entity-component-system-ecs-for-ue4/106058/3 "2018-02-06T00:59:50Z")

</div>

Kanc is correct.

This is already in UE. Look up Actors and Components

Or See [Components | Unreal Engine Documentation](https://docs.unrealengine.com/latest/INT/Programming/UnrealArchitecture/Actors/Components/)

---

<div class="post-metadata">

**Author:** ![WHSolv](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@WHSolv](https://forums.unrealengine.com/u/WHSolv)\
**Post date:** [February 6, 2018, 7:23am UTC](https://forums.unrealengine.com/t/entity-component-system-ecs-for-ue4/106058/4 "2018-02-06T07:23:22Z")

</div>

@Kanc[/USER],[USER=“11900”]OptimisticMonkey , yes, we do have AActor class that can be Entity and persist in World. But…

First of all, there is no EntityManager, or AActorManager, or ActorPool (correct me if I’m wrong), and that is essential for ECS. Moreover, you cannot turn on or off some Components in ComponentManager without breaking your game build either, and this is one of the aspects for ECS as well, as I understand it.

Secondly, indeed, UE4 has Entity-Component, not Entity-Component-System, that is a different thing (please, double check what is ECS, we are not talking about OOP-hierarchy). Components in UE4 now can have logic, but in ECS they should only contain data, and nothing more.

Having these two points, we do not have ECS-pipeline in UE4. Though, we could create all of this on top of the current hierarchy, but I’m not sure if it would be real Data-Driven approach, or just an emulation of it.

---

<div class="post-metadata">

**Author:** ![Kanc](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Kanc](https://forums.unrealengine.com/u/Kanc)\
**Post date:** [February 6, 2018, 5:28pm UTC](https://forums.unrealengine.com/t/entity-component-system-ecs-for-ue4/106058/5 "2018-02-06T17:28:27Z")

</div>

> [@WHSolv](#):
>
> @Kanc[/USER],[USER=“11900”]OptimisticMonkey , yes, we do have AActor class that can be Entity and persist in World. But…
> 
> First of all, there is no EntityManager, or AActorManager, or ActorPool (correct me if I’m wrong), and that is essential for ECS. Moreover, you cannot turn on or off some Components in ComponentManager without breaking your game build either, and this is one of the aspects for ECS as well, as I understand it.
> 
> Secondly, indeed, UE4 has Entity-Component, not Entity-Component-System, that is a different thing (please, double check what is ECS, we are not talking about OOP-hierarchy). Components in UE4 now can have logic, but in ECS they should only contain data, and nothing more.
> 
> Having these two points, we do not have ECS-pipeline in UE4. Though, we could create all of this on top of the current hierarchy, but I’m not sure if it would be real Data-Driven approach, or just an emulation of it.

Thanks man. I didn’t know that in an ECS the components should only contain data.

---

<div class="post-metadata">

**Author:** ![starikcetin](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@starikcetin](https://forums.unrealengine.com/u/starikcetin)\
**Post date:** [March 25, 2018, 4:45pm UTC](https://forums.unrealengine.com/t/entity-component-system-ecs-for-ue4/106058/6 "2018-03-25T16:45:07Z")

</div>

How is this project going?

---

<div class="post-metadata">

**Author:** ![WHSolv](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@WHSolv](https://forums.unrealengine.com/u/WHSolv)\
**Post date:** [March 26, 2018, 9:09pm UTC](https://forums.unrealengine.com/t/entity-component-system-ecs-for-ue4/106058/7 "2018-03-26T21:09:05Z")

</div>

@s.ta.c., there are 3 points where I’m stuck:

- EnTT compilation
- compilation of custom `GameLoop`
- creating GUI extension for the [Ed]Editor (didn’t have much time to dig in properly).

I’m not sure I want to write wrappers for EnTT, however, it’s considered as option. I will try to get to the code again this Sunday.

---

<div class="post-metadata">

**Author:** ![starikcetin](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@starikcetin](https://forums.unrealengine.com/u/starikcetin)\
**Post date:** [March 27, 2018, 1:00pm UTC](https://forums.unrealengine.com/t/entity-component-system-ecs-for-ue4/106058/8 "2018-03-27T13:00:04Z")

</div>

I’ll be following your progress eagerly. Good luck.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_93dbca8c](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_93dbca8c](https://forums.unrealengine.com/u/anonymous_user_93dbca8c)\
**Post date:** [April 2, 2018, 2:48am UTC](https://forums.unrealengine.com/t/entity-component-system-ecs-for-ue4/106058/9 "2018-04-02T02:48:34Z")

</div>

Following this eagerly. Is the idea similar to Lumberyard’s approach (keeping UE4’s EC based architecture and adding ECS as an additional feature)?

---

<div class="post-metadata">

**Author:** ![Mr\_SquarePeg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Mr\_SquarePeg](https://forums.unrealengine.com/u/Mr_SquarePeg)\
**Post date:** [April 2, 2018, 6:21am UTC](https://forums.unrealengine.com/t/entity-component-system-ecs-for-ue4/106058/10 "2018-04-02T06:21:51Z")

</div>

Looking forward to this 🙂

---

<div class="post-metadata">

**Author:** ![WHSolv](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@WHSolv](https://forums.unrealengine.com/u/WHSolv)\
**Post date:** [April 2, 2018, 10:00pm UTC](https://forums.unrealengine.com/t/entity-component-system-ecs-for-ue4/106058/11 "2018-04-02T22:00:33Z")

</div>

@MaxISoP, not sure how it works in Lumberyard (ex-CryEngine), but… My idea was that developers can use both EC and ECS, having the benefits from both of the [architectural] patterns.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_93dbca8c](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_93dbca8c](https://forums.unrealengine.com/u/anonymous_user_93dbca8c)\
**Post date:** [April 6, 2018, 4:34pm UTC](https://forums.unrealengine.com/t/entity-component-system-ecs-for-ue4/106058/12 "2018-04-06T16:34:34Z")

</div>

@WHSolv Yeah it sounds awesome! I don’t know how much you have progressed so far but from what I know, it’s gonna be very hard to integrate EnTT into the current framework and take advantage of existing features… BUT I DO REALLY HOPE YOU CAN MAKE IT!!!

---

<div class="post-metadata">

**Author:** ![WHSolv](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@WHSolv](https://forums.unrealengine.com/u/WHSolv)\
**Post date:** [April 7, 2018, 9:51pm UTC](https://forums.unrealengine.com/t/entity-component-system-ecs-for-ue4/106058/13 "2018-04-07T21:51:12Z")

</div>

@MaxISoP, well, I know of two usages of EnTT in UE4 (though, both are wrapper-versions):

- [GitHub - vblanco20-1/ECS\_SpaceBattle: Huge space battle using an ECS library for the logic. Built](https://github.com/vblanco20-1/ECS_SpaceBattle)
- [GitHub - mhaemmerle/MatchOneEntt](https://github.com/mhaemmerle/MatchOneEntt)

I’m currently working on understanding how they work.  
And my new idea is: once having custom GameLoop works, to inherit from UObject, creating some kind of UEntity, and later than have AEntity (reproducing AActor’s functionality).

---

<div class="post-metadata">

**Author:** ![Anonymous\_c79aea4986fd726db6bff6714bf989a0](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Anonymous\_c79aea4986fd726db6bff6714bf989a0](https://forums.unrealengine.com/u/Anonymous_c79aea4986fd726db6bff6714bf989a0)\
**Post date:** [December 7, 2018, 2:38am UTC](https://forums.unrealengine.com/t/entity-component-system-ecs-for-ue4/106058/14 "2018-12-07T02:38:26Z")

</div>

:DLooking forward to this

---

<div class="post-metadata">

**Author:** ![WHSolv](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@WHSolv](https://forums.unrealengine.com/u/WHSolv)\
**Post date:** [February 17, 2019, 4:22pm UTC](https://forums.unrealengine.com/t/entity-component-system-ecs-for-ue4/106058/15 "2019-02-17T16:22:09Z")

</div>

It’s not that I don’t like the idea anymore but I have other projects to complete. So I wouldn’t expect anything so far. Just telling.

---

<div class="post-metadata">

**Author:** ![Snipe3000](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Snipe3000](https://forums.unrealengine.com/u/Snipe3000)\
**Post date:** [April 13, 2019, 6:14pm UTC](https://forums.unrealengine.com/t/entity-component-system-ecs-for-ue4/106058/16 "2019-04-13T18:14:02Z")

</div>

[![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/4/b/e4bc7410430c01a5043419f8d5d2a7387c7459ac.jpeg "Understanding data-oriented design for entity component systems - Unity at GDC 2019") ](https://www.youtube.com/watch?v=0_Byw9UMn9g)

---

<div class="post-metadata">

**Author:** ![WHSolv](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@WHSolv](https://forums.unrealengine.com/u/WHSolv)\
**Post date:** [May 27, 2019, 4:55pm UTC](https://forums.unrealengine.com/t/entity-component-system-ecs-for-ue4/106058/17 "2019-05-27T16:55:41Z")

</div>

@Snipe3000, from what I’ve heard Unity make their own version of ECS. What I mean is it isn’t the standard one in terms of internals. Can’t really say something more, will need to dig in.

---

<div class="post-metadata">

**Author:** ![lgoss007](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@lgoss007](https://forums.unrealengine.com/u/lgoss007)\
**Post date:** [November 23, 2019, 4:14pm UTC](https://forums.unrealengine.com/t/entity-component-system-ecs-for-ue4/106058/18 "2019-11-23T16:14:28Z")

</div>

I don’t think there is a “standard” ECS, but there are a bunch of different implementations and Unity is building their own. The EnTT creator has a good writeup on ECS for anyone that is interested. The “ECS back and forth” series even includes discussion on certain decisions Unity and other ECS libraries made (in Part 2 and more):

> **[ECS back and forth](https://skypjack.github.io/2019-02-14-ecs-baf-part-1/)**
>
> Part 1 - Introduction

> **[ECS back and forth](https://skypjack.github.io/2019-03-07-ecs-baf-part-2/)**
>
> Part 2 - Where are my entities?

---

<div class="post-metadata">

**Author:** ![the\_nikola](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@the\_nikola](https://forums.unrealengine.com/u/the_nikola)\
**Post date:** [July 15, 2020, 4:35pm UTC](https://forums.unrealengine.com/t/entity-component-system-ecs-for-ue4/106058/19 "2020-07-15T16:35:59Z")

</div>

Yesterday’s Unreal conference had a session on ECS. It’s called Speeding up Game Logic in Unreal Engine.

---

<div class="post-metadata">

**Author:** ![WHSolv](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@WHSolv](https://forums.unrealengine.com/u/WHSolv)\
**Post date:** [September 23, 2020, 4:48pm UTC](https://forums.unrealengine.com/t/entity-component-system-ecs-for-ue4/106058/20 "2020-09-23T16:48:16Z")

</div>

@the_nikola, big thanks! I’ve missed it.

Here’s the link to the video for folks not to search for it: [Speeding up Game Logic in Unreal Engine | Unreal Fest Online 2020 - YouTube](https://youtu.be/QlKXPBFh5BM) .

[Next page](https://forums.unrealengine.com/t/entity-component-system-ecs-for-ue4/106058.md?page=2)
