Skip to main content

Questions tagged [entity-component-system]

Used when referring to the Entity-Component-System (ECS) architecture.

Filter by
Sorted by
Tagged with
0 votes
0 answers
12 views

Acquisition Of Transform Components In Parallel Via Unity's ECS

So it seems that the ECS supplies a job type for modifying transforms in parallel chunks, albeit not burst-compatible. However, you have to build the ...
Grim_T's user avatar
  • 3
0 votes
0 answers
138 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 ...
Suratraak's user avatar
1 vote
0 answers
92 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 ...
Adrian's user avatar
  • 121
0 votes
1 answer
79 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 ...
snow_owl's user avatar
0 votes
0 answers
114 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 ...
Jonh Smith Benjamin's user avatar
0 votes
0 answers
94 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....
rasputin's user avatar
0 votes
0 answers
37 views

Workaround to bind templated functions to lua?

I'm trying to add Lua for scripting to my C++ game engine, which is based on ECS, and I have a rough idea of what I want to do (is it good? probably not) but trying to actually execute it has been ...
Konjointed's user avatar
0 votes
1 answer
256 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 ...
Konjointed's user avatar
0 votes
0 answers
241 views

How to implement events with ECS?

I'm transitioning over to an ECS architecture for a small C++ graphics engine I'm working on and I'm a bit stumped on how to tackle events. One solution I came across was from this Reddit post ...
Konjointed's user avatar
0 votes
1 answer
92 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 ...
Basic's user avatar
  • 1,227
2 votes
0 answers
73 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 ...
Konjointed's user avatar
0 votes
2 answers
139 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 ...
Konjointed's user avatar
0 votes
0 answers
66 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 ...
Akshit Chaturvedi's user avatar
0 votes
1 answer
81 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 ...
Torino R6's user avatar
1 vote
0 answers
460 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 ...
Bunabyte's user avatar
  • 321
0 votes
0 answers
102 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 ...
rasputin's user avatar
1 vote
0 answers
179 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 ...
rasputin's user avatar
0 votes
0 answers
108 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 ...
kugelblytz's user avatar
0 votes
1 answer
143 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: ...
rasputin's user avatar
1 vote
1 answer
705 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 ...
genaray's user avatar
  • 517
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 ...
Juzzbott's user avatar
  • 123
1 vote
2 answers
156 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 ...
Red Needle's user avatar
1 vote
0 answers
135 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] ...
Andrew Kravchuk's user avatar
0 votes
0 answers
2k 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 ...
Candleout's user avatar
  • 101
1 vote
0 answers
853 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 ...
Basic's user avatar
  • 1,227
1 vote
0 answers
445 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 ...
Basic's user avatar
  • 1,227
2 votes
1 answer
2k 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 (...
Basic's user avatar
  • 1,227
1 vote
0 answers
267 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. ...
aallfik11's user avatar
0 votes
1 answer
1k 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 ...
Lucien's user avatar
  • 1,176
0 votes
1 answer
271 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, ...
Gustavo Mendonça's user avatar
3 votes
1 answer
2k 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 ...
user avatar
8 votes
1 answer
4k 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 ...
Feldspatt's user avatar
0 votes
0 answers
925 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 ...
genaray's user avatar
  • 517
1 vote
1 answer
659 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 ...
genaray's user avatar
  • 517
0 votes
1 answer
201 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 ...
Rich. T.'s user avatar
0 votes
2 answers
321 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 ...
Jonas Schindler's user avatar
1 vote
1 answer
361 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 ...
Tim C's user avatar
  • 620
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 ...
Guilherme Oderdenge's user avatar
0 votes
1 answer
197 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: ...
rafoo's user avatar
  • 163
2 votes
2 answers
550 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 ...
mrg95's user avatar
  • 121
0 votes
0 answers
341 views

In ECS, how are the different types of components typically stored?

Consider an RPG for example, where one might have PoisonComponent, BerserkComponent, and ...
AmagicalFishy's user avatar
5 votes
4 answers
13k 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 ...
rafoo's user avatar
  • 163
2 votes
1 answer
635 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'...
jalxp's user avatar
  • 123
0 votes
1 answer
705 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 ...
Emil's user avatar
  • 145
3 votes
1 answer
298 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 ...
Nick Román's user avatar
1 vote
1 answer
302 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 ...
codymanix's user avatar
  • 364
0 votes
1 answer
2k 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 ...
Mav's user avatar
  • 99
2 votes
2 answers
344 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 ...
genaray's user avatar
  • 517
1 vote
1 answer
519 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 ...
GarlicDipping's user avatar
0 votes
1 answer
443 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, ...
JensB's user avatar
  • 157