Questions tagged [entity-component-system]
Used when referring to the Entity-Component-System (ECS) architecture.
152 questions
0
votes
1
answer
183
views
Resource management in ECS?
I'm new to ECS. And I'm trying to create my own game in ECS. I want to ask what's the common way to do some resource management. For example, it's very common to load and unload images from disk in ...
0
votes
1
answer
39
views
Transform is not available in SystemBase Script (Unity Entities)
My player is baked entity in subscene while main camera is outside on scene. For some reason system cannot find transform of camera, GameObject was found though.
<...
1
vote
0
answers
152
views
ECS architecture in non-gaming scenario : best way to model relationships?
I'll preface the wall of text below by saying that I've next-to-no experience with game design/programming. But I've a situation that might be fairly interesting to folks here.
I'm currently working ...
0
votes
1
answer
148
views
How much slower are decent ECS frameworks supposed to be, compared to a naive array lookup?
I'm developing an ECS framework in C++ and after doing every optimization I could think of, the comparison with a naive array look up is terrible. It's 10x worse in debug mode and 3x worse in release ...
2
votes
0
answers
67
views
Best Approach for Storing / Serializing Property Value Animations
Background
I'm making a platformer game, in C#, in Monogame. I've got a middling amount of experience with gamedev, having done some mini projects in Unity in the past and deciding I don't like a big ...
0
votes
1
answer
197
views
Is it possible to make a game with a fully simulated world, with dynamic characters and environment?
Context
I really enjoy playing Skyrim. I have installed mods that make the game feel more immersive, like weapons breaking, survival mechanics, no visual information, pitch dark dungeons, etc, etc...
...
0
votes
1
answer
256
views
How to get the id of an Entity in EnTT in order to retrieve the components of an entity using the id?
I would like to implement something similar discussed in Efficient communication between entities using ECS via entt
There are two entities Ship, Engine. Ship has the components AppliedForces, Mass ...
0
votes
1
answer
211
views
Is this the right approach to ECS?
This is how I've designed my entity class. Instead of just an id, I made it a whole class:
...
0
votes
0
answers
370
views
How to efficiently instantiate large amount of GameObject?
The topic with the same title here
How to efficiently spawn & render many cube prefabs for a voxel world?
is actually asking about efficiently rendering.
Assume I need to instantiate a lot of ...
1
vote
0
answers
185
views
How can I efficiently make a delta snapshot that accounts for entities/components that have been added/removed?
In reference to the snapshot and delta compression approach popularized by Quake 3, but with ECS.
Understand the delta should only contain changes — makes sense.
However, if a snapshot delta no longer ...
0
votes
1
answer
354
views
How do Entity Component Systems work?
In the project I am working on, I recently ran into a problem of software architecture:
I created a base entity class that displays a world object. Then I added functionality for the entity to have a ...
0
votes
0
answers
295
views
What was the Entity-Component-System (ECS) derived from?
I am asking about some programming history here.
"In 1998, Thief: The Dark Project pioneered an ECS. The engine was later used for its sequel, as well and System Shock 2."
According to the ...
0
votes
0
answers
151
views
Preventing "pass through" situations properly when using ECS based collision detection
package versions I'm using:
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....
0
votes
1
answer
485
views
How to go about executing lua scripts in a ECS engine?
I'm trying to add scripting with lua to my C++ game engine, and I'm pretty stumped on how to tackle the executing/processing part. I started by creating a ...
0
votes
1
answer
174
views
How to structure this concept in ECS?
High level
At a high level, I'm looking to create a galaxy exploration-style game.
A number of points of interest will be selectable on the map (I'd like to aim for several hundred, but flexible and ...
2
votes
0
answers
100
views
How does non ECS parts work with ECS parts?
I incorporated ECS to my graphics engine and I have a problem with my Renderer needing the camera which is an entity and the process is a bit bizarre. Originally, I ...
0
votes
2
answers
282
views
What happens with global/singleton objects when using ECS?
As I've been learning about ECS one thing that gets me confused are things like input which in my case has usually been some singleton that gets polled or in one project was event based where code can ...
0
votes
0
answers
84
views
Architecture and design patterns for components
I was working on a physics-based plug-in/ extension for Unity water which would essentially be another component in Unity water.
The goal of this extension would be to integrate interactive physics ...
0
votes
1
answer
177
views
How to handle different components of the same entity having different indices?
I'm currently working on a little ECS project and a couple doubts came to my head when dealing with systems.
Let's say I have a model component, a position component and a scale component. Each ...
1
vote
0
answers
689
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
125
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
212
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
150
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
189
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
1k
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
243
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
201
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
3k
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
997
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
521
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
3k
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
362
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
2
answers
2k
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
324
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, ...
3
votes
1
answer
3k
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 ...
9
votes
1
answer
5k
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
1k
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
981
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
249
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
2
answers
442
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
468
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 ...
4
votes
1
answer
1k
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
246
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
756
views
Is an ECS system without a traditional ECS memory layout a bad idea? [closed]
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
434
views
In ECS, how are the different types of components typically stored?
Consider an RPG for example, where one might have PoisonComponent, BerserkComponent, and ...
6
votes
5
answers
20k
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
830
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
785
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
359
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 ...