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

Questions tagged [entity-system]

A programming paradigm in which gameobjects (entities) are composed out of components, and are operated upon by systems. Each entity is an ID that points to specific components.

Filter by
Sorted by
Tagged with
0 votes
1 answer
53 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,278
1 vote
0 answers
246 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 ...
AcinonX's user avatar
  • 311
0 votes
1 answer
83 views

Entity Framework and reactive

In my games using entity framework (for example using https://github.com/libgdx/ashley ) help me to separate data from logic in different systems. But a problem I've found is how to handle events ...
Vokail's user avatar
  • 436
0 votes
0 answers
49 views

How do we restart levels?

When you run out of moves, you will need to go back to the beginning of a level. If a level objective is not complete, this means you have to restart a level. And the level will simply replace all of ...
Ji Fu Huang's user avatar
3 votes
2 answers
995 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 ...
JensB's user avatar
  • 157
0 votes
0 answers
151 views

ECS multithreading without value types?

Im working with an Java based ECS framework called "Artemis ODB". Its great so far but it lacks multithreading or jobs. So i wanted to add them by myself. I actually wanted to give each job ...
genaray's user avatar
  • 517
0 votes
0 answers
773 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
7 votes
2 answers
2k views

How "smart objects" are implemented and actually work?

I'm drafting my game and implementing small stuff in it, but hit a roadblock. You see, for my game I would like for different items to behave the same or to share behavior, for instance, some items ...
shackra's user avatar
  • 203
0 votes
1 answer
2k views

How do I contiguously store and iterate over ECS components in C++?

I'm writing an entity component system and want to store each type of component separately and contiguously in memory in a way that's easy to iterate over. Component...
Accumulator's user avatar
0 votes
2 answers
49 views

How to avoid entities flying far away when tabbing out and then tabbing back in?

I'm developing a game which uses a standard Entity-Component-System. Every frame, the PhysicsSystem runs, which, among other things, updates the position of ...
Ryan Peschel's user avatar
2 votes
2 answers
3k views

How to Implement ECS Archetypes in C#?

I'm trying to figure out how to implement a simple ECS with an Archetype approach, similar to what Unity's ECS uses. An archetype is just a category for entities that have a specific set of components....
Floating Sunfish's user avatar
0 votes
0 answers
137 views

How to draw the player standing behind a tree in an Entity Component System?

I'm making a top-down Javascript canvas game using the Entity Component System architecture. For an entity to be drawn on the screen every frame, it needs a ...
Ryan Peschel's user avatar
0 votes
1 answer
98 views

Should abilities have their state and functionality separated?

I'm developing a top-down game using Javascript and Canvas in an ECS architecture. I'm wondering, which of these is better from a design / elegance point of view? Method 1: Combining the ability ...
Ryan Peschel's user avatar
0 votes
0 answers
594 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
1 answer
423 views

Cannot decide between using a MessageBus and entities for events in my ECS game

For example, let's say that the player walks into an enemy and in response, a chain of events should occur (such as: his score goes up, the enemy dies, a cinematic starts, etc.) I see two "proper&...
Ryan Peschel's user avatar
1 vote
2 answers
1k views

Is it a bad idea to store functions inside components in ECS?

Say I have three entities: Player, Spikes, and Zombie. All of them are just rectangles and ...
kibe's user avatar
  • 111
0 votes
0 answers
33 views

ECS: Should Systems access only one component-type [duplicate]

Let's say I have a Transform-component-type, and a Color-component-type (to keep things simple). I also have an entity E that is ...
LeonTheProfessional's user avatar
0 votes
1 answer
1k views

How do you handle entity life-time and entities without all components in an ECS?

I'm just starting to implement my own ECS and am drawing everything down on paper to make sure I understand it all before tackling the implementation in code. However I'm getting stuck on entity-...
NeomerArcana's user avatar
1 vote
2 answers
2k views

How does ECS handle systems which need to know more about the environment of the entities it processes?

I'm trying to wrap my head around the concept of ECS (Entity Component System). I think I grasp the concept of the different parts, Entities, Components, and Systems. Entities: Basically just a ...
Mattias's user avatar
  • 113
0 votes
0 answers
89 views

How to store 3D entity position, offset, and transformation data for parent and children?

I am looking for a cleaner pattern to storing character position data, offsets, and transformations. I currently have a character with a vec3 for position. ...
kevzettler's user avatar
0 votes
1 answer
132 views

Hidden copies of the environment in an entity component system

For reasons outside the scope of this question, my game has several full copies of the game environment running asynchronously. At any one time, only one of these is rendered. This is trivial to ...
Omegastick's user avatar
1 vote
1 answer
267 views

Should fields in components in an ECS use polymorphism?

I've just started to try and learn how to use ECS (Entity component systems), but I'm having trouble understanding the concepts behind components. Should adding more types of components, or trying to ...
Sarah's user avatar
  • 59
1 vote
1 answer
196 views

Where should I put units and items in a squad-combat ECS-based game?

So I'm working on a game where squads of varied units would explore, fight, trade and build on an overworld map. Combat would be automated more or less, and happen on the overworld. Basically, ...
Hypergardens's user avatar
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
0 votes
1 answer
376 views

How to handle dynamic hierarchical entities in ECS

Here's the analogy: I have an organism which is composed of cells which can be further composed of a medley of attachments. What I have currently is a sort of event chain between child/parents to ...
Jugbot's user avatar
  • 3
9 votes
2 answers
2k views

User-friendly scripting when using an ECS?

I am currently creating a small hobby project to get back into game development, and I have decided to structure my entities using an ECS (Entity Component System). This implementation of an ECS is ...
Charanor's user avatar
  • 7,870
21 votes
5 answers
5k views

Improving an O(N^2) function (all entities iterating over all other entities)

A little bit of background, I'm coding an evolution game with a friend in C++, using ENTT for the entity system. Creatures walk around in a 2D map, eat greens or other creatures, reproduce and their ...
Alex's user avatar
  • 383
1 vote
1 answer
797 views

ECS - System calling other systems

I'm trying to build my first (2D) game with ECS but I always end up with some system calling other systems. Here's an example. There is a RegionSystem that manages RegionComponents. On each frame, ...
Itsbananas's user avatar
1 vote
1 answer
2k views

How to delete Unity Hybrid ECS Entities?

I'm trying to get into Unity's Hybrid ECS feature. Creating and Manipulating Entities has worked fine so far for me, but somehow I can't find a viable option to delete Entities which works 100% of the ...
BloodEchelon's user avatar
3 votes
1 answer
3k views

Should components in Entity Component System pattern have logic?

Is often read that in entity component system pattern we should treat components just as a passive data structure with no logic at all, this way we follow to a data oriented design approach with ...
Alejandro's user avatar
1 vote
3 answers
1k views

ECS in MMOs - How to handle IDs for different object types?

Using a DOD approach, what is the typical way to handle dealing with the actual IDs of game objects? Obviously, each entity has a unique entity_id that is ...
sme's user avatar
  • 111
0 votes
0 answers
90 views

Quadtree having ownership of entities, worth it?

Typically, you would have a list of entities stored somewhere, and you'd use quadtree when you need some collision testing between entities for example, by inserting all of the entities and generating ...
rick's user avatar
  • 1
0 votes
2 answers
1k views

Implementations for storing entities in an ECS system

I'm restructuring my model of entities, components and systems, where entities are: ...
PerduGames's user avatar
4 votes
2 answers
1k views

How to implement n-body in an Entity Component System

Recently I've been throwing problems at Entity Component Systems to see how far I can push the paradigm. One problem in particular I struggle with, which is writing an elegant implementation of the n-...
Sander Mertens's user avatar
0 votes
1 answer
2k views

How can I iterate over all entities with a particular component?

I'm currently designing a game engine and want to implement my own ECS implementation, so I decided to look around for ideas. Unity has recently updated their engine and seems to be pushing towards ...
Mathew O'Dwyer's user avatar
1 vote
0 answers
557 views

When would I use IJobProcessComponentData and when IJobParallelFor?

Quick question regarding the Job system in conjunction with pure ECS. When would I use IJobProcessComponentData and when ...
Christian Ivicevic's user avatar
0 votes
2 answers
3k views

How to represent a modular FSM for AI using ECS?

I am considering to implement AI using ECS which actually contradicts working with naive FSMs. My current idea is to have multiple components which represent the particular state an Entity that has a <...
Christian Ivicevic's user avatar
0 votes
2 answers
321 views

How ID's work in FPS games

I am wondering how games generate IDs/GUIDs for their entities (along these lines), and which entities specifically get them. To narrow the scope of the question down, I am just focusing on FPS games ...
Lance's user avatar
  • 177
1 vote
1 answer
395 views

How MMOs store IDs for game entities

Wondering in general how IDs are stored in a large massively multiplayer online game. From what I can imagine, it seems that each "game entity" would have a globally unique ID (GUID). Say there are ...
Lance's user avatar
  • 177
1 vote
2 answers
1k views

Managing different types of Actors/Entities in a rendering engine

I'm coding a simple game engine using DirectX11, and I'm stuck on how to implement a kind of ECS. Now my rendering system look like this (sorry if the diagram is not real UML, it's just for ...
Luca's user avatar
  • 143
8 votes
1 answer
4k views

Unity Hybrid ECS with "old way"

Is it possible to use Hybrid ECS with some components and the standard MonoBehaviour with all your old code? I want to know because I already have some game ...
Marc Rasmussen's user avatar
3 votes
1 answer
345 views

Is there a "Least Terrible Method" for sharing Entities over Network?

(Preface: Using C++, Box2D, and built UDP client and server classes that are reasonable efficient for a built-from-scratch game using client-server model.) This question is specifically in regards to ...
Beau B.'s user avatar
  • 139
1 vote
2 answers
1k views

ECS - should everything be a system?

I've just recently started working with LibGDX and Ashley, and I find it to be really useful and I like working with the whole entity/component/system workflow. But I've been starting to layout the ...
Kynian's user avatar
  • 113
3 votes
2 answers
1k views

Using polymorphism in an Entity-Component System without sacrificing data-oriented design

I've been planning out an Entity-Component System in C++. My idea of it is most in line with the one described on this page of the entity systems wiki. To summarize, components are just structs of ...
DragonOfAwesome's user avatar
1 vote
1 answer
598 views

How does Ashley keep systems up-to-date with its entities?

I am currently trying out Ashley and overall learning how an ECS works internally. What I currently don't understand is how Ashley in particular keeps its systems up-to-date by adding or removing ...
ExecutorService's user avatar
1 vote
1 answer
1k views

Packet/Event-Based Entity-Component-System

I know what one of the big commonalities I see in ECS projects is that there is a main game loop that iterates through systems and calls their respective update methods (for example, RenderSystem). ...
Jon Nguyen's user avatar
0 votes
2 answers
1k views

Event-Based Entity-Componenty-System

So, I'm new to ECS. The concept is very interesting in contrast to traditional OOP and heavy inheritance. I'm working on a game right now that is open-sourced, but does not actually have a game loop. ...
Jon Nguyen's user avatar
3 votes
2 answers
925 views

How to get Entitas components from gameObject.getEntityLink()

I'm new to Entitas. I have a DamageSystem that should Physics.Raycast() toward the target and if tag is enemy it should reduce ...
lazarevsky's user avatar
0 votes
1 answer
816 views

Make the components of an ECS polymorphic

I have implemented an entity component sytsem (ECS) in my game engine (SFML and C++ 17). An entity has an array of components. You can get a components by its type e.g.: ...
Adrian Albert Koch's user avatar
0 votes
1 answer
1k views

How does an ECS work for a world subdivided into chunks (example)?

I am trying to use an ECS for my 2d game at the moment. Up until now I had my world subdivided into chunks (as minecraft does) of size 64x64. They are loaded and drawn when they come onto screen. I ...
fubal's user avatar
  • 101

1
2 3 4 5
9