Questions tagged [entity-system]

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

26 questions
322
votes
8 answers

Component based game engine design

I have been looking at game engine design (specifically focused on 2d game engines, but also applicable to 3d games), and am interested in some information on how to go about it. I have heard that many engines are moving to a component based design…
a_m0d
  • 12,034
  • 15
  • 57
  • 79
21
votes
4 answers

Communication in component-based game engine

For a 2D game I'm making (for Android) I'm using a component-based system where a GameObject holds several GameComponent objects. GameComponents can be things such as input components, rendering components, bullet emitting components, and so on.…
Firas Assaad
  • 25,006
  • 16
  • 61
  • 78
12
votes
5 answers

Handling entities in a game

As a small exercise I am trying to write a very small, simple game engine that just handles entities (moving, basic AI etc.) As such, I am trying to think about how a game handles the updates for all of the entities, and I am getting a little bit…
Lucas
  • 10,476
  • 7
  • 39
  • 40
6
votes
1 answer

ECS / CES shared and dependent components and cache locality

I have been trying to wrap my head around how ECS works when there are components which are shared or dependent. I've read numerous articles on ECS and can't seem to find a definitive answer to this. Assume the following scenario: I have an entity…
Driv
  • 123
  • 8
5
votes
1 answer

Is there a language made specifically for Entity Component programming?

I know there are languages for functional programming (LISP, Haskell, etc.) and OOP programming (Java, C#, Ruby, Python, many more), but are there any that are made around the concept of Entity Component Programming?
benbot
  • 1,217
  • 1
  • 12
  • 28
4
votes
3 answers

Entity Component System Framework that is CPU cache friendly

I can not find a single framework implementation that is CPU cache friendly, which means that data on which systems traverse in each game loop cycle is stored in a contiguous memory. Let's see, systems traverse on specific entities that satisfy…
Narek
  • 38,779
  • 79
  • 233
  • 389
3
votes
1 answer

ECS with Go - circular imports

I'm exploring both Go and Entity-Component-Systems. I understand how ECS works, and I'm trying to replicate what seems to be the go-to document of ECS, namely http://cowboyprogramming.com/2007/01/05/evolve-your-heirachy/ For performance, the…
Andreas
3
votes
2 answers

How to use entity systems with Box2D?

The approach of developing games with Entity Systems is very clear. You have components, you add them to entities. Depending what kind of component you have different systems start to process the state of each entity. For example you add Position…
Narek
  • 38,779
  • 79
  • 233
  • 389
3
votes
1 answer

How to use entity component system for game design with stage, group and actor in libgdx for a whole system?

Entity component system is able to solve problems of scale which can come during OO programming in game development. I have few queries regarding ECS: To give an overview: There are entities which include some components (having data) and systems…
3
votes
1 answer

Composite, component and entities in C++ game engine

I'm working on a school project developing a game. We use an engine made by one of the teams we have. The build-up of the engine is unclear to me and seems an anti-pattern. However, it seems that no one can make the design choices clear to me. The…
3
votes
1 answer

Entity System in C++

I've recently discover the Entity System architecture and i've got some difficulties to do it in C++ / understand implementation. How i see Entity System : Components : A class with attributs, set and get. Sprite Physicbody SpaceShip ... System :…
Dono
  • 522
  • 7
  • 11
2
votes
3 answers

Component-based game entities and type checking

I'm writing a game and it's going to use a component-based entity system. The first two components that I'm implementing are EntityRepresentation and EntityState. The representation holds the animations, and the state decides how the entity should…
Paul Manta
  • 30,618
  • 31
  • 128
  • 208
2
votes
3 answers

Interleaving systems in ECS (entity component system)?

I'm working on adding physics to an Entity System and am confused about the systems part of ECS. For example, in a non-ECS project I might have something like this: function updatePhysics() foreach(thisRobot in robots) thisRobot.move() …
zorqy
  • 103
  • 7
2
votes
1 answer

Entity Component System: Where to put rendering logic

I'm currently learning about "Entity Component System". After reading many tutorials and forum threads I still wonder where rendering logic has to go. I am not talking about actual OpenGL/DirectX-Rendering code that, for example, takes a sprite and…
QnD
  • 79
  • 1
  • 5
1
vote
1 answer

reduce Duck-typing disadvantage in entity-component-system

How to reduce Duck-typing phenomenon in entity-component-system? Example Here is a coliru demo. There are 2 systems in my ECS :- System_Projectile : manage all projectile and bullet aspect. System_Physic : manage physic's component. There are 2…
javaLover
  • 6,347
  • 2
  • 22
  • 67
1
2