Evolving a Live Game Engine: Introducing ECS Without a Full Rewrite | Alex Zhorau | GameDev Day 2026
Read full transcript 41 segments
-
Next up, we have Alex with Next up, we have Alex with a talk on a talk on a talk on developing a live developing a live developing a live game engine and game engine and game engine and implementing ECS without a implementing ECS without a implementing ECS without a complete complete complete rewrite. So, rewrite. So, rewrite. So, hello, Alex. hello, Alex. hello, Alex. Hello, Alex. Hello, Alex. Hello, Alex. Hello everyone. Nice Hello everyone. Nice Hello everyone. Nice to meet you. to meet you. to meet you. Mutually, we are glad to see Mutually, we are glad to see Mutually, we are glad to see you with us. Shall we you with us. Shall we you with us. Shall we get straight to get straight to get straight to the point? the point? the point? Yes, let's begin. Yes, let's begin. Yes, let's begin. Fantasy. We see Fantasy. We see Fantasy. We see your slides. So your slides. So your slides. So please tell us please tell us please tell us all about ECS. all about ECS. all about ECS. Okay, let's go. So, Okay, let's go. So, Okay, let's go. So, hello everyone. It's great hello everyone. It's great hello everyone. It's great to see everyone, and to see everyone, and to see everyone, and today we'll today we'll today we'll talk about talk about talk about developing a live developing a live developing a live game engine and game engine and game engine and implementing ECS without a implementing ECS without a implementing ECS without a complete complete complete rewrite. I will rewrite. I will rewrite. I will talk about how to talk about how to talk about how to integrate the integrate the integrate the ECS paradigm into an engine ECS paradigm into an engine ECS paradigm into an engine that already works or that already works or that already works or exists without ECS, about exists without ECS, about exists without ECS, about the obstacles you the obstacles you the obstacles you may encounter, and may encounter, and may encounter, and how to properly how to properly how to properly overcome them. First, overcome them. First, overcome them. First, a few words about me. a few words about me.
-
I am a game developer, I am a game developer, specializing in specializing in game logic standardization, game logic standardization, development, and development, and development, and game game game engine creation. I have some engine creation. I have some engine creation. I have some experience with ECS. experience with ECS. For example, I led a For example, I led a project to project to project to implement implement implement our own ECS in World of Tanks our own ECS in World of Tanks our own ECS in World of Tanks while working at Wargaming while working at Wargaming . I also worked with . I also worked with . I also worked with Unreal Engine and their Unreal Engine and their Unreal Engine and their custom custom custom Mass Entity ECS framework Mass Entity ECS framework Mass Entity ECS framework while working on while working on while working on another project at Splash another project at Splash another project at Splash Damage. I have also Damage. I have also Damage. I have also dealt with ECS in various dealt with ECS in various dealt with ECS in various situations, including situations, including ECS-based engines. I currently ECS-based engines. I currently work at Meta. Also as a work at Meta. Also as a work at Meta. Also as a game developer. During game developer. During game developer. During my career, I have my career, I have my career, I have looked at ECS from different looked at ECS from different looked at ECS from different perspectives: as a perspectives: as a perspectives: as a creator of my own ECS, as an creator of my own ECS, as an creator of my own ECS, as an integrator of an existing integrator of an existing integrator of an existing ECS, both in my own ECS, both in my own ECS, both in my own engines and in engines and in engines and in third-party ones, and here I will third-party ones, and here I will third-party ones, and here I will share my share my share my experience. To start, experience. To start, experience. To start, let's do a let's do a let's do a little overview of what little overview of what little overview of what ECS is. This is a ECS is. This is a ECS is. This is a special special special architectural pattern architectural pattern architectural pattern or paradigm or paradigm or paradigm focused on focused on focused on batch processing of batch processing of batch processing of composite objects. The composite objects. The three main three main concepts in this concepts in this concepts in this paradigm are the paradigm are the paradigm are the entity, which in
-
entity, which in entity, which in itself is very itself is very itself is very light. It is usually light. It is usually light. It is usually represented as a represented as a represented as a small small small identifier, identifier, identifier, accessible via an API, accessible via an API, accessible via an API, that can be freely that can be freely that can be freely moved, etc. moved, etc. It is very light and in It is very light and in itself does not itself does not itself does not contain any contain any contain any logic. The main logic. The main logic. The main part of the essence is part of the essence is part of the essence is that it that it that it consists of consists of consists of components that components that components that may be similar to may be similar to may be similar to approaches in OOP, but there is a approaches in OOP, but there is a approaches in OOP, but there is a significant difference. significant difference. Components in ECS are Components in ECS are data carriers and data carriers and data carriers and have no have no have no logic on their own. Their purpose is logic on their own. Their purpose is simply to be simply to be simply to be components components . An important part of ECS . An important part of ECS . An important part of ECS is systems. So, is systems. So, is systems. So, systems are the point of systems are the point of systems are the point of integration of logic. integration of logic. Systems perform Systems perform certain operations on certain operations on certain operations on entities that entities that entities that meet certain meet certain meet certain criteria. Typically, criteria. Typically, criteria. Typically, these criteria are these criteria are these criteria are the presence or the presence or the presence or absence of certain absence of certain absence of certain components. components.
-
For example, in this For example, in this picture I have three picture I have three picture I have three entities. One of them entities. One of them entities. One of them consists of consists of consists of components A, B, and C, components A, B, and C, components A, B, and C, another consists of B and C, and the third consists another consists of B and C, and the third consists of A and C. Let's imagine that we of A and C. Let's imagine that we of A and C. Let's imagine that we have two systems. One of have two systems. One of have two systems. One of them wants to process them wants to process them wants to process components B and C, and components B and C, and components B and C, and the other wants to process components A. This the other wants to process components A. This the other wants to process components A. This means that the first means that the first means that the first system will take all system will take all system will take all entities that entities that entities that meet its meet its meet its criteria. Does the criteria. Does the criteria. Does the entity have components B entity have components B entity have components B and C? These will be the first and and C? These will be the first and and C? These will be the first and second entities. And second entities. And second entities. And it will perform it will perform it will perform operations on all operations on all operations on all these entities. Another these entities. Another these entities. Another system will only take system will only take system will only take entities with entities with entities with component A, i.e. component A, i.e. component A, i.e. these will be the first and these will be the first and these will be the first and third entities. third entities. One of the One of the most important things most important things most important things is a mental model is a mental model is a mental model of what the of what the of what the system does. I would advise you system does. I would advise you system does. I would advise you to form just such a to form just such a to form just such a mental model of the mental model of the mental model of the system. Essentially, this is where system. Essentially, this is where system. Essentially, this is where you you you integrate logic integrate logic integrate logic that performs operations that performs operations that performs operations on specified on specified on specified components. Again components. Again components. Again , depending on the , depending on the , depending on the ECS library you ECS library you ECS library you are using, the API are using, the API are using, the API may vary.
-
may vary. It can be more It can be more voluminous, where you manually voluminous, where you manually voluminous, where you manually write down an enumeration of write down an enumeration of write down an enumeration of all the necessary all the necessary all the necessary entities, or very entities, or very entities, or very similar to this. But similar to this. But similar to this. But again, it's very again, it's very again, it's very helpful to have this helpful to have this helpful to have this mental model of what the mental model of what the mental model of what the system is. system is. This is somewhat similar This is somewhat similar to shaders. That is, it is to shaders. That is, it is to shaders. That is, it is some kind of operation that some kind of operation that some kind of operation that is performed on is performed on is performed on all objects that all objects that all objects that meet meet meet the criteria. Why? the criteria. Why? the criteria. Why? Why implement Why implement Why implement ECS? What's the point, ECS? What's the point, ECS? What's the point, especially if we especially if we especially if we already have an existing engine? already have an existing engine? already have an existing engine? There are several reasons. This There are several reasons. This There are several reasons. This provides logical provides logical provides logical scalability. scalability. Secondly, it provides Secondly, it provides Secondly, it provides productivity. productivity. Third, it can Third, it can Third, it can help with help with development tools, depending on development tools, depending on your engine. But keep your engine. But keep your engine. But keep in mind that in mind that in mind that architectural architectural architectural benefits may benefits may benefits may manifest themselves before manifest themselves before you experience a you experience a performance boost. So, performance boost. So, first about logical first about logical first about logical scalability. ECS scalability. ECS scalability. ECS provides two ways provides two ways provides two ways to extend your to extend your to extend your logic. First, we logic. First, we logic. First, we follow the follow the follow the principle of composition principle of composition principle of composition instead of inheritance instead of inheritance , which is useful, but it is , which is useful, but it is , which is useful, but it is not unique to ECS— not unique to ECS— regular object- regular object- oriented oriented oriented component models also component models also component models also provide this advantage.
-
provide this advantage. But at the same time, you But at the same time, you gain a second gain a second gain a second dimension of extensibility of dimension of extensibility of dimension of extensibility of your logic. Now your logic. Now your logic. Now you can add you can add you can add new behaviors, new behaviors, new behaviors, creating new creating new creating new systems, without affecting systems, without affecting , for example, the , for example, the , for example, the structure of existing structure of existing structure of existing entities and entities and entities and components. Or you components. Or you components. Or you can replace can replace can replace systems with new systems with new systems with new behaviors. So you have behaviors. So you have behaviors. So you have two two two dimensions instead of dimensions instead of dimensions instead of one. Previously, you one. Previously, you one. Previously, you only had components only had components only had components as a way to extend as a way to extend as a way to extend your logic. Now your logic. Now your logic. Now you have both systems and you have both systems and you have both systems and components. Another components. Another components. Another thing that makes ECS so thing that makes ECS so thing that makes ECS so popular is that popular is that popular is that it provides significant it provides significant performance benefits. Remember, I said Remember, I said that ECS itself is a way of that ECS itself is a way of that ECS itself is a way of batch processing batch processing batch processing complex objects. And complex objects. And complex objects. And this means that since this means that since this means that since we are doing batch we are doing batch we are doing batch processing, we can processing, we can processing, we can reorganize reorganize reorganize memory so that memory so that memory so that entity traversal is entity traversal is entity traversal is cache-friendly. cache-friendly.
-
For example, one For example, one approach to approach to approach to memory organization in memory organization in memory organization in ECS is the ECS is the ECS is the archetype model, where there are archetype model, where there are archetype model, where there are multiple archetypes multiple archetypes multiple archetypes representing different representing different representing different potential potential potential entity structures. And there your entity structures. And there your entity structures. And there your components components components are organized into are organized into are organized into arrays. Here is an example of arrays. Here is an example of arrays. Here is an example of the two archetypes the two archetypes the two archetypes on the left. One archetype on the left. One archetype on the left. One archetype consists of consists of consists of components A and B. components A and B. components A and B. Another consists of components Another consists of components Another consists of components A, B, and C. The components of the A, B, and C. The components of the A, B, and C. The components of the same type same type same type are organized in a are organized in a are organized in a continuous array. continuous array. This means that when you This means that when you perform a batch perform a batch perform a batch operation on them, operation on them, operation on them, due to the dense due to the dense due to the dense placement in memory, the placement in memory, the placement in memory, the traversal will be significantly traversal will be significantly traversal will be significantly faster due to the faster due to the faster due to the cache operation. Of course, cache operation. Of course, cache operation. Of course, processor cache. processor cache. processor cache. Another advantage is Another advantage is Another advantage is that now we have many that now we have many that now we have many systems, and we can systems, and we can systems, and we can organize them in a organize them in a organize them in a graph. Since we graph. Since we graph. Since we know which know which know which components components components these these these systems access, we can systems access, we can systems access, we can build them into a build them into a build them into a parallel graph: parallel graph: parallel graph: for example, some for example, some for example, some systems can systems can systems can run in run in run in parallel with others.
-
parallel with others. This gives the added This gives the added advantage of parallelism advantage of parallelism . And third: again . And third: again , remember that , remember that , remember that systems perform systems perform systems perform batch processing of batch processing of batch processing of entities. This means entities. This means that we can that we can that we can even run a even run a even run a separate system separate system separate system in parallel. in parallel. in parallel. For example, we can For example, we can For example, we can use parallel use parallel use parallel for to for to for to perform the same perform the same perform the same operation on operation on operation on all entities at the same time. all entities at the same time. Also regarding development tools: depending on development tools: depending on the situation in your the situation in your the situation in your editor, especially in editor, especially in editor, especially in engines with a long engines with a long engines with a long history, there may be history, there may be history, there may be several different several different several different approaches to how approaches to how game objects are configured. And if game objects are configured. And if you follow the you follow the you follow the same same same ECS-based approach, you ECS-based approach, you ECS-based approach, you can potentially can potentially can potentially unify the way you unify the way you unify the way you organize everything. organize everything. organize everything. Again, this is not a Again, this is not a Again, this is not a direct consequence of direct consequence of direct consequence of ECS itself, but again, ECS itself, but again, ECS itself, but again, if you are doing if you are doing if you are doing this kind of work, this kind of work, this kind of work, you might be able to improve you might be able to improve you might be able to improve your tools as well. your tools as well. So now let's So now let's look at where we look at where we look at where we start. We start. We start. We may already have a mover.
-
may already have a mover. may already have a mover. For example, it could For example, it could For example, it could be a motor that is already be a motor that is already be a motor that is already used in used in used in production. A game, production. A game, production. A game, for example, can be for example, can be for example, can be a service, the engine already a service, the engine already a service, the engine already exists, and the game is already exists, and the game is already exists, and the game is already being played. This is one of the being played. This is one of the being played. This is one of the options. Another options. Another options. Another option is that we may option is that we may option is that we may be in the be in the be in the game development phase. I haven't game development phase. I haven't game development phase. I haven't released her yet. But the released her yet. But the released her yet. But the engine itself already exists. We engine itself already exists. We engine itself already exists. We may already have an may already have an may already have an actual model. Where actual model. Where actual model. Where we just have lots of we just have lots of we just have lots of deep hierarchies of deep hierarchies of deep hierarchies of actor inheritance actor inheritance actor inheritance with logic. We could with logic. We could with logic. We could have something like a have something like a have something like a node model like in node model like in node model like in Godot, where there is a recursive Godot, where there is a recursive Godot, where there is a recursive data structure or a data structure or a data structure or a recursive recursive recursive scene graph. Or something like scene graph. Or something like scene graph. Or something like Unreal Engine, where there are Unreal Engine, where there are Unreal Engine, where there are actors with logic plus actors with logic plus actors with logic plus components that are also components that are also components that are also added to those actors added to those actors . There could be something . There could be something . There could be something like Unity, where there are like Unity, where there are like Unity, where there are game objects and game objects and game objects and components with logic components with logic components with logic inside. Of course, inside. Of course, inside. Of course, we will have existing we will have existing we will have existing content. We will have content. We will have content. We will have existing tools.
-
existing tools. existing tools. We will have an existing We will have an existing We will have an existing code base. We code base. We code base. We may already have a lot of may already have a lot of may already have a lot of code manipulating code manipulating code manipulating existing existing existing actor types, etc. So we actor types, etc. So we actor types, etc. So we need to do something about it need to do something about it need to do something about it . A small . A small . A small assumption: I believe the assumption: I believe the assumption: I believe the engine core is engine core is engine core is written in C or C++. written in C or C++. written in C or C++. But again, But again, But again, most of this most of this most of this talk won't be directly talk won't be directly talk won't be directly relevant to this. relevant to this. Before we start Before we start rewriting everything, we rewriting everything, we rewriting everything, we need to choose goals. Are need to choose goals. Are need to choose goals. Are we going to we going to we going to use ECS use ECS use ECS just to improve just to improve just to improve performance? performance? performance? Will we Will we Will we only take advantage of the only take advantage of the performance benefits? Are performance benefits? Are we going to we going to we going to use ECS use ECS use ECS to unify and to unify and to unify and replace how we replace how we replace how we write game logic? write game logic? write game logic? Are we going to Are we going to Are we going to change our approach to change our approach to change our approach to organizing everything organizing everything organizing everything to a new paradigm? And to a new paradigm? And to a new paradigm? And very importantly, how will we very importantly, how will we very importantly, how will we influence our influence our influence our artists? Do artists? Do artists? Do we tell them, “ we tell them, “ Hey, we’ve introduced a Hey, we’ve introduced a Hey, we’ve introduced a whole new whole new whole new way of working”? Or way of working”? Or way of working”? Or maybe we'll maybe we'll maybe we'll hide it from them hide it from them . Maybe it wo . Maybe it wo . Maybe it wo n't affect them at all n't affect them at all n't affect them at all . That's why . That's why . That's why this is also one of the things this is also one of the things this is also one of the things you need to you need to you need to consider. And the scope consider. And the scope consider. And the scope of integration, depending of integration, depending of integration, depending on the answers on the on the answers on the on the answers on the previous slide, previous slide, previous slide, will vary. But here I will vary. But here I will vary. But here I have mentioned a few have mentioned a few have mentioned a few important steps that important steps that important steps that will cover most of will cover most of will cover most of such work.
-
such work. So, obviously we So, obviously we need to implement an need to implement an need to implement an ECS core. This could be ECS core. This could be ECS core. This could be some existing some existing some existing library that we library that we library that we can find, can find, can find, for example, on GitHub. Or for example, on GitHub. Or for example, on GitHub. Or we can write it we can write it we can write it ourselves. Again ourselves. Again ourselves. Again , the kernel must , the kernel must , the kernel must implement a memory model of the implement a memory model of the entity- component system that component system that component system that properly properly properly represents represents represents the components, connects the the components, connects the the components, connects the systems, correctly systems, correctly systems, correctly defines all the defines all the defines all the necessary entities, necessary entities, necessary entities, passes them to the passes them to the passes them to the systems, etc. Without systems, etc. Without systems, etc. Without this, everything else is simply this, everything else is simply this, everything else is simply impossible. This is an impossible. This is an impossible. This is an extremely important extremely important extremely important part, since we part, since we part, since we are talking about an already are talking about an already are talking about an already existing engine. As for existing engine. As for existing engine. As for integration into the integration into the integration into the existing world. And in existing world. And in existing world. And in fact, that will be one of the fact, that will be one of the fact, that will be one of the biggest challenges biggest challenges biggest challenges when you try to when you try to when you try to implement ECS into an implement ECS into an implement ECS into an existing engine. Again existing engine. Again existing engine. Again , if we , if we , if we allow our allow our allow our artists artists artists to interact with ECS, that to interact with ECS, that to interact with ECS, that means we means we means we need a scope of work need a scope of work need a scope of work for the editor and for the editor and for the editor and serialization. And if serialization. And if serialization. And if our game is online, our game is online, our game is online, we need to we need to we need to do something with online do something with online do something with online interaction. We interaction. We interaction. We need to think about how need to think about how need to think about how we will we will we will replicate our ECS replicate our ECS replicate our ECS state. And if our engine state. And if our engine state. And if our engine has scripts, we has scripts, we has scripts, we also need to think about also need to think about also need to think about what we will do with them what we will do with them what we will do with them . So, that's the . So, that's the . So, that's the scope of work. And, as scope of work. And, as scope of work. And, as you can see, the ECS core is you can see, the ECS core is you can see, the ECS core is just one very just one very just one very small part of small part of small part of this work. Of course, this work. Of course, this work. Of course, this will also take some this will also take some this will also take some time, but it's not the only time, but it's not the only time, but it's not the only type of work we type of work we type of work we need to do.
-
need to do. need to do. Now let's talk about Now let's talk about Now let's talk about approaches. So, approach approaches. So, approach approaches. So, approach number zero. Let's number zero. Let's number zero. Let's just take just take just take the library and add it to the library and add it to the library and add it to the side. And we'll say, " the side. And we'll say, " Hey, now we're Hey, now we're Hey, now we're going to write all the going to write all the going to write all the new logic on ECS." But new logic on ECS." But new logic on ECS." But since we added it on since we added it on since we added it on the side, the old the side, the old the side, the old world hasn't really disappeared. And world hasn't really disappeared. And world hasn't really disappeared. And this is a very big this is a very big this is a very big problem, because the problem, because the problem, because the approach itself is, of course, approach itself is, of course, approach itself is, of course, simpler. You just simpler. You just simpler. You just add the library. add the library. add the library. You simply You simply You simply plug it into plug it into plug it into your existing your existing your existing update schedule, and update schedule, and update schedule, and now your ECS will now your ECS will now your ECS will update and update and update and perform operations perform operations perform operations on new on new on new entities and entities and entities and components. But components. But components. But due to the lack of due to the lack of due to the lack of integration with the integration with the integration with the existing world, it is practically impossible to write existing world, it is practically impossible to write any ECS function that any ECS function that any ECS function that needs to interact needs to interact needs to interact with the old logic with the old logic . And you . And you will have to will have to will have to rewrite everything from rewrite everything from rewrite everything from scratch. In the worst scratch. In the worst scratch. In the worst case, you won't be able to case, you won't be able to case, you won't be able to use ECS use ECS use ECS until you rewrite until you rewrite until you rewrite everything. This tells us everything. This tells us everything. This tells us that this is an approach we that this is an approach we that this is an approach we simply will not take, because simply will not take, because simply will not take, because this is, unfortunately, not a new this is, unfortunately, not a new this is, unfortunately, not a new driver. This is an existing driver. This is an existing driver. This is an existing driver. We need an driver. We need an driver. We need an alternative.
-
alternative. Instead, we Instead, we will adhere to will adhere to will adhere to gradual gradual gradual integration with the integration with the integration with the existing world. So existing world. So , we will open access , we will open access , we will open access to existing objects, to existing objects, to existing objects, and there are several approaches to this and there are several approaches to this and there are several approaches to this . We . We . We will open them to ECS. will open them to ECS. We will add new ECS components and systems that ECS components and systems that will interact with the will interact with the will interact with the existing world. And existing world. And existing world. And then we then we then we can partially transfer can partially transfer can partially transfer some of the responsibilities from the some of the responsibilities from the some of the responsibilities from the old world to the new one old world to the new one , but only a part, , but only a part, , but only a part, if we see the if we see the if we see the need for it. And while need for it. And while need for it. And while performing these performing these performing these steps, each one steps, each one steps, each one should support a should support a should support a useful gameplay useful gameplay useful gameplay experience. So if we experience. So if we experience. So if we do steps without do steps without do steps without gameplay support gameplay support gameplay support , it unfortunately , it unfortunately , it unfortunately delays the moment delays the moment when we can when we can when we can say, "Oh, hey, say, "Oh, hey, say, "Oh, hey, we have something that works we have something that works we have something that works with ECS inside the engine." with ECS inside the engine." The first approach, a The first approach, a gradual approach. gradual approach. Maybe we can Maybe we can move some move some move some isolated islands of isolated islands of isolated islands of logic. For example, we logic. For example, we logic. For example, we can find can find can find several several several component models in our engine, component models in our engine, component models in our engine, perhaps they are already there perhaps they are already there perhaps they are already there . And again, this is . And again, this is . And again, this is not something theoretical.
-
not something theoretical. If the engine is already quite If the engine is already quite old, you may old, you may old, you may have different ways of have different ways of have different ways of implementing implementing implementing scene elements. For example, in scene elements. For example, in scene elements. For example, in one of the one of the one of the proprietary engines proprietary engines I worked with, I worked with, I worked with, we had several we had several we had several actor representations actor representations , and one of them was , and one of them was , and one of them was so deeply so deeply so deeply embedded in many of the embedded in many of the embedded in many of the engine's subsystems that engine's subsystems that engine's subsystems that any porting any porting any porting was impossible. But was impossible. But was impossible. But at the same time, there was at the same time, there was at the same time, there was another another another component model that was component model that was component model that was more localized more localized more localized and also represented and also represented and also represented a certain part of the a certain part of the a certain part of the game logic, and it game logic, and it game logic, and it could be found and could be found and could be found and started to be started to be started to be ported over gradually. Not even ported over gradually. Not even ported over gradually. Not even gradually, but gradually, but gradually, but to transfer most of it to transfer most of it to transfer most of it to ECS. to ECS. to ECS. Also, even if Also, even if Also, even if you only have one you only have one you only have one component model in your engine, you component model in your engine, you component model in your engine, you might be able to might be able to might be able to find an isolated find an isolated find an isolated group of actors that don't group of actors that don't group of actors that don't interact much with interact much with interact much with other subsystems, other subsystems, other subsystems, and you can take them and you can take them and you can take them for such a project.
-
for such a project. With this approach, With this approach, the porting the porting the porting would look would look would look something like this. You won't something like this. You won't something like this. You won't be be be rewriting rewriting rewriting components so much as components so much as components so much as putting them into putting them into putting them into entities, first entities, first entities, first creating the entities creating the entities creating the entities that will integrate that will integrate that will integrate these components. You these components. You these components. You literally literally literally reuse the existing reuse the existing component codebase and component codebase and say, "Okay, say, "Okay, say, "Okay, now these are ECS now these are ECS components and they components and they components and they will fit will fit will fit your entity better." your entity better." your entity better." The problem here still The problem here still The problem here still lies with the actors. lies with the actors. lies with the actors. If your If your If your scene representation scene representation scene representation has actors that has actors that has actors that contain contain contain logic in themselves, this can be logic in themselves, this can be logic in themselves, this can be a bit problematic, a bit problematic, a bit problematic, but there is a but there is a but there is a clever approach here too. You clever approach here too. You clever approach here too. You might say: okay might say: okay , our actor is a , our actor is a , our actor is a special kind of special kind of special kind of component, so we'll component, so we'll component, so we'll add it and add it and add it and consider it a consider it a consider it a component too. Of course, component too. Of course, component too. Of course, since we are talking since we are talking since we are talking about porting about porting about porting existing logic, this existing logic, this existing logic, this means that such means that such means that such components will have components will have components will have logic inside, and logic inside, and logic inside, and you need to you need to you need to access them somehow, so access them somehow, so access them somehow, so you will write you will write you will write additional additional additional actor systems that actor systems that actor systems that will call methods will call methods will call methods in these components, in these components, in these components, for example, for example, for example, launch them, launch them, launch them, process them, etc.
-
process them, etc. Things to consider here are caveats. First, all this will work First, all this will work First, all this will work if the components themselves are if the components themselves are if the components themselves are fairly easy fairly easy fairly easy to port to ECS. to port to ECS. For example, if the For example, if the ECS library ECS library ECS library allows allows classes of arbitrary classes of arbitrary types to be used as components, it types to be used as components, it types to be used as components, it would be quite easy to would be quite easy to would be quite easy to reuse reuse reuse existing components with existing components with existing components with minimal minimal minimal code rewriting. code rewriting. code rewriting. You will simply change, You will simply change, You will simply change, say, ownership. say, ownership. say, ownership. If it previously If it previously If it previously belonged to, for example, belonged to, for example, belonged to, for example, an actor, now it an actor, now it an actor, now it will belong to an entity. will belong to an entity. This is potentially This is potentially possible, but not possible, but not possible, but not always. Second, if the always. Second, if the always. Second, if the lifecycle of lifecycle of lifecycle of existing actors and existing actors and existing actors and components is very components is very components is very deeply embedded in the deeply embedded in the deeply embedded in the engine, it may be engine, it may be engine, it may be difficult to extract them this difficult to extract them this difficult to extract them this way. Especially if way. Especially if way. Especially if we're talking about we're talking about we're talking about custom custom custom memory management, custom memory management, custom memory allocators, custom memory allocators, custom control of control of control of actor and actor and actor and component creation, which is component creation, which is component creation, which is more complex than a more complex than a more complex than a regular new and regular new and regular new and much more hidden much more hidden , it's going to be much , it's going to be much , it's going to be much harder. Of course, harder. Of course, harder. Of course, since we are talking since we are talking since we are talking about easy about easy about easy portability, such portability, such portability, such components components components will contain logic, will contain logic, will contain logic, which may upset you which may upset you if you are an ECS purist, if you are an ECS purist, if you are an ECS purist, because in pure ECS because in pure ECS because in pure ECS logic should not logic should not logic should not be added to be added to be added to components. But components. But components. But again, we're again, we're again, we're talking about
-
talking about talking about creating a kind of creating a kind of creating a kind of bridge with existing bridge with existing bridge with existing code. And again, you still code. And again, you still code. And again, you still need to need to need to write systems that write systems that will somehow access will somehow access these components and these components and these components and perform perform perform certain operations on them. certain operations on them. Additional Additional warning. And this is warning. And this is warning. And this is also very important, also very important, also very important, because it can be very, because it can be very, because it can be very, very painful. When we very painful. When we very painful. When we talk about object- talk about object- oriented oriented oriented component models, component models, component models, such models often such models often such models often store data for store data for store data for various reasons, various reasons, various reasons, perhaps simply because perhaps simply because perhaps simply because it is convenient. Oh, it is convenient. Oh, it is convenient. Oh, sorry, because it's sorry, because it's sorry, because it's easy. They can easy. They can easy. They can store pointers store pointers store pointers to other components. to other components. to other components. This is again what This is again what This is again what happened in our happened in our happened in our codebase when I was codebase when I was codebase when I was working with it. Several working with it. Several working with it. Several times, many times, and times, many times, and times, many times, and so on. And you can so on. And you can so on. And you can even store " even store " raw" pointers to raw" pointers to raw" pointers to components. Which components. Which components. Which sounds like: "Okay, sounds like: "Okay, sounds like: "Okay, let it be so." But let it be so." But let it be so." But the problem is that the problem is that the problem is that when we talk about when we talk about when we talk about ECS, any ECS, any ECS, any performant ECS is very performant ECS is very performant ECS is very poorly suited for poorly suited for poorly suited for storing raw storing raw storing raw pointers to pointers to pointers to components. Why? components. Why? components. Why? Because memory is Because memory is Because memory is usually usually usually organized in organized in organized in dense dense dense arrays, as I said at the arrays, as I said at the arrays, as I said at the very beginning. And very beginning. And very beginning. And when, for example, a gap appears in when, for example, a gap appears in when, for example, a gap appears in this dense this dense this dense array array array and a and a deletion operation is performed through deletion operation is performed through permutation, permutation, permutation, for example, when the for example, when the for example, when the last component last component last component is moved into this is moved into this is moved into this gap. And gap. And gap. And voila again, we have voila again, we have voila again, we have tightly packed tightly packed tightly packed memory, which is good for memory, which is good for memory, which is good for traversal, but imagine, like traversal, but imagine, like traversal, but imagine, like in this picture, that in this picture, that in this picture, that you are storing a you are storing a you are storing a pointer to an pointer to an pointer to an instance of component instance of component instance of component F, sorry. And then F, sorry. And then F, sorry. And then the instance of component the instance of component the instance of component C was deleted, and C was deleted, and C was deleted, and then component F
-
then component F then component F was moved into that was moved into that was moved into that gap, and hey, gap, and hey, gap, and hey, now you have now you have now you have pointers pointers pointers pointing to nowhere, which is pointing to nowhere, which is pointing to nowhere, which is not good. This not good. This not good. This will cause you a lot of will cause you a lot of will cause you a lot of trouble. So, this trouble. So, this trouble. So, this can be solved in can be solved in can be solved in several ways. several ways. several ways. Of course, you can Of course, you can Of course, you can rewrite everything, rewrite everything, rewrite everything, find all the places where there is find all the places where there is find all the places where there is access through access through access through pointers, but that pointers, but that pointers, but that can also be can also be can also be painful because it is a painful because it is a painful because it is a significant significant significant rewrite. You rewrite. You rewrite. You can replace raw can replace raw can replace raw pointers with a pointers with a pointers with a data structure data structure data structure similar to a shared pointer, which similar to a shared pointer, which similar to a shared pointer, which will hide access to the will hide access to the will hide access to the raw pointer " raw pointer " under the hood", under the hood", under the hood", store the entity store the entity , and then find , and then find , and then find a component of the a component of the a component of the corresponding type, corresponding type, corresponding type, etc. But again etc. But again , this is a code modification. , this is a code modification. , this is a code modification. Or you can Or you can Or you can use another use another use another trick. You can trick. You can trick. You can add support for add support for add support for multiple multiple multiple memory models within a memory models within a component entity system. As? You component entity system. As? You remember what I said remember what I said remember what I said about the mental model of about the mental model of about the mental model of API systems. If your API API systems. If your API API systems. If your API looks something like what looks something like what looks something like what I'm showing I'm showing I'm showing on this slide, on this slide, on this slide, you see, we're not you see, we're not you see, we're not exposing anything here exposing anything here exposing anything here that relates to the that relates to the that relates to the memory model. We just memory model. We just memory model. We just say, "Okay, I say, "Okay, I say, "Okay, I need access to need access to need access to component types A, B, and C.
-
component types A, B, and C. " So in this case, " So in this case, " So in this case, no information no information no information about the memory model, and about the memory model, and about the memory model, and for example, the buffers where for example, the buffers where for example, the buffers where these components are stored these components are stored these components are stored may may may be different. And, be different. And, be different. And, for example, if we're for example, if we're for example, if we're talking about new talking about new talking about new ECS components, yes, ECS components, yes, ECS components, yes, of course, they'll be of course, they'll be of course, they'll be stored densely, stored densely, stored densely, but at the same time, our but at the same time, our but at the same time, our old components old components old components will be scattered throughout the will be scattered throughout the will be scattered throughout the memory. Yes, it memory. Yes, it memory. Yes, it may potentially may potentially may potentially not be very productive, not be very productive, not be very productive, but at the same time it will but at the same time it will but at the same time it will work. The second work. The second work. The second approach to integration. approach to integration. approach to integration. We can We can We can use use use bridge access. So bridge access. So , instead of directly , instead of directly , instead of directly porting porting porting components, we components, we components, we won't won't won't touch existing touch existing touch existing components at all, but components at all, but components at all, but will create a bridge. We will create a bridge. We will create a bridge. We will build will build will build a mapping from a mapping from a mapping from actor to entity. actor to entity. actor to entity. For example, if each For example, if each For example, if each actor is present in actor is present in actor is present in our scene, they will our scene, they will our scene, they will have a corresponding have a corresponding have a corresponding entity associated entity associated entity associated with the center. Or with the center. Or with the center. Or maybe some actors maybe some actors maybe some actors won't have that won't have that won't have that connection if we don't connection if we don't connection if we don't want to expose want to expose want to expose all the actors in our all the actors in our all the actors in our world, etc. It world, etc. It world, etc. It depends on the depends on the depends on the situation. But in the situation. But in the situation. But in the simplest simplest simplest scenario, we would scenario, we would scenario, we would probably have this probably have this probably have this connection for each connection for each connection for each actor. And again actor. And again , why not extend the , why not extend the , why not extend the API of our systems? What if API of our systems? What if API of our systems? What if we allow we allow we allow specifying both ECS specifying both ECS components and components and components and actors there, for example?
-
actors there, for example? Or even Or even actor components. actor components. actor components. Again, from a Again, from a Again, from a code perspective, there is no code perspective, there is no code perspective, there is no significant difference, significant difference, significant difference, as we just as we just as we just want to write want to write want to write the logic that the logic that the logic that will perform will perform will perform operations on these operations on these operations on these components. And in components. And in components. And in fact, it can fact, it can fact, it can work. One work. One work. One way to do this is way to do this is to create a to create a to create a representation through a representation through a representation through a kind of kind of container component. A kind of wrapper component. It might wrapper component. It might look like this. Imagine look like this. Imagine that you already have an actor that you already have an actor that you already have an actor with components A, B, and with components A, B, and with components A, B, and C. And you have an entity. C. And you have an entity. Here you create Here you create special special special containers that containers that containers that will hold will hold will hold pointers to pointers to pointers to existing components A, existing components A, existing components A, B, and C. You B, and C. You B, and C. You will also have a special will also have a special actor component container actor component container that will behave that will behave that will behave like an ECS component, but like an ECS component, but will hold will hold a pointer to the actor inside. a pointer to the actor inside. This way we This way we literally don't literally don't literally don't touch the existing touch the existing touch the existing actor implementation at all. And actor implementation at all. And actor implementation at all. And this can be very this can be very this can be very useful if it is useful if it is useful if it is too deeply too deeply too deeply rooted or if we rooted or if we rooted or if we simply don't have simply don't have simply don't have access to change the access to change the access to change the engine to that extent. A engine to that extent. A very good example is Unreal Engine. If you Engine. If you Engine. If you try to try to try to use their use their use their own ECS called own ECS called own ECS called Mass Entity, you will eventually Mass Entity, you will eventually Mass Entity, you will eventually run into the fact that run into the fact that run into the fact that you will have to you will have to you will have to implement something implement something implement something similar if you similar if you similar if you want to
-
want to want to access actors. access actors. access actors. However, you will not However, you will not However, you will not be able to migrate be able to migrate be able to migrate actors to ECS for this actors to ECS for this actors to ECS for this reason. This is too reason. This is too reason. This is too much code and too much code and too much code and too deep integration into the deep integration into the deep integration into the codebase. codebase. Midterm review. So , what have we achieved with , what have we achieved with , what have we achieved with this this this approach? Now we approach? Now we approach? Now we can connect this can connect this can connect this ECS world to the non-ECS world. ECS world to the non-ECS world. ECS world to the non-ECS world. We can write We can write We can write new ECS logic that new ECS logic that new ECS logic that interacts with the non-ECS interacts with the non-ECS world. We can world. We can world. We can write something write something write something like this. We can like this. We can like this. We can write a mixed write a mixed write a mixed system that will system that will system that will simultaneously have simultaneously have simultaneously have access to ECS access to ECS components, actors, components, actors, components, actors, and and and actor components. And from the actor components. And from the actor components. And from the perspective of the person writing the perspective of the person writing the perspective of the person writing the final code in this final code in this final code in this system, there is no system, there is no system, there is no difference. At the same time, this difference. At the same time, this difference. At the same time, this means that we can, means that we can, means that we can, for example, add for example, add for example, add new ECS logic to the new ECS logic to the new ECS logic to the existing world. existing world. existing world. At the same time, if for At the same time, if for any reason, for any reason, for any reason, for performance reasons, we performance reasons, we performance reasons, we decide to decide to decide to optimize, we optimize, we optimize, we can rewrite can rewrite can rewrite some of the some of the some of the actor components to ECS. And actor components to ECS. And actor components to ECS. And nothing nothing nothing will change in this code. By the way, a will change in this code. By the way, a will change in this code. By the way, a valid question about valid question about valid question about productivity. What is productivity. What is productivity. What is happening to her?
-
happening to her? The implications of the mixed The implications of the mixed model I describe. model I describe. First, one First, one second. First, second. First, second. First, when it comes to when it comes to when it comes to building new building new building new systems in ECS, like systems in ECS, like systems in ECS, like new systems or new systems or new systems or components, we will components, we will components, we will get the same get the same get the same performance as performance as performance as with regular ECS, with regular ECS, with regular ECS, obviously. So, obviously. So, obviously. So, no problems, because no problems, because no problems, because they exist in they exist in they exist in their own ECS world and do not their own ECS world and do not their own ECS world and do not interact with the interact with the interact with the existing one, which is completely existing one, which is completely existing one, which is completely normal. So, that's normal. So, that's normal. So, that's good. This is one of the good. This is one of the good. This is one of the reasons we are reasons we are reasons we are implementing ECS—to implementing ECS—to implementing ECS—to ensure high ensure high ensure high performance. performance. Of course, when we Of course, when we talk about accessing talk about accessing talk about accessing the memory of existing the memory of existing the memory of existing actors or their actors or their actors or their components, we components, we components, we usually encounter usually encounter usually encounter cache misses. Because, cache misses. Because, cache misses. Because, again, again, again, theoretically they can be theoretically they can be theoretically they can be placed in more placed in more placed in more memory-friendly memory-friendly memory-friendly arrays, but this is not arrays, but this is not arrays, but this is not guaranteed, and in the guaranteed, and in the guaranteed, and in the worst case they worst case they worst case they will be scattered all over the will be scattered all over the will be scattered all over the heap. So, heap. So, heap. So, unfortunately, here we will have a unfortunately, here we will have a unfortunately, here we will have a deterioration compared deterioration compared deterioration compared to "pure" ECS. And to "pure" ECS. And to "pure" ECS. And another important point to another important point to remember is multithreading.
-
multithreading. So, your So, your scheduler can scheduler can scheduler can build a complex build a complex build a complex dependency graph dependency graph dependency graph inside ECS systems, inside ECS systems, inside ECS systems, right? And with the right? And with the right? And with the API I described, it will be very easy API I described, it will be very easy API I described, it will be very easy to write systems that to write systems that to write systems that will work with both the ECS will work with both the ECS world and the non-ECS world. world and the non-ECS world. world and the non-ECS world. But it may happen But it may happen But it may happen that your existing that your existing that your existing code base with code base with code base with actors turns out to be actors turns out to be actors turns out to be not very suitable for not very suitable for multithreading. Again, you don't have to go far don't have to go far . For example, in . For example, in . For example, in Unreal, Unreal, Unreal, actor components are not always actor components are not always actor components are not always designed to be designed to be designed to be accessed from a accessed from a accessed from a non-game stream. So in non-game stream. So in non-game stream. So in this case, such this case, such this case, such mixed systems mixed systems mixed systems have to be have to be have to be executed in the executed in the executed in the game stream. And game stream. And game stream. And again, this again, this again, this means that you won't means that you won't means that you won't get all the get all the performance benefits of ECS in performance benefits of ECS in such mixed such mixed such mixed systems. This is another systems. This is another systems. This is another disadvantage that is disadvantage that is disadvantage that is worth remembering. There worth remembering. There is also another is also another approach. And again approach. And again , a few practical , a few practical , a few practical approaches. You can approaches. You can approaches. You can copy copy copy component data in component data in component data in special special special synchronization systems. But synchronization systems. But synchronization systems. But if you choose this if you choose this if you choose this path, it's worth asking path, it's worth asking path, it's worth asking yourself: what is the source of the yourself: what is the source of the yourself: what is the source of the game data? Because game data? Because game data? Because if you, for example, if you, for example, if you, for example, copy copy copy actor data to ECS, and then actor data to ECS, and then actor data to ECS, and then modify this memory in ECS modify this memory in ECS , the question arises: do you , the question arises: do you , the question arises: do you need to need to need to synchronize it synchronize it synchronize it back? And if
-
back? And if back? And if you need to you need to you need to sync back sync back , who actually , who actually , who actually owns this data? owns this data? owns this data? Who is responsible Who is responsible Who is responsible if this data if this data differs? But this differs? But this approach may be approach may be approach may be especially important especially important especially important or necessary if or necessary if or necessary if you want the world you want the world you want the world outside of ECS, for whatever outside of ECS, for whatever outside of ECS, for whatever backward backward backward compatibility reasons, to have compatibility reasons, to have compatibility reasons, to have access to ECS data. access to ECS data. access to ECS data. So, such copying So, such copying So, such copying can also occur. can also occur. And this approach And this approach depends heavily on the project. depends heavily on the project. So So there is no universal rule here, there is no universal rule here, there is no universal rule here, except that we can say except that we can say that this is what that this is what that this is what such a such a such a strategy might look like. So here strategy might look like. So here strategy might look like. So here you have just an actor with you have just an actor with you have just an actor with component ABC and a component ABC and a component ABC and a heavy entity with heavy entity with heavy entity with component AB, which are component AB, which are component AB, which are completely different from a completely different from a completely different from a code perspective. They are code perspective. They are code perspective. They are not connected in any way not connected in any way not connected in any way , and you have , and you have , and you have multiple multiple multiple synchronization systems that synchronization systems that synchronization systems that perform this perform this perform this data copying. data copying. data copying. Okay, this is one Okay, this is one Okay, this is one approach that you approach that you approach that you can can can follow as well. follow as well. follow as well. Additionally, if you Additionally, if you Additionally, if you decide that ECS is decide that ECS is decide that ECS is the only source of the only source of the only source of truth in the new world truth in the new world , and for example you , and for example you , and for example you still need to have still need to have still need to have access to the access to the access to the actor world for some actor world for some actor world for some reason, you can reason, you can reason, you can use a kind of use a kind of use a kind of idiom where the idiom where the idiom where the actor component actor component actor component just stores the just stores the just stores the entity descriptor entity descriptor entity descriptor and secretly and secretly and secretly finds the component finds the component finds the component in ECS whenever in ECS whenever data access is needed. In this case, data access is needed. In this case, it is a kind of it is a kind of it is a kind of mirror component, and mirror component, and mirror component, and then you do not need then you do not need then you do not need additional additional additional synchronization systems. But
-
synchronization systems. But synchronization systems. But again, you need again, you need again, you need to be very careful to be very careful to be very careful if such if such actor mirror components actor mirror components actor mirror components are not used are not used are not used in the game flow. in the game flow. Again, because Again, because ECS memory can be ECS memory can be ECS memory can be affected by affected by affected by different game threads at the same time. different game threads at the same time. So you should be So you should be very careful with this very careful with this . Now the network. . Now the network. . Now the network. Network interaction Network interaction Network interaction is a very is a very is a very complex topic in itself. I will complex topic in itself. I will complex topic in itself. I will only point out one only point out one only point out one main thing: you have main thing: you have main thing: you have essentially two options. essentially two options. First, you can First, you can First, you can reuse the reuse the reuse the existing network existing network existing network replication that is in replication that is in replication that is in your engine. If, your engine. If, your engine. If, for example, your for example, your for example, your actors, nodes, or actors, nodes, or anything else supports anything else supports anything else supports data replication, you data replication, you data replication, you can use, can use, can use, for example, the template from the for example, the template from the for example, the template from the previous slide previous slide previous slide for such for such for such mirroring and mirroring and mirroring and use use use the actors as a bridge for the actors as a bridge for the actors as a bridge for network replication network replication . Yes, it's simpler, but . Yes, it's simpler, but . Yes, it's simpler, but it's an extra layer of it's an extra layer of it's an extra layer of data copying, and data copying, and data copying, and it means you'll have it means you'll have it means you'll have quite a few quite a few quite a few actors if actors if actors if you need to replicate you need to replicate you need to replicate a lot of entities, which a lot of entities, which a lot of entities, which may not be the may not be the may not be the best option, best option, best option, but at the same time it's but at the same time it's but at the same time it's practical and something that's practical and something that's practical and something that's actually actually actually used in used in used in practice. Another practice. Another practice. Another approach is a fully approach is a fully approach is a fully isolated isolated isolated ECS replication layer, which ECS replication layer, which ECS replication layer, which obviously gives you obviously gives you obviously gives you much more much more much more benefits and much benefits and much benefits and much more more more control over what control over what control over what happens.
-
happens. happens. For example, For example, For example, perform some perform some perform some packaging of data packaging of data packaging of data sent from sent from sent from ECS components, and so ECS components, and so ECS components, and so on. But this is on. But this is on. But this is not significantly different from not significantly different from not significantly different from developing a new developing a new developing a new engine from scratch and engine from scratch and engine from scratch and implementing a new implementing a new implementing a new layer of network layer of network layer of network replication from scratch. Which replication from scratch. Which replication from scratch. Which in itself can in itself can in itself can be problematic be problematic be problematic due to limited due to limited due to limited resources, but also resources, but also resources, but also because because because you now have two you now have two you now have two network replication models network replication models that have to that have to that have to compete with each compete with each compete with each other. Again, other. Again, other. Again, if, for example, your if, for example, your if, for example, your existing existing existing network replication model is network replication model is network replication model is sufficiently abstracted sufficiently abstracted sufficiently abstracted from actors, from actors, from actors, you may be able to attach you may be able to attach you may be able to attach ECS components to this ECS components to this ECS components to this abstracted abstracted abstracted network system. network system. network system. Again, if you are Again, if you are Again, if you are in this situation, you are in this situation, you are in this situation, you are lucky. If your lucky. If your lucky. If your network replication is network replication is network replication is very deeply very deeply very deeply rooted in actors, rooted in actors, rooted in actors, well, it's going to be much more well, it's going to be much more well, it's going to be much more difficult. Now about difficult. Now about difficult. Now about script support. script support. Script support Script support can be omitted. can be omitted. can be omitted. Especially if your Especially if your Especially if your main goal of main goal of main goal of using ECS is to using ECS is to using ECS is to increase increase increase productivity. But it's productivity. But it's productivity. But it's very hard to live without very hard to live without very hard to live without scripting support scripting support scripting support if you're going to if you're going to if you're going to use ECS as a use ECS as a use ECS as a complete replacement for how complete replacement for how complete replacement for how you write logic in your you write logic in your you write logic in your game. And this may be game. And this may be game. And this may be because, obviously, because, obviously, because, obviously, if you are already actively if you are already actively if you are already actively using using using scripts and scripts and scripts and you don't have access to ECS, it will be you don't have access to ECS, it will be you don't have access to ECS, it will be very difficult to write very difficult to write very difficult to write something in ECS logic. And here something in ECS logic. And here something in ECS logic. And here we have a fork in the we have a fork in the we have a fork in the road. So, road. So, first, we can first, we can first, we can implement... So, we
-
implement... So, we implement... So, we need to decide need to decide need to decide who our target who our target who our target audience for audience for audience for scripting is. And what, scripting is. And what, scripting is. And what, let's say, are their let's say, are their let's say, are their qualifications? Will it be qualifications? Will it be qualifications? Will it be artists, artists, artists, game designers, etc.? game designers, etc.? Will it be people with Will it be people with less technical less technical less technical knowledge, or knowledge, or knowledge, or maybe it will be the maybe it will be the maybe it will be the same people who essentially same people who essentially same people who essentially write our core write our core write our core logic. They'll just logic. They'll just logic. They'll just use use use scripts for faster scripts for faster scripts for faster prototyping, prototyping, prototyping, for example, and so on for example, and so on for example, and so on . So it . So it . So it depends...That's one of the depends...That's one of the depends...That's one of the things we things we things we need to consider. And need to consider. And need to consider. And you have essentially three you have essentially three you have essentially three options. You can options. You can options. You can either hide either hide any ECS patterns any ECS patterns altogether and altogether and altogether and rebuild it as an rebuild it as an rebuild it as an object-oriented object-oriented object-oriented model on the model on the model on the script side. Or you script side. Or you script side. Or you can go to can go to can go to the extreme and the extreme and the extreme and expose all expose all expose all ECS patterns on the ECS patterns on the ECS patterns on the script side. And by the way, script side. And by the way, script side. And by the way, you can choose something you can choose something you can choose something in between, because in between, because in between, because scripting scripting scripting has slightly has slightly has slightly different requirements. So, the different requirements. So, the different requirements. So, the first approach is first approach is first approach is to hide everything to hide everything to hide everything related to ECS. We will related to ECS. We will related to ECS. We will pretend that pretend that pretend that we have an we have an we have an object- object- oriented model on the scripting side, and oriented model on the scripting side, and oriented model on the scripting side, and make a direct make a direct make a direct one-to- one-to- one mapping between our one mapping between our one mapping between our C++ ECS components and C++ ECS components and C++ ECS components and scripting scripting scripting components. Yes, let components. Yes, let components. Yes, let 's put it this way. And we 's put it this way. And we 's put it this way. And we can even have can even have can even have methods in such methods in such methods in such components that components that components that will perform certain will perform certain will perform certain operations, certain operations, certain operations, certain logic, etc. for the logic, etc. for the logic, etc. for the scripting side.
-
scripting side. Advantages of this Advantages of this approach: no new approach: no new approach: no new paradigm paradigm paradigm is brought to the is brought to the is brought to the script level, which is good script level, which is good script level, which is good if we don't want to if we don't want to if we don't want to overload overload overload our our our scripting system users. scripting system users. scripting system users. But the drawback is the same But the drawback is the same : there is no new : there is no new : there is no new paradigm. And if we paradigm. And if we paradigm. And if we are aiming for the are aiming for the are aiming for the flexibility of ECS, then with flexibility of ECS, then with flexibility of ECS, then with this approach we will this approach we will this approach we will not achieve it. Another not achieve it. Another not achieve it. Another option is to go the route of option is to go the route of option is to go the route of removing all removing all removing all ECS patterns. This is quite ECS patterns. This is quite ECS patterns. This is quite possible: we can possible: we can possible: we can provide access not only provide access not only provide access not only to components, but also to to components, but also to to components, but also to systems and queries. systems and queries. By taking this out, we will By taking this out, we will allow us to create allow us to create allow us to create systems that systems that systems that find the right find the right find the right components and components and components and entities and perform the entities and perform the entities and perform the appropriate operations. appropriate operations. Sometimes I hear opinions that Sometimes I hear opinions that ECS is completely ECS is completely ECS is completely against against against scripting, but this is scripting, but this is scripting, but this is only a contradiction in terms of only a contradiction in terms of performance. Of course, if you Of course, if you stick with ECS and stick with ECS and stick with ECS and want to achieve want to achieve ECS-level performance in scripts, then by ECS-level performance in scripts, then by definition you definition you definition you won't get it, because no won't get it, because no won't get it, because no one will provide one will provide one will provide you with a cache-friendly you with a cache-friendly you with a cache-friendly architecture or architecture or multithreading support.
-
multithreading support. But at least But at least you will get the flexibility of writing logic when you can extend it by overriding additional systems you will get the flexibility of writing logic when you can extend it by overriding additional systems . The third . The third . The third approach is a mixed approach is a mixed approach is a mixed model, where you model, where you model, where you expose all the expose all the expose all the ECS patterns, which ECS patterns, which ECS patterns, which allows you to write allows you to write allows you to write systems, but at the same time systems, but at the same time systems, but at the same time you can allow you you can allow you you can allow you to add logic to add logic to add logic inside the inside the inside the components themselves. This is a components themselves. This is a components themselves. This is a mixed approach, it is mixed approach, it is mixed approach, it is less cumbersome, because it is less cumbersome, because it is less cumbersome, because it is worth remembering that worth remembering that worth remembering that the purpose of scripts is often the purpose of scripts is often the purpose of scripts is often to to to configure a configure a configure a specific game specific game specific game instance. In such instance. In such instance. In such situations, you don't situations, you don't situations, you don't want to write a want to write a want to write a separate system for separate system for separate system for each such each such each such individual case. And individual case. And individual case. And yes, in this case, having yes, in this case, having yes, in this case, having callback methods callback methods callback methods like "on like "on like "on world entry", "on world entry", "on world entry", "on world exit", or world exit", or world exit", or even "on even "on even "on update" in the update" in the update" in the component itself is good. component itself is good. This may also be This may also be possible. Of course, this is possible. Of course, this is possible. Of course, this is not pure ECS. Of course, not pure ECS. Of course, not pure ECS. Of course, this is a model. it's a this is a model. it's a this is a model. it's a mixed approach, but mixed approach, but mixed approach, but at the same time it's less at the same time it's less at the same time it's less verbose. And verbose. And verbose. And again, if we're again, if we're again, if we're talking about scripts, talking about scripts, talking about scripts, they allow us they allow us they allow us to be less to be less to be less conservative here.
-
conservative here. Content creation tools. Content creation tools. So there So there So there are actually two approaches here too. We are actually two approaches here too. We are actually two approaches here too. We can integrate can integrate can integrate into an existing into an existing into an existing component editor if component editor if component editor if we already have a we already have a we already have a component model and component model and component model and corresponding editor corresponding editor . Or we can . Or we can . Or we can implement a implement a implement a completely new completely new editing workflow. But it is editing workflow. But it is important to remember that important to remember that important to remember that for an artist there is no for an artist there is no for an artist there is no significant difference between an significant difference between an significant difference between an ECS and non-ECS ECS and non-ECS ECS and non-ECS component model. So what does this component model. So what does this component model. So what does this mean? If you mean? If you mean? If you already already already have a component model in your editor, have a component model in your editor, adding a component adding a component looks the same for the artist. looks the same for the artist. looks the same for the artist. So whether it's ECS under So whether it's ECS under So whether it's ECS under the hood or non-ECS—it doesn't the hood or non-ECS—it doesn't the hood or non-ECS—it doesn't matter, because it's matter, because it's matter, because it's just a component, and just a component, and just a component, and we have any we have any we have any logic here. From the logic here. From the logic here. From the artist's point of view. Yes, artist's point of view. Yes, artist's point of view. Yes, of course, under the hood of course, under the hood of course, under the hood we have a system with a we have a system with a we have a system with a certain logic, but certain logic, but certain logic, but it is invisible to the artist it is invisible to the artist it is invisible to the artist . At the same time, . At the same time, . At the same time, we can we can we can implement this, implement this, implement this, for example, if for example, if for example, if we decide to map we decide to map we decide to map actors to entities actors to entities actors to entities under the hood, we under the hood, we under the hood, we can simply can simply can simply distribute distribute distribute components: the old components: the old components: the old actor component actor component actor component will be added to the will be added to the will be added to the actor. And if it is a actor. And if it is a actor. And if it is a new ECS component, new ECS component, new ECS component, it will be added it will be added it will be added to the ECS equivalent of to the ECS equivalent of to the ECS equivalent of this actor. And it this actor. And it this actor. And it will work. Of course, will work. Of course, will work. Of course, this won't work well this won't work well this won't work well if your editor if your editor if your editor doesn't support the doesn't support the doesn't support the component model at all.
-
component model at all. component model at all. For example, if you For example, if you For example, if you only have an actor-based model only have an actor-based model only have an actor-based model without without without components, right? And it components, right? And it components, right? And it also won't work also won't work also won't work well if you want to well if you want to well if you want to have only entities have only entities have only entities without any without any corresponding actors. So, in corresponding actors. So, in corresponding actors. So, in that case it's going to be that case it's going to be that case it's going to be a little tricky, or, well a little tricky, or, well , you could , you could , you could modify the modify the modify the existing editor, existing editor, existing editor, but that might not be but that might not be but that might not be easy. So in easy. So in easy. So in this case you're this case you're this case you're introducing a new introducing a new content creation tool, which of content creation tool, which of course, because it's a course, because it's a course, because it's a new new new tool, it's going to give tool, it's going to give tool, it's going to give you more freedom of you more freedom of you more freedom of implementation in your implementation in your implementation in your editor. And you editor. And you editor. And you can make it more can make it more can make it more spectacular, more beautiful, more spectacular, more beautiful, more spectacular, more beautiful, more modern, etc. And this modern, etc. And this modern, etc. And this may be the only may be the only may be the only solution if solution if solution if your engine your engine your engine doesn't have a doesn't have a doesn't have a component model at all. component model at all. component model at all. Obviously. But you Obviously. But you Obviously. But you also have to also have to also have to understand that this understand that this understand that this now introduces a now introduces a now introduces a different work process. different work process. different work process. And now you need And now you need And now you need to teach your to teach your to teach your artists the new artists the new artists the new process. And explain to process. And explain to process. And explain to them when to them when to them when to follow the new follow the new follow the new process and when to follow the process and when to follow the process and when to follow the old one. So this is a old one. So this is a old one. So this is a consequence. And now the consequence. And now the consequence. And now the implementation.
-
implementation. Implementation is an Implementation is an extremely important extremely important extremely important part of all of this, part of all of this, part of all of this, because it because it because it determines whether determines whether determines whether our entire plan will be our entire plan will be our entire plan will be successful or not. And successful or not. And successful or not. And each stage requires a each stage requires a each stage requires a useful outcome useful outcome useful outcome and a way to and a way to and a way to verify it. And without verify it. And without verify it. And without proper proper proper implementation, we implementation, we implementation, we simply will not achieve simply will not achieve simply will not achieve any success. So, the any success. So, the any success. So, the first stage first stage first stage of implementing our of implementing our of implementing our ECS in a new engine may ECS in a new engine may ECS in a new engine may not not not involve ECS itself at all involve ECS itself at all . We can, for example . We can, for example , initially implement , initially implement , initially implement only only only development tools, such as changes development tools, such as changes development tools, such as changes to the editor. Without to the editor. Without to the editor. Without backend. What could backend. What could backend. What could be the reason for this? be the reason for this? be the reason for this? We can We can We can test, test, test, especially if the process is especially if the process is especially if the process is significantly significantly significantly different from the different from the different from the existing existing object manipulation process. We can object manipulation process. We can check whether the check whether the artists understand this correctly. First and second, First and second, it allows us, it allows us, it allows us, for example, to have for example, to have for example, to have intermediate layers that intermediate layers that intermediate layers that will store data from will store data from will store data from new tools in new tools in new tools in old formats. Which old formats. Which old formats. Which allows you, allows you, allows you, for example, to avoid for example, to avoid for example, to avoid modifying the modifying the modifying the binary file that is binary file that is binary file that is distributed distributed distributed to clients. Which in to clients. Which in to clients. Which in itself makes the process itself makes the process itself makes the process much less much less much less dangerous, because dangerous, because dangerous, because otherwise we would have to otherwise we would have to otherwise we would have to modify the modify the modify the game binary itself game binary itself game binary itself that is that is that is being distributed, and being distributed, and being distributed, and so on. So, here we
-
so on. So, here we so on. So, here we test test test tools first. Then we tools first. Then we tools first. Then we talk about talk about talk about implementing the ECS core, implementing the ECS core, implementing the ECS core, right? And here we will right? And here we will right? And here we will implement implement implement integration with the world. integration with the world. This way, we This way, we will be able to test the will be able to test the will be able to test the existing logic that existing logic that existing logic that we have ported to ECS. That we have ported to ECS. That we have ported to ECS. That it is not broken. We are it is not broken. We are it is not broken. We are not writing new not writing new not writing new logic here. We are simply logic here. We are simply logic here. We are simply checking that checking that checking that the presence of the ECS kernel does not the presence of the ECS kernel does not the presence of the ECS kernel does not conflict with the existing conflict with the existing conflict with the existing world. Does not conflict with the world. Does not conflict with the world. Does not conflict with the existing engine. And we're existing engine. And we're existing engine. And we're doing doing regression testing here. First of all. Then we can Then we can test the visual test the visual test the visual effects. We can effects. We can effects. We can add features that add features that add features that improve improve improve the appeal of the game. the appeal of the game. the appeal of the game. Since this is just a Since this is just a Since this is just a visual part, visual part, visual part, it won't break any it won't break any it won't break any complex game complex game complex game subsystems. So in the subsystems. So in the subsystems. So in the worst case scenario, worst case scenario, worst case scenario, we can just we can just we can just turn it off. The main turn it off. The main turn it off. The main goal of this phase is goal of this phase is to test the new to test the new development tools workflow in combination development tools workflow in combination with the ECS core. We with the ECS core. We with the ECS core. We check whether check whether check whether our our our artists are capable of creating artists are capable of creating artists are capable of creating content, whether content, whether content, whether it is created it is created it is created properly, whether properly, whether properly, whether engineers engineers engineers are implementing new are implementing new are implementing new features with ECS correctly, and whether features with ECS correctly, and whether features with ECS correctly, and whether it all works together. So, it all works together. So, it all works together. So, this is a real testing ground for a this is a real testing ground for a new process. And new process. And the last part, then the last part, then , is the game features in the , is the game features in the , is the game features in the online game. We are online game. We are online game. We are also talking about also talking about also talking about implementing
-
implementing implementing network integration network integration . And here we write . And here we write . And here we write complex game complex game complex game mechanics with mechanics with mechanics with long-term long-term long-term consequences. And here we consequences. And here we consequences. And here we conduct a full conduct a full conduct a full stress test of stress test of stress test of everything we implemented everything we implemented everything we implemented previously and are happy previously and are happy previously and are happy when everything works well when everything works well . I hope . I hope . I hope everything is okay at this point, because everything is okay at this point, because everything is okay at this point, because otherwise it's not very otherwise it's not very otherwise it's not very good. And so, and here, in good. And so, and here, in good. And so, and here, in essence, well, at this essence, well, at this essence, well, at this stage we can stage we can stage we can say that Yes, and here say that Yes, and here say that Yes, and here we understand that, well, we understand that, well, we understand that, well, we have achieved our goal we have achieved our goal . Conclusion. ECS can be . Conclusion. ECS can be . Conclusion. ECS can be integrated into an integrated into an integrated into an existing engine. This existing engine. This existing engine. This would require more would require more would require more effort than effort than effort than potentially building your potentially building your potentially building your own engine from scratch own engine from scratch . At the same time, the . At the same time, the . At the same time, the integration work will be integration work will be integration work will be quite tangible. quite tangible. So, it's not So, it's not free, but it's free, but it's free, but it's possible. You should possible. You should possible. You should avoid an “all avoid an “all avoid an “all or nothing” approach. If you or nothing” approach. If you or nothing” approach. If you sit around waiting to sit around waiting to sit around waiting to rewrite the entire rewrite the entire rewrite the entire engine for the new ECS and don't engine for the new ECS and don't engine for the new ECS and don't release the product release the product release the product before then, you'll never get before then, you'll never get before then, you'll never get it done. And you it done. And you it done. And you must understand this.
-
must understand this. must understand this. It is unlikely that you It is unlikely that you It is unlikely that you will get rid of the old will get rid of the old will get rid of the old approach 100%. It may approach 100%. It may approach 100%. It may be disappointing, but you be disappointing, but you be disappointing, but you just have to just have to just have to realize and realize and realize and accept that you will accept that you will accept that you will never reach that never reach that never reach that stage. But, stage. But, stage. But, honestly, that's not honestly, that's not honestly, that's not necessary. Because all of this is a necessary. Because all of this is a gradual evolution. gradual evolution. gradual evolution. You gradually You gradually You gradually develop your develop your develop your engine. You gradually engine. You gradually engine. You gradually shift it to a shift it to a shift it to a new paradigm. And new paradigm. And new paradigm. And thanks to this, at thanks to this, at any moment you can any moment you can any moment you can stop and say: stop and say: stop and say: “Okay, we’re not going any further. “Okay, we’re not going any further. “Okay, we’re not going any further. ” Or you could ” Or you could ” Or you could say, “Okay, we’re say, “Okay, we’re say, “Okay, we’re investing more investing more investing more resources to make resources to make resources to make our lives better, more our lives better, more our lives better, more productive, more productive, more productive, more scalable, etc. scalable, etc. ” This is evolution. Here ” This is evolution. Here ” This is evolution. Here we are. Let's we are. Let's we are. Let's move on to move on to move on to the questions. the questions. Hi Alex, this was a Hi Alex, this was a fantastic session. fantastic session. fantastic session. Yes, definitely. And I Yes, definitely. And I Yes, definitely. And I also wanted to add also wanted to add also wanted to add something personal: I think something personal: I think this material would be really this material would be really this material would be really helpful to me helpful to me helpful to me while studying for a while studying for a while studying for a game development course because game development course because game development course because I like I like I like how how how practical it is. So practical it is. So practical it is. So thank you very much for that.
-
thank you very much for that. Yes, thank you very much. Yes, I Yes, thank you very much. Yes, I really really really prepared for this for a long time. prepared for this for a long time. We had a lot of We had a lot of questions in the chat. And questions in the chat. And questions in the chat. And I think one of the I think one of the I think one of the main things, which main things, which main things, which coincides with what I coincides with what I coincides with what I wanted to ask myself, is that the wanted to ask myself, is that the report is quite report is quite general. So, general. So, general. So, the question is: is the question is: is the question is: is ECS supported ECS supported ECS supported natively in the main natively in the main natively in the main engines? The report engines? The report engines? The report suggests that suggests that suggests that maintaining the boundaries between maintaining the boundaries between maintaining the boundaries between hybrid hybrid hybrid actors and ECS requires actors and ECS requires actors and ECS requires considerable effort, considerable effort, considerable effort, especially with a large especially with a large especially with a large development team development team . . Yes, first of all, an interesting Yes, first of all, an interesting question. So, we have a question. So, we have a question. So, we have a situation here that, situation here that, first of all, has three first of all, has three first of all, has three directions. We can directions. We can directions. We can look at existing look at existing look at existing third-party engines like third-party engines like third-party engines like Unreal, Unity, for example, Unreal, Unity, for example, Unreal, Unity, for example, Godot, yes. First, I'll Godot, yes. First, I'll Godot, yes. First, I'll focus on Unreal focus on Unreal focus on Unreal Engine. Because both of Engine. Because both of Engine. Because both of them also have their them also have their them also have their own ECS integration. own ECS integration. Unity has its DOTS stack, and Unity has its DOTS stack, and Unreal, for example, has the Unreal, for example, has the Unreal, for example, has the Mass Entity stack, right? At the same time, Mass Entity stack, right? At the same time, Mass Entity stack, right? At the same time, they have these...
-
they have these... they have these... let's say, they also let's say, they also let's say, they also face the face the face the same problems same problems same problems that I describe here in the that I describe here in the that I describe here in the report. For example, report. For example, report. For example, if you try to if you try to if you try to write something with Mass write something with Mass write something with Mass Entity in Unreal, you will also Entity in Unreal, you will also Entity in Unreal, you will also encounter encounter encounter a situation where you a situation where you a situation where you need certain need certain need certain features from an existing features from an existing features from an existing Actor world and Mass Entity does Actor world and Mass Entity does Actor world and Mass Entity does n't have them, for example. n't have them, for example. n't have them, for example. So yes, this is what So yes, this is what So yes, this is what happens in happens in happens in third-party engines: third-party engines: third-party engines: first they have first they have first they have libraries that libraries that libraries that allow you to write on allow you to write on allow you to write on ECS, but of course there ECS, but of course there ECS, but of course there are problems are problems are problems when you have to when you have to when you have to think through everything. think through everything. think through everything. Also, when it comes to your Also, when it comes to your Also, when it comes to your own engines, you will own engines, you will own engines, you will also have to also have to also have to do some do some do some work. Another thing work. Another thing work. Another thing I was talking about: I I was talking about: I I was talking about: I talk talk talk to other people in the to other people in the to other people in the industry from time to time, and I've noticed industry from time to time, and I've noticed industry from time to time, and I've noticed that a lot of new that a lot of new that a lot of new engines that engines that engines that are being developed from scratch, are being developed from scratch, are being developed from scratch, or not even from scratch, are or not even from scratch, are or not even from scratch, are gradually gradually gradually implementing implementing implementing ECS integration. So ECS integration. So ECS integration. So when it comes when it comes when it comes to ECS itself, it's to ECS itself, it's to ECS itself, it's gradually gradually gradually being implemented into being implemented into being implemented into existing engines existing engines existing engines everywhere, and people are everywhere, and people are everywhere, and people are using it. But yes using it. But yes , obviously you , obviously you , obviously you need to spend need to spend need to spend extra effort to extra effort to extra effort to support multiple support multiple support multiple views in this views in this views in this plan. So, it's not plan. So, it's not plan. So, it's not free. It's not free. It's not free. It's not free if you free if you free if you integrate into an integrate into an integrate into an existing engine. You existing engine. You existing engine. You must definitely must definitely must definitely understand this. But yes, it's understand this. But yes, it's understand this. But yes, it's quite real.
-
quite real. Yes, I also wanted to Yes, I also wanted to share the share the survey results. We survey results. We did a survey and did a survey and did a survey and most people most people most people use OOP. use OOP. use OOP. Some use ECS Some use ECS , but many , but many , but many choose a hybrid choose a hybrid choose a hybrid approach. So, would approach. So, would approach. So, would you recommend a you recommend a you recommend a hybrid approach, or would you hybrid approach, or would you hybrid approach, or would you prefer prefer prefer pure ECS? pure ECS? Great, great Great, great question. So, if question. So, if question. So, if you're starting to you're starting to you're starting to build a new engine build a new engine build a new engine from scratch, right? And...again from scratch, right? And...again from scratch, right? And...again , I would strongly , I would strongly , I would strongly advise sticking with the advise sticking with the advise sticking with the ECS approach, at least ECS approach, at least ECS approach, at least at its core. Again at its core. Again at its core. Again , you can...and this is what , you can...and this is what , you can...and this is what I observe I observe I observe when talking to when talking to when talking to people in the industry. people in the industry. people in the industry. Yes. So in this Yes. So in this Yes. So in this case I would recommend case I would recommend case I would recommend building an ECS kernel. You building an ECS kernel. You building an ECS kernel. You can always, for can always, for can always, for whatever reason, whatever reason, whatever reason, wrap it in a wrap it in a wrap it in a more object- more object- oriented approach oriented approach oriented approach due to future due to future due to future needs, as needs, as needs, as sometimes it may be more sometimes it may be more sometimes it may be more useful. You useful. You useful. You can always " can always " wrap" it. But behind wrap" it. But behind wrap" it. But behind the scenes, the scenes, the scenes, stick with ECS, stick with ECS, stick with ECS, because again, what because again, what because again, what is ECS? As I is ECS? As I is ECS? As I mentioned, this is about mentioned, this is about mentioned, this is about batch processing of batch processing of batch processing of objects. Er, objects objects. Er, objects . If you take a . If you take a . If you take a bird's eye view bird's eye view bird's eye view of the of the of the game development codebase, this is how game development codebase, this is how game development codebase, this is how we we we tried to write tried to write tried to write engines long before engines long before engines long before ECS came along. ECS ECS came along. ECS ECS came along. ECS standardizes this standardizes this standardizes this way of writing. And way of writing. And way of writing. And again, it is more again, it is more again, it is more useful for useful for useful for modern architectures.
-
modern architectures. modern architectures. So I advise you So I advise you So I advise you to stick to this. to stick to this. to stick to this. Again, if we're Again, if we're Again, if we're talking about an talking about an talking about an existing engine, you existing engine, you existing engine, you simply can't simply can't simply can't rewrite it rewrite it rewrite it completely. In that completely. In that completely. In that case, you would case, you would case, you would use a use a use a hybrid approach hybrid approach hybrid approach similar to what I similar to what I similar to what I described. So, yes. That's what described. So, yes. That's what I...that's what I would I...that's what I would I...that's what I would say. say. say. We don't have much time We don't have much time We don't have much time for a large number of for a large number of for a large number of questions. So, I guess questions. So, I guess questions. So, I guess the last question is: do the last question is: do the last question is: do you think the main you think the main you think the main reason to use reason to use reason to use ECS is performance ECS is performance ? That's the first thing that comes ? That's the first thing that comes ? That's the first thing that comes to mind, but if you're to mind, but if you're to mind, but if you're suggesting having the suggesting having the suggesting having the engine core on ECS, is it engine core on ECS, is it engine core on ECS, is it for for for performance or are there performance or are there performance or are there other good reasons? other good reasons? Yes, that's a great Yes, that's a great question. First, question. First, question. First, the reasons why people the reasons why people the reasons why people mention ECS are, mention ECS are, mention ECS are, of course, of course, of course, performance, performance, performance, as it as it as it allows you allows you allows you to organize your to organize your to organize your codebase in a more convenient codebase in a more convenient codebase in a more convenient way, and is also way, and is also way, and is also better suited for better suited for better suited for multithreading. multithreading. But at the same time, it allows you to But at the same time, it allows you to write a write a write a more flexible more flexible more flexible game architecture because game architecture because game architecture because your way of thinking your way of thinking your way of thinking changes a little. You changes a little. You changes a little. You say, "Okay, my say, "Okay, my say, "Okay, my scene is made up of scene is made up of scene is made up of components, and in this components, and in this components, and in this part of the logic, I'm part of the logic, I'm part of the logic, I'm querying entities that querying entities that querying entities that meet these meet these meet these criteria." "Here I am criteria." "Here I am criteria." "Here I am requesting objects that requesting objects that requesting objects that meet these meet these meet these criteria." And this criteria." And this criteria." And this provides an additional provides an additional provides an additional level of level of level of extensibility to extensibility to extensibility to the way the way the way such logic is written. So I would such logic is written. So I would such logic is written. So I would say that say that say that architectural architectural architectural advantage is achieved here as well advantage is achieved here as well advantage is achieved here as well . And in a . And in a . And in a mixed hybrid mixed hybrid mixed hybrid approach, that's essentially approach, that's essentially approach, that's essentially going to be the first going to be the first going to be the first benefit you'll benefit you'll benefit you'll get, because in a get, because in a get, because in a hybrid approach,
-
hybrid approach, hybrid approach, performance is performance is performance is a little bit harder to achieve a little bit harder to achieve a little bit harder to achieve . Although for . Although for . Although for subsystems written subsystems written subsystems written purely on ECS, you will, of course, purely on ECS, you will, of course, purely on ECS, you will, of course, get a boost. get a boost. get a boost. For situations with For situations with For situations with intermediate data, intermediate data, intermediate data, things will be different. And things will be different. And things will be different. And again, as I again, as I again, as I mentioned, you can mentioned, you can mentioned, you can write scripts on the write scripts on the write scripts on the scripting side scripting side , also , also , also using the using the using the ECS paradigm. Of course, ECS paradigm. Of course, ECS paradigm. Of course, you won't get any you won't get any performance benefits here, but performance benefits here, but you will have flexibility. you will have flexibility. you will have flexibility. And you'll just And you'll just And you'll just have to train have to train have to train everyone outside of the everyone outside of the everyone outside of the development team development team development team to use ECS, which is to use ECS, which is ... ... ... Yeah, about that, yeah, Yeah, about that, yeah, Yeah, about that, yeah, that's completely true. that's completely true. But again, the But again, the funny thing is that if you funny thing is that if you funny thing is that if you ask yourself how ask yourself how ask yourself how people wrote code people wrote code people wrote code before, you before, you before, you might suddenly find that might suddenly find that might suddenly find that they tend to they tend to they tend to create some kind of create some kind of create some kind of managers that managers that managers that wrap objects in wrap objects in wrap objects in their own methods and their own methods and their own methods and perform certain perform certain perform certain operations. So they operations. So they operations. So they suddenly tried suddenly tried suddenly tried to write something similar to write something similar to write something similar to ECS, but without to ECS, but without to ECS, but without ECS itself. And suddenly you ECS itself. And suddenly you ECS itself. And suddenly you realize that it's realize that it's realize that it's actually the same actually the same actually the same pattern. pattern. pattern. That's right. And as you That's right. And as you That's right. And as you mentioned earlier, we are mentioned earlier, we are mentioned earlier, we are all very all very all very familiar with adding a familiar with adding a familiar with adding a component. So, that component. So, that component. So, that makes sense. Unfortunately, we will makes sense. Unfortunately, we will makes sense. Unfortunately, we will have to have to have to end this and end this and end this and move on. There are move on. There are move on. There are still a few still a few still a few questions left in the chat. I wonder if questions left in the chat. I wonder if questions left in the chat. I wonder if you could take a look you could take a look you could take a look at the YouTube chat and at the YouTube chat and at the YouTube chat and try to try to try to answer them there answer them there ? There's another good ? There's another good ? There's another good question there, especially question there, especially question there, especially about how to convince about how to convince about how to convince management to move management to move management to move to an ECS system. That's right to an ECS system. That's right to an ECS system. That's right . This is a separate topic for another . This is a separate topic for another . This is a separate topic for another hour. That's good.
-
hour. That's good. hour. That's good. Alex, thank you very much. Alex, thank you very much. Alex, thank you very much. I really I really I really enjoyed this session.
Summary
This talk explores integrating the Entity-Component-System (ECS) architectural pattern into existing live game engines without a complete rewrite. Key concepts discussed include entities, components as data carriers, and systems for logic execution, drawing from experience integrating ECS in games like World of Tanks and Unreal Engine. The practical takeaway is that ECS can be adopted incrementally to improve game logic standardization and development efficiency.