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
1answer
19 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 ...
2
votes
2answers
1k views

How to manage state in a component-based game engine?

I'm working on a small, data-driven game engine with some friends. We use GameObjects (a.k.a. Entities, Actors, or whatever it is called in your favorite engine) to represent every entity in the game....
1
vote
1answer
28 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 ...
0
votes
1answer
23 views

IConvertGameObjectToEntity interface on Unity ECS

Was working on ECS and following the tutorials by Mike Geig in Unite Copenhagen on YouTube(https://youtu.be/BNMrevfB6Q0), and understood that unity automatically converts transforms, mesh renderers ...
1
vote
1answer
73 views

Unity conversion of Gameobjects to ECS

I have not worked with ECS before, so I was following the tutorial by Unity's Mike Geig on Youtube to convert gameObjects to ECS from Unite Copenhagen, and this code does nothing, and there are no ...
1
vote
1answer
67 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, ...
2
votes
0answers
43 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 ...
0
votes
2answers
896 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 <...
8
votes
1answer
132 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 ...
1
vote
3answers
525 views

Incrementally processing large number of entitites in an entity-component system

LibGDX/Ashley has a class IntervalIteratingSystem that allows you to process all entities in a particular family every X milliseconds. But if you have a lot of entities to process, it might be a bad ...
0
votes
1answer
164 views

LibGDX - Animate Player using Finite State Machine in Ashley ECS

Hi everyone this is my first question on this forum hope you can clarify my doubt. I'm gonna start by saying that im not very good at english so my apologies. So I have a big school project and I'm ...
3
votes
2answers
472 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 ...
0
votes
1answer
71 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 ...
21
votes
5answers
4k 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 ...
8
votes
1answer
2k 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 ...
1
vote
1answer
780 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 ...
48
votes
3answers
15k views

In an Entity-Component-System Engine, How do I deal with groups of dependent entities?

After going over a few game design patterns, I have settle with Entity-Component-System (ES System) for my game engine. I've reading articles (mainly T=Machine) and review some source code and I ...
1
vote
1answer
170 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, ...
32
votes
1answer
6k views

How are entity systems cache-efficient?

Lately, I've been doing a lot of reading on entity systems to implement in my C++/OpenGL game engine. The two key benefits that I constantly hear lauded about entity systems are the easy ...
11
votes
4answers
4k views

Game engine with good Lua entity creation/management [closed]

I'm looking for an engine that constructs it's entities using Lua or other scripting language. This is in order to find inspiration and do it in my own engine as well. I know that CryEngine does use ...
1
vote
1answer
500 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 ...
2
votes
2answers
469 views

Should I wrap a template function with another template function, or…?

I'm currently making an Entity System, using C++, and I've questioned myself about how I should interface some methods. Specifically in my Entity and ComponentManager classes. The ComponentManager, ...
0
votes
3answers
283 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 ...
4
votes
2answers
557 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-...
0
votes
0answers
57 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 ...
0
votes
2answers
393 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. ...
0
votes
2answers
514 views

Implementations for storing entities in an ECS system

I'm restructuring my model of entities, components and systems, where entities are: ...
0
votes
1answer
1k 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 ...
1
vote
0answers
508 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 ...
0
votes
2answers
145 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 ...
1
vote
1answer
359 views

Drawing Sprites with Artemis

I am trying to trace the StarWarrior code (the Artemis tutorial). I cannot figure out how these sprites are being drawn. This is the code where the player's ship ...
0
votes
1answer
251 views

Game engine tool generating game entities

I'm writing a game engine with an editor that allows you to create individual components like sprites, fonts, and particles. Then you're able to combine these individual components into what I call an ...
1
vote
1answer
169 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 ...
1
vote
2answers
282 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 ...
3
votes
1answer
239 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 ...
2
votes
2answers
1k views

Is component-based design an architectural pattern or design pattern?

When using the component-based paradigm in game development with engines like Unity, is component-based design an architectural pattern, or a design pattern? Can I even say that component-based ...
4
votes
2answers
3k views

Entity Component System, weapon

I'm new to game programming and currently trying to understand Entity Component System design by implementing simple 2d game. By ECS I mean design, described here for example In my game I have ...
1
vote
2answers
354 views

Getting Components to their respective System in Entity-Component Engine

I asked this question in stackoverflow, but I didn't get any responses. I think it's better suited in this exchange. I'm building a game engine of sorts (purely educational) and am not sure the best ...
0
votes
1answer
443 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 ...
2
votes
2answers
429 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 ...
2
votes
1answer
180 views

Timestamps as ids in an entity manager?

I've built my own entity manager, as I found out some days ago, it is very similar to the Artemis framework. For now, I just use integers as entity ids. Behind the scenes, there is a simple integer ...
5
votes
1answer
1k views

Box2D Joints in entity components system

I search a way to have Box2D joints in an entity component system, here is what i found : 1) Having the joints in Box2D/Body component as parameters, we have a joint array with an ID by joint and ...
1
vote
2answers
626 views

Implementation details of Command Pattern in conjunction with Entity Component System

I have implemented an ECS where more or less an Entity is just an ID, a Component is just a wrapper for data, and a System holds the logic on operating over different components. There is an Engine ...
8
votes
2answers
3k views

ECS: AI components and systems

I'm trying to find the best design pattern for my AI code using an ECS. Right now the entities that act as CPU-controlled have components like: WeaponComponent ChargeComponent MovementComponent ...
1
vote
1answer
242 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 ...
1
vote
1answer
317 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). ...
1
vote
0answers
89 views

Clarifications On the Entity-Component-System [closed]

After searching through numerous sites on the Entity-Component-System, which is quite a lot to grasp since all my college career we've been taught variants of OOP (also that ECS isn't taught in any ...
0
votes
1answer
1k views

Integrating Unity physics with Entitas

I've used Entitas a bit and it appeared to me as a great way of creating clean, modular code. I've seen few examples of games created with this framework, and most of them were puzzles, TD's, simple ...
1
vote
2answers
910 views

Should entities auto-register to systems based on their component signature?

I see all the upside in entities registering automatically for basic components. If an entity has a Renderable component, it should be registered to a list that's used by a Renderable System. If an ...
0
votes
1answer
334 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.: ...