Questions tagged [entity-component-system]

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

Filter by
Sorted by
Tagged with
1
vote
1answer
68 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 ...
2
votes
1answer
45 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
0answers
47 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 ...
0
votes
0answers
21 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 ...
0
votes
2answers
78 views

Designing persistence in an ECS world subdivided into chunks

I'm designing a kind of simple open world with ECS. The whole world is too large to be loaded at once, so I load and unload chunks according to player's position. Nothing fancy, pretty much standard ...
1
vote
1answer
79 views

Should state and behavior be combined for Buffs? Cannot decide between data-driven and OOP approach

I'm writing a 2D roguelike that uses an Entity Component System and I'm having trouble deciding between the traditional OOP approach versus a data-driven approach to implementing buffs and debuffs. ...
2
votes
1answer
89 views

Is it better design to store event effects within an Entity itself, or within a system?

I'm developing a 2D roguelike with an Entity Component System (ECS) and I've been struggling with this question a lot the past week. For example, let's say you have various effects that occur when an ...
0
votes
0answers
87 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 ...
1
vote
1answer
51 views

Instantiated entities don't collide with each other

I've started to learn DOTS some day ago, and decided to create a simple project. When I added some simple physics to the game I faced the problem. I added one object on the scene and another ...
0
votes
1answer
120 views

ecs network synchronization

I'm working on implementing combat into my isometric RPG game which uses an ECS architecture. When synchronizing the actions of the different clients, is it preferable to serialize and synchronize raw ...
0
votes
2answers
281 views

What data structure do I use to store Archetypes in ECS?

I am implementing an ECS with "archetypes" similar to how they are defined in Unity: A unique combination of component types is called an Archetype. For example, a 3D object might have a ...
1
vote
1answer
97 views

Unity ECS: How do I stop an entity from spawning twice?

I am implementing a flight dynamics model using Unity's built-in ECS package, Entities, and I keep running into one particular issue where the aircraft I'm trying to spawn gets converted into an ...
1
vote
1answer
97 views

Unity ECS: Is it bad to use variable data within SystemBase?

I'm currently trying to port a flight dynamics model that I've implemented in Rust to Unity. The original FDM utilized the Hecs ECS, and I plan on implementing this same model in Unity using the ECS ...
0
votes
2answers
172 views

Is there a good way ECS for creating variants of a behaviour like in Java interfaces?

In Java, there are interfaces - I'm not clear on the details (I don't use Java) but from what I've learned, they seem to be "classes for classes": a way to effectively make individual ...
2
votes
2answers
244 views

Is it a good idea to use a hash table in an ECS?

I've had an idea for optimising my ECS engine. Instead of storing components in an array, store components in a hash table as <id> => <component>. ...
4
votes
3answers
2k views

Is an ECS viable in garbage collected languages?

I've done some research on Entity Component System architectures. Right now I have a convoluted OOP implementation which I'm planning on rewriting, so I was considering switching to a different ...
1
vote
1answer
131 views

ECS - Stats, damage-types & damage calculation

Prologue Im quite new to data oriented programming and my goal is to implement a runescape stats & damage mechanic. This is quite a pretty complex topic : [Runescape-Mechanics][1] and i havent found ...
0
votes
1answer
90 views

Combining a pure ECS with a FSM scheduling system

Currently I am evaluating how to refactor my core game logic since I tried to design most of it in pure ECS but isn't really completely feasible the way I intended it. My game at its core is a turn-...
0
votes
2answers
76 views

ECS multiple materials per mesh (sub-mesh)

In my toy engine I currently have a MeshComponent and a MaterialComponent. psuedo: ...
0
votes
1answer
216 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...
0
votes
1answer
62 views

How to decide whether a Buff should be a component or a Buff object in an ECS?

I'm developing a top-down 2D game in Javascript using an Entity-Component-System architecture and I'm struggling with the question of exactly how to implement temporary buffs / permanent passives. For ...
3
votes
1answer
650 views

How to detect collisions in Unity ECS?

I am creating a game using the new Data-Oriented Tech Stack (DOTS). I am using Entities with the PhysicsShape and PhysicsBody authoring components of the new Physics package. Some of my PhysicsShape ...
0
votes
0answers
52 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 ...
2
votes
1answer
137 views

Question on parallelizing ECS Systems

Learning & Implementing an ECS system for my game, I'm wondering how I am supposed to parallelize the systems on multiple threads. Different systems can't run at the same time (unless they operate ...
0
votes
0answers
48 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 ...
0
votes
1answer
412 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....
0
votes
0answers
28 views

An ECS rendering system [duplicate]

I'm planning to implement an ecs system for my game but i have foreseen a problem. How will a rendering system be able to render entities in the correct order based on their depth component? What ...
0
votes
0answers
109 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 ...
1
vote
0answers
56 views

How can I implement better system for ECS?

How can I implement better system/viewer for every entity that has components I specify in, let's say, a variadic template? I've tried to do it myself. What I started with: ...
0
votes
0answers
218 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 ...
1
vote
2answers
289 views

is unity DOTS mature enough to build a whole project on it? [closed]

maybe you assume this question opinion based but its not. please read the whole question. the question has 2 aspects. are all features implemented? just better say, can i do everything or any ...
0
votes
2answers
155 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 ...
0
votes
0answers
125 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 ...
1
vote
0answers
76 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 ...
0
votes
0answers
23 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 ...
2
votes
1answer
536 views

Component instance reference in Unreal Engine 4

I'm creating a C++ script and I want to get a reference to a component instance. For example, imagine that I want to get the player camera, which is a ...
1
vote
1answer
319 views

Entity component system: how and where store pointers to system resources or third-party lib's objects?

I'm migrating my game pet-project to ECS. I use C# (custom-made engine, not Unity). It goes pretty well, but one big thing is making me worry. This is how and where to store pointers to system ...
0
votes
0answers
123 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 ...
0
votes
1answer
282 views

ECS: Movement system

I'm a game developer enthusiast. I've decided to implement a game, however I'm pretty confused about all the movement mechanics (kinematics). Here goes a couple questions: Velocity x acceleration x ...
2
votes
0answers
306 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 (...
1
vote
1answer
79 views

Is it useful to distinguish between two different kinds of events?

i have thought about this for a long time and i think i just going in circles. I need someone to tell me if im just simply overthinking it. So, first of all im coming from a 'classical' ECS approach: ...
0
votes
0answers
71 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?...
1
vote
2answers
237 views

ECS - Lantern implementation / How does the RenderSystem determine which one to choose? Entity-Datastructure

I want to implement ECS in my game. The more I read the more insecure I get. The current available Components for a Entity processed by the RenderSystem are: RenderComponent (mesh, texture, ...
0
votes
1answer
569 views

Handling input from an ECS input system into actions in another system/actions on a entity?

Some background on my engine, each system stores a reference to an entity which has the relevant components for that system. For example movement system has only entities which possess position ...
0
votes
1answer
237 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-...
0
votes
2answers
430 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 ...
0
votes
1answer
50 views

How to do you separate or do you separate a Player/Non Player movement, action, behavior states in one or more component?

Assume we are using Finite State Machine, what is the best way to organize states? Given I have current StateComponent, all states are here. ...
0
votes
0answers
36 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 ...
1
vote
1answer
665 views

Using EntityManager from inside a system

I am using Entities v0.8 I am trying to build a Spawner, and this is the system ...
1
vote
1answer
734 views

ECS as part of the rendering pipeline of an engine

I'm trying to integrate ECS design into my game engine. Currently I'm trying to mimic the components of unity (although not pure ECS) with MeshFilter (holds ...