Questions tagged [entity-component-system]
Used when referring to the Entity-Component-System (ECS) architecture.
136
questions
1
vote
0
answers
79
views
Why does ROBLOX use an object-oriented system rather than an entity component system? [closed]
I decided I would develop a game engine in c++, so I was thinking about different ways of handling objects. I also have experience with ROBLOX, so I know that it uses an object-oriented design as ...
0
votes
0
answers
61
views
In Unity 2021.3.29(built-in render pipeline, entities 0.51.1-preview.21), what is the proper way of DOTS based collision detection?
Packages Installed:
Entities: com.unity.entities Version 0.51.1-preview.21
Documentation URL: https://docs.unity3d.com/Packages/[email protected]/manual/index.html
Physics: com.unity.physics ...
1
vote
0
answers
55
views
In Unity 2022+, Unity.Physics 1.0.16, what is the proper way of detecting collisions with a job?
I have properly defined the CollisionEventJob, scheduled it, and attached necessary components to my entities, but for the love of God, ECS is not detecting collisions between those entities. Here is ...
0
votes
0
answers
41
views
ECS: How do I instantiate Entities from a file of positions
I am quite new to Unity ECS and am trying to instantiate a few thousand entities based on positions stored in a .csv file. The file format can of course change, if that helps. My problem is to import ...
0
votes
1
answer
122
views
What is the general technique of optimizing a game's lag by updating thousands of mesh vertices using DOTS parallelism?
*Edit: I finally figured out after some profiling that the problematic code was not actually the ones part of ECS, but this line over here:
...
1
vote
1
answer
114
views
Efficient Queries in an archetype-based Entity Component System
I am currently writing an archetype-based ECS for learning purposes. What I noticed is that my current implementation is incredibly slow with large amounts of archetypes.
Each of my queries iterates ...
2
votes
1
answer
2k
views
Who 'owns' the components in an ECS?
Currently looking and reading about entity component systems, and just wanted to ask about who 'owns' or where the components are registered.
I would have thought that each entity has a collection of ...
1
vote
2
answers
95
views
Reduce entity-component system boilerplate
I'm attempting to create an entity-component system in C++.
However, I've run into an annoying issue where a component system function inherently involves a lot of ceremony and boilerplate. This is ...
1
vote
0
answers
58
views
ECS index data structure
I'm implementing an Entity-Component-System library based on simple dense array approach (using huge arrays for every component field with the size equal to the number of entities, where array[entity] ...
0
votes
0
answers
31
views
Source of truth for raising events in an Event-driven architecture?
I am developing a turn-based strategy game and am using Events to implement a "Buff" / "Debuff" system. The code is very OOP-y right now, not very ECS.
I am adding an event system ...
0
votes
0
answers
235
views
Hierarchical relationships in an Entity Component System
I'm trying to figure out how to integrate entity component systems with scene graphs in a web game / application. The problem is of course that ECS and scene graphs are very different in nature. They ...
1
vote
0
answers
366
views
How do I instantiate entities from a regular MonoBehaviour in ECS?
I'm loading data from an external source [call it an array of vector3 locations for the sake of this question]. I want to use it to spawn multiple instances of an entity with a renderer and some other ...
1
vote
0
answers
203
views
Unlit camera-facing billboard in ECS/DOTS shader
I'm attempting to create an unlit billboard shader for use in DOTS. I'm using quads to host the material
(Some regular, some DOTS for comparison purposes)
I've cribbed together something from this ...
2
votes
1
answer
628
views
How do I handle lists/arrays in Unity DOTS/ECS?
I'm new to ECS and am having issues finding the right data structure to use.
For context, I have a galaxy with solar systems that produce resources at a given rate (...
1
vote
0
answers
93
views
Am I doing something wrong in my ECS architecture if I must choose between coupling or copying code?
I'm developing a somewhat simple, small roguelike game as my university project. Early into development I heard about Enity-Component-System and decided to go with that as my game's architecture. ...
0
votes
0
answers
49
views
How to render using Mesh Component and Transformation Component in Entity Component System
I was developing a game engine using DirectX11. You want to use the Entity Component System (ECS) in your existing method OOP.
By the way, I have a question about the rendering system of ECS.
I was ...
0
votes
1
answer
358
views
ECS - Components that access other components
This question is about how to design my ECS system.
I have the following components:
Position
Gravity
Gravity needs to access Position.
Is there a better design that does not introduce this ...
0
votes
1
answer
153
views
How to implement movement with move speed in a multiplayer game?
I'm developing a MMO RPG using Rust and bevy both in the client and the server, which means that I'm using ECS on both sides. My game is tile based, so each tile is a point in my map in the server, ...
2
votes
1
answer
737
views
In C#, is there any performance reason to implement ECS?
The formal ECS specification was developed to address gaming in a JavaScript environment.
In any C# translation, this implies all of the classes' members must be public.
My concern is that too many ...
5
votes
1
answer
1k
views
In Bevy ECS, what is a good way to have entities reference each other?
I am wondering if there is a better way than storing the entity ID. For the sake of example, let's assume I have a world with many entities who implement the component Name. Every x amount of time I ...
0
votes
0
answers
43
views
Ways to "record" entity operations for an ECS?
What are typical ways to record entity operations for an ECS to play them back later ?
There several ECS implementations which actually do have such a mechanism, like unitys ecs. You can "buffer&...
0
votes
0
answers
361
views
Events and Entity Component Systems?
What are common ways to implement Events in an entity component system ?
Most games typically have following events :
Damage Events
Collision Events
Area of interest Events
Entity Died/Respawn events
...
1
vote
1
answer
313
views
Branchless archetype ECS?
I lately read an article about branchless programming and how it can effect performance. Since im developing a little archetype based ECS for learning purposes, i wanted to know if theres a way to ...
0
votes
1
answer
144
views
How to modify single-scene ECS setup to support multiple local players in different scenes?
I'm currently developing a game in Monogame / C#. I have the underlying game engine set up in the following way:
Entity/Component/System architecture
A Scene includes a map, cameras, and a list of ...
0
votes
1
answer
199
views
Setters and Getters in ECS?
So I'm currently working on a Game Engine for my University and I came to the point of integrating an ECS.
Thing is, I'm currently a bit unsure if it's okay to have setters and getters for specific ...
1
vote
1
answer
240
views
How do I write unit tests in ECS when behaviors cause creation of deletion of entities?
I am writing a game using a custom ECS architecture. I recently had a chain of nasty bugs where fixing one bug caused regressions elsewhere. Being a software engineer by trade, I suppose that unit ...
3
votes
1
answer
621
views
In ECS, how to decrease health?
I spent a good amount of time trying to get my head around ECS but the "S" is still obscure to me - the farthest I went is that I know a System is where the magic happens; it's where ...
0
votes
1
answer
141
views
ECS : Can systems have sub-systems?
I am searching about "sub-systems" in ECS but I don't find any article speaking on that.
Considers this simple example:
...
2
votes
2
answers
304
views
Is an ECS system without a traditional ECS memory layout a bad idea?
I've got a background in C++ but completely new to game dev, Unreal, and ECS.
Recently, I learned about ECS and fell in love with the resulting project structure and theoretical reduction of spaghetti ...
0
votes
0
answers
219
views
In ECS, how are the different types of components typically stored?
Consider an RPG for example, where one might have PoisonComponent, BerserkComponent, and ...
3
votes
2
answers
5k
views
I don't get why ECS is considered more performant than OOP
Let's say I have an ECS with physics and I want to kill the player when a arrow hit him. So I have a callback when there is a collision. Now there is of course different behaviors with different ...
2
votes
1
answer
328
views
In an Entity-Component-System architecture how should my map be represented?
I'm migrating a 2D game I've been making using only SpriteKit to an ECS architecture using GameplayKit, and I'm still a bit clueless on how to achieve this. I think I got the gist of ECS, but yet, I'...
0
votes
1
answer
540
views
How to animate game object using entities?
I am having issues with some of the DOTS stack in unity (mostly the rendering and animation) and was hoping I could use gameobjects for those parts. Not sure how to use entities inside a regular ...
3
votes
1
answer
207
views
How are map/room/world-related game assets usually organised and implemented?
I'm trying to build a simple 2D Shoot 'Em Up type of game in C++ using SDL2 and an Entity Component System, which I've already implemented. The idea is to have different maps/rooms where you have to ...
1
vote
1
answer
231
views
How to include cross cutting concerns like sound/graphics effects in an ECS?
It does not seem like a good idea to include this functionality in the game logic like that even if the concrete implementation of the sound or graphics effect is abstracted away. Ideally, the game ...
0
votes
1
answer
1k
views
Unity DOTS/ECS: Spawning entity programmatically at specific location
I'm interested in learning how to spawn entities from prefabs (from a monobehaviour) at random locations in a scene on a key press. Similar to this video, I'd like to instantiate these objects ...
2
votes
2
answers
233
views
Ways to synchronize lists over the network?
Im working on a little plain c# gameserver using an ecs. It follows the principles of the client/server model architecture.
However im often running into the following problem, the server has one or ...
1
vote
1
answer
331
views
Entity iteration order in ECS system
While learning ECS architecture, I found out that some ECS libraries gives me unsorted entity ids when iterating over filtered entities in system. (Seems like deletion algorithm in sparse set is the ...
0
votes
1
answer
331
views
How do you use configuration files to describe the contents of an entity in an ECS-system?
One of the advantages that's often brought up when talking about ECS-systems is that they allow a higher degree of flexibility in regards to Data vs Code. Without the limitation of hard-coded types, ...
0
votes
1
answer
224
views
Is a platform an entity in 2D Platform in ECS pattern?
I've been coding a small 2D platformer applying ECS pattern. However, I'm struggling with a issue. When building each platform from tilemap and such platforms need to be collided by other entities, ...
1
vote
1
answer
1k
views
SQL Database structure for ECS
I am making turn-based browser game (mostly server-sided), and every turn all game-state is saved into database (SQLite). Using ECS pattern. Never done this before (I am webdev).
There will be a lot ...
3
votes
2
answers
829
views
How do different compositions/types of entities interact in an ECS-system?
I have a working ECS-system set up, largely inspired by this brilliant article (not at all required reading to be able to answer my question) on https://indiegamedev.net/ showcasing an ECS-system with ...
1
vote
1
answer
140
views
Entity Component Systems - component cross-lookup vs denormalization
This is my first project using ECS design and I come from a RDMS background for reference.
I'm building a ecology simulation that spans multiple planets, with the following ECS structure:
Entities &...
1
vote
1
answer
573
views
Extensible 2D Rendering with ECS Architecture
I am currently creating a 2D game/game engine using an ECS architecture. Currently I have a renderer_2d system which is a function that takes all ...
0
votes
0
answers
174
views
ECS, How to query an entity with specific value?
I have a background in ECS by using C# Entitas. The library itself has a very nice feature which lets me able to query the entity with a specific value in the component.
For example, query an entity ...
2
votes
1
answer
1k
views
What should be an entity/component, and what shouldn't?
I've recently been reading the book Game Programming Patterns by Bob Nystrom, and one chapter I've found a bit hard to grip is the chapter about the Component pattern.
In the example he uses (which ...
3
votes
1
answer
154
views
Storing stateful function-based actions in a JSON
System: My game uses an "ECS + event queue" architecture where every tick, various events change
the state of JSON-able data. Plain JS objects.
Problem: I want to be able to save the game-...
3
votes
1
answer
2k
views
How to do State-Based Animation with ECS
I'm making a simple platformer game and was suggested to use ECS from a friend. It looked pretty interested and at least worth a try, so I did. I got ECS working and started work on the rendering ...
3
votes
1
answer
593
views
Entity Component System - How to detect what entity to update
everyone. I'm kinda new to game dev, I saw the idea of the ESC system and I'm inlove with it. I wanted to integrate something like that in my game, so I started rewriting my code. . I have a ...
0
votes
0
answers
819
views
Entity Component System in Python
Me and a team of junior developers are making a role playing game. We would like to make something similar to https://bunk.town/ I have only made a Tetris clone which doesn't require much knowledge ...