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.

Gameobject: anything acting in the game (car, gun, Steve).
Entity: a globally unique identifier (string, number) pointing to a set of components that comprise a gameobject.
Component: a blob of data or simply a tag (Position, Velocity, Renderable).
System: implements functionality. Systems operate on components (Renderer, MovementSystem).

See this answer for a through explanation of an Entity System.

401 questions
12
votes
1 answer

Entity Component System - How to implement an object's Transform?

In designing an entity-component system for my engine, I've come across a little snag in the way of storing and retrieving a particular type of component. First, let me set clear up a bit of terminology I'm going to use in this question: I call…
CRefice
  • 221
  • 1
  • 5
7
votes
3 answers

Modeling "singletons" in an Entity-Component System

I'm writing a basic Asteroids implementation as an exercise in learning how to think in entities and components, and most of it is fairly straightforward. But one thing I keep running into is situations where a given system needs a certain…
David Moles
  • 216
  • 1
  • 6
6
votes
2 answers

Functional reactive programming (FRP) in games. Some doubts and thoughts

These days, I'm doing some research on component-based entity systems. I had a first approximation, using a blackboard pattern at the entity level, and with components sharing this blackboard to do communication. Doing this research, I found an…
Notbad
  • 1,095
  • 2
  • 19
  • 31
6
votes
3 answers

Where should complex state logic in an ECS reside?

I've been using ECS for a while, at the moment I'm using my own, but it's pretty standard. Components are data only, Entities pretty much just a Map with some additional metadata and Systems that match combinations of components and contain the…
rje
  • 193
  • 6
5
votes
1 answer

Entity component system - where did attributes and behaviors come from?

I recently spent quite some time understanding and building a component-based system. I got stuck on a few problems and after searching for quite some time ran across this answer which is talking about behaviours and attributes. From what I…
Samaursa
  • 2,089
  • 17
  • 24
4
votes
3 answers

How do I deal with different "types" of entities in Entity-Component-System model?

I have CollisionSystem which basically iterates through the array of PhysicsComponent and checks if there was some collision between two entities. But where should interaction code go? And how should I deal with different types of entities?…
user26550
4
votes
2 answers

Entity systems with mixed responsibilities (eg render + handle input)

I am using an entity system for my hobby game, specifically the Behaviour / Attribute model discussed in Radical Entertainment's Theory and Practice of Game Object Component Architecture presentation. I have read discussions of this model here and…
Ben J
  • 143
  • 3
3
votes
1 answer

How does Component Entity System Manages Game Mode?

I would like to create a simple game fire and shoot game using Component Entity System (CES). This game has two game modes(1): play mode and settings mode. The play mode is the actual game itself whereas the setting mode is where the player updates…
3
votes
1 answer

Variants of Entity Component Systems

I've been reading up on these, and there seem to be two major variations which I'd like to understand better. Entities should contain only data Components, which are processed by systems which contain the logic Entities can contain data and…
user13213
3
votes
1 answer

Design suggestions for my Entity module

I need some advice on how to design the Entity module in my game, how to apply the MVC pattern and generally how the Entity should interact with its controller and its representation. First some details about the game: it's a 2D action-platformer,…
Paul Manta
  • 3,177
  • 3
  • 30
  • 42
3
votes
1 answer

Entity Component System - Physics Animation Matrix Calculation?

The problem is how many times the matrices representing the bones (for animation and rendering) of an entity get calculated. If i have these components: Position Skeleton (holds matrices for bones) Physics Animation When the physics get's updated,…
gyroheli
  • 31
  • 1
1
vote
1 answer

Entity Component System, How to decouple components need for entity as parameter?

I use Artemis entity system framework, C# port. I have problem with figuring out a good way to handle items and using them. Game is AI driven mostly, so it's not the player that is interacting, but AI. AI is basically Entity with AIBehaviorComponent…
Katu
  • 2,101
  • 1
  • 15
  • 19
1
vote
3 answers

How can I utilize external libraries within an entity system?

I'm implementing an entity system for educational purposes. I wanted to focus on the system itself and don't know much about rendering and physics, so I'm using external libraries for those tasks. These libraries come with pre-defined classes for…
K..
  • 205
  • 2
  • 10
1
vote
2 answers

How do I go about creating the "Watcher" component?

Last weekend, I spent several hours writing a basic entity component model, in JavaScript. I was largely referencing the Ash Actionscript game engine. I successfully worked out how the systems, components, nodes, and entities all link up, but one…
1
vote
2 answers

Abstracting the ability to attack using an ECS

As the title suggests, my question is how to abstract the concept of 'attacking' using an ECS (entity component system). The "game" I'm working on is a roguelike in real-time, where all enemies/NPCs/player is an Entity (just an Id) with…
1
2