Skip to main content
Share Your Experience: Take the 2024 Developer Survey

Questions tagged [entity-component-system]

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

44 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
3 votes
1 answer
183 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-...
Hypergardens's user avatar
3 votes
0 answers
2k views

How to sync entities in an ECS game?

I'm wondering how to engineer a client server sync of entities in a multiplayer game which is using an ECS. When the server changes some values of the components of an entity, I thought the best ...
EchtFettigerKeks's user avatar
2 votes
0 answers
51 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
2 votes
2 answers
409 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 ...
mrg95's user avatar
  • 121
2 votes
0 answers
1k views

Efficient communication between entities using ECS via entt

To avoid confusion about the ECS terms I'll use, I explain them here quickly. I use entt terminology and set-up my architecture like this: Entity: is only an id (...
mrzo's user avatar
  • 133
2 votes
0 answers
123 views

Properway to pass information from one system to another in an entity component system design

After having read some example programs (namely Pong, Snake and Pacman) I am now experiencing with ECS. I am wondering where to put the elements for a reward flow. Do you know good practices for ...
julien's user avatar
  • 121
1 vote
0 answers
139 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
1 vote
0 answers
106 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
1 vote
0 answers
666 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,278
1 vote
0 answers
339 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,278
1 vote
0 answers
178 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
1 vote
0 answers
383 views

How to design a character damage system with ECS architecture?

I am developing an game with ECS architecture and trying to design a character damage system. Does the following design fits into ECS conception and will it be extendable in future? I have an ...
Nikolai's user avatar
  • 27
1 vote
0 answers
2k views

Implementing complex AI in an ECS?

I'm having a hard time wrapping around how something quite stateful such as complex AI would be handled in a pure ECS (such as components being only data and systems operating on that data) Things ...
Grant Upson's user avatar
1 vote
0 answers
107 views

Entity Component System: Dependency Between Systems

Inspired by the Entity Component System Architecture, I started to refactor my 2D tiled-based game to follow the rule "favor composition over inheritance". However, after writing the ...
barak1412's user avatar
  • 111
1 vote
0 answers
211 views

Roguelike movement system

I'm trying to implement a roguelike movement system for my game. I'm using the ECS architecture. The requirements are: entities will have a mass, on which should slow down the entity movement ...
Yves Calaci's user avatar
1 vote
0 answers
419 views

How do set a layer on an ECS entity?

I'm using Unity ECS entities to draw out some tiles. I would like to determine the layer (or sortOrder) of the rendered tile so that if a tile is placed over another at the same position, the tile ...
dolyth's user avatar
  • 445
1 vote
0 answers
229 views

How to find and modify specific entity or gameobject in Hybrid ECS?

I am rotating 3 cubes in Unity with Hybrid ECS and the code goes like this : ...
Abhinay Singh Negi's user avatar
1 vote
1 answer
1k views

Scale / NonUniformScale is not applied to entity

I'm just learning the new Unity ecs and trying to change the size (scale) of an entity. Everything works fine, I can change the rotation, the position but not the scale. I'm wondering why. I did ...
theoretisch's user avatar
0 votes
1 answer
39 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
71 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
56 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
27 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
107 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
90 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
0 answers
58 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
46 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
0 votes
0 answers
89 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
0 votes
0 answers
82 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
134 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
0 votes
0 answers
42 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 ...
David Notrael's user avatar
0 votes
0 answers
895 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
0 votes
0 answers
656 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
0 votes
1 answer
181 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
0 answers
271 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
0 votes
0 answers
221 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 ...
kitta's user avatar
  • 99
0 votes
0 answers
905 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 ...
Lead Vaxeral's user avatar
0 votes
0 answers
221 views

In the ECS on my server, how should I organize components along with systems?

A quick note about my server is that it executes game logic in 250ms intervals. I am trying to wrap my head around how to do this. The main issue I have is currently that I have the map of entityIds ...
Althaen's user avatar
  • 103
0 votes
0 answers
769 views

How to handle various collision effects within an Entity Component System?

Let's say we have three enemies, a bear trap, a fire trap, and a minotaur. When you walk over the bear trap, the game spawns an invisible entity that, upon the player colliding with it, slows the ...
Ryan Peschel's user avatar
0 votes
0 answers
382 views

Modeling RTS game logic using ECS

So I've been trying to make a simple RTS engine for some time and I always hit a wall because of increasing, inflexible and complicated hierarchy trees. I've ultimately found out that an ECS is a good ...
Andrew's user avatar
  • 101
0 votes
0 answers
591 views

Ways to persist entities and components in an ECS?

I am working on a small multiplayer game with rpg elements using java and "Artemis ODB". Most of the logic is already done but one important thing is missing. The persistence. So i am ...
genaray's user avatar
  • 517
0 votes
0 answers
298 views

Scrolling background in PyGame with Entity Component System

I know this type of question has been asked to death for 'normal' games, however I am struggling with relating a scrolling background to an entity component system (ECS) approach. Generic samples here ...
erik's user avatar
  • 1,378
0 votes
0 answers
192 views

Should the HUD be Entites in a ECS ? And how to handle Events if so?

I'm building a GameEngine using Ashley and some how I can't figure out how. I through I could use something like this. Or use the Signal/Listener from Ashley. But how to Implement a interactive HUD?...
Meeresgott's user avatar
0 votes
0 answers
58 views

Return different components by name in entity component system

I'm working on an entity component system but I'm having trouble with the editor. Components take the form of structs with this formula Component healthComponent; This works fine when you know what ...
Hayden Morris's user avatar
0 votes
0 answers
1k views

Unity "Convert To Entity" does not work (Render) with "Skinned Mesh Renderer" for Animations

I'm trying to make a game with Unity's ECS and Job System. I came across the issue where, Convert To Entity does not support Skinned Mesh Renderer. It does not render the mesh. I need it for ...
JekasG's user avatar
  • 407