2022 Developer Survey is open! Take survey.

Questions tagged [component-based]

Component-based designs rely on separating the multiple logical attributes of business objects and game objects into small components dedicated only to specific tasks. Whereas game objects are usually modeled to reproduce the attributes and behavior of "real world" objects by aggregating them together and allowing specialized objects to inherit from general ones, component based design relies on composition rather than inheritance.

Filter by
Sorted by
Tagged with
3 votes
2 answers
304 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 ...
user avatar
  • 135
0 votes
0 answers
77 views

Best architecture for describing interaction between spells

Interactions serve as retroactions. I'm currently looking the best way to describe interactions between different abilities. For instance, if we take a fire ability and a water one, a lot of different ...
user avatar
1 vote
1 answer
190 views

What should be an entity/component, and what shouldn't?

I've recently been reading the book Game Programming Patterns by Bob Nystrom, and one chapter I've found a bit hard to grip is the chapter about the Component pattern. In the example he uses (which ...
user avatar
  • 135
0 votes
0 answers
57 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 ...
user avatar
  • 483
5 votes
1 answer
400 views

How to make a component solution in Godot (similar to Unity's)

I want to be able to assign multiple scripts to a single node, and have each script become a component. I know there is an asset in the asset library for a component solution: godot-component-system. ...
user avatar
  • 18.1k
1 vote
1 answer
701 views

Component-based ability system for turn-based rpg

I am trying to make a component-based ability system for my new turn based game that I am working on. I not sure with the architecture and the approach I am following. So here my idea: Every Ability ...
user avatar
  • 13
1 vote
2 answers
960 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....
user avatar
0 votes
0 answers
71 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 ...
user avatar
0 votes
1 answer
56 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 ...
user avatar
0 votes
0 answers
93 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&...
user avatar
0 votes
1 answer
292 views

Two Colliders on the same GameObject for different purposes

I'm somewhat new to Unity and am trying to build a battle system. Right now, I have an attack that checks collisions with enemy objects like this: ...
user avatar
  • 101
1 vote
0 answers
92 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 ...
user avatar
  • 111
2 votes
1 answer
1k 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 ...
user avatar
1 vote
1 answer
394 views

Component Based Spells/Abilities

This has been a bit of a long time coming challenge for me, if you look back at previous questions for Component based spells you are likely to find my old questions, given that they are 1 + 2 years ...
user avatar
0 votes
0 answers
159 views

C++ OpenGL: Object Components

I've been trying to make a barebones engine/game in VS C++ with OpenGL. So far it's worked well, I've managed to render two green triangles on the screen and can accelerate one using WASD input. ...
user avatar
  • 1
0 votes
0 answers
39 views

How would I go about creating dynamic weapons using EC architecture?

I currently have a weapon component that contains common functionality across weapons (mainly guns). ...
user avatar
  • 31
0 votes
0 answers
99 views

Unity Vector3 y and z Components being set 0

So I'm working on an RTS game and I'm trying to set pre-defined positions for units using my own formula. It takes the list of units and makes a position for each one in an array. The array then goes ...
user avatar
  • 27
1 vote
1 answer
181 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 ...
user avatar
  • 59
1 vote
1 answer
161 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, ...
user avatar
1 vote
1 answer
2k views

Unity get component throwing NullReferenceException only in standalone build

I'm having a very frustrating issue with GetComponent(). ...
user avatar
  • 2,729
0 votes
2 answers
1k views

In Unreal Engine 4, how do I get the component's "game object" via C++?

I have an ACharacter instance with a weapons component that inherits from UActorComponentattached to it. I'm currently writing ...
user avatar
  • 209
4 votes
1 answer
2k views

Dealing with more complex entities in an ECS architecture

Preamble: I'm working on a level editor for my engine, which uses an ECS architecture. I have around a dozen component types so far, mostly dealing with graphics, like lighting components, model, and ...
user avatar
  • 993
2 votes
1 answer
431 views

Pass data down to components

In the game I have, I'm using an architecture close to what I've seen of Unity components : Basically, the universe implements the game loop, entities implement and ...
user avatar
2 votes
1 answer
2k 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 ...
user avatar
0 votes
1 answer
197 views

Why even use coroutines in Unity?

I have been thinking about the use of Unity's coroutines recently, and while I've used them in the past, and am already aware of their bad reputation (although I've also seen posts on the unity forums ...
user avatar
  • 131
2 votes
3 answers
193 views

How do you make sure that a component can be applied to very different entities?

I've been reading about the SOLID principle and component-based game development. Lots of these posts explain it but don't really give examples on it. For example, in a hypothetical RPG game, say ...
user avatar
1 vote
2 answers
467 views

Best Practice for Validating Components in Unity/C#?

In my game there's a Unit class, which all soldiers use. Not all soldiers have special abilities which require unique class components (like Stealth class). Special abilities either exist on a unit ...
user avatar
3 votes
1 answer
83 views

How to react properly to component field changes?

Let's say, that we have the following components: Direction, which contains direction the object moves: ...
user avatar
  • 183
0 votes
2 answers
192 views

How to: Duplicating and updating component data in systems

I am new to game development. Coming across the ECS (entity-component system) pattern I generally quite liked the idea. I have implemented the current version of my engine using the OOP style approach....
user avatar
4 votes
2 answers
998 views

Appropriate Cache Friendly Associative Container For An Entity Component System

The intro to this problem is a bit of a long one so my apologies in advance. In short I am asking for suggestion as to what type of collection I should use to store data for a particular part of my ...
user avatar
  • 167
2 votes
1 answer
900 views

Are references between entities in Entitiy Component System allowed?

I've got a player entiy in my game that can pick up weapons when colliding with item entities. The player can hold and use the weapon in their hand (the weapon sprite is rendered relative to the ...
user avatar
0 votes
2 answers
244 views

How to handle component-based objects in a game loop?

I've been writing my own game engine and I was wondering the correct way to handle my game objects. Each game object is different. The only thing they have in common is a set of operations to handle ...
user avatar
  • 105
5 votes
2 answers
6k views

How do components access one another in a component based entity system

---Most of the stuff I am talking about I read here--- I am currently tring to wrap my head around component based systems to make a simple game engine of sorts. I am having a hard time ...
user avatar
0 votes
2 answers
1k views

Should a system be able to render things? (ECS)

I'm currently building an entity component system and I just have one question... Should a system be allowed to render things to the screen? For example, should I make a SpriteComponent that contains ...
user avatar
1 vote
3 answers
1k views

Binding c++ templated functions to lua

I have started using Lua as a scripting language for my game engine. It works perfectly for things like input, audio etc. However, I'm now trying to bind my entity component system functions which ...
user avatar
  • 87
3 votes
2 answers
2k views

Where is 'game logic' implemented in component based design?

I have been trying to get my head around using an entity component system for a game. But I am struggling to understand how I should do 'game-logic'. What I have so far: Components are essentially ...
user avatar
  • 87
0 votes
1 answer
75 views

Guidelines for determining what should be a component?

Background: So I'm developing my first 2d C++ fighting game (for learning purposes) and I have a setup where I have 'components' which are really just data holders with maybe some simple utility ...
user avatar
  • 393
0 votes
1 answer
44 views

How to determine the values of parameters controlling the game objects? [closed]

I am a C# developer and now trying to change to my dream field: Game Development. I am new to Game Development and currently self learning Unity3D. To me Unity is component based tools and we can ...
user avatar
  • 101
4 votes
2 answers
496 views

Where to store contiguous arrays of components?

I've been working on an entity component system and have the trouble of where to define/put the arrays of each component type. Each component type is user defined so I do not know what or how many ...
user avatar
  • 87
1 vote
0 answers
158 views

Communication in an entity-component through public variables or public member functions [closed]

I am currently coding my own ECS to get a deeper understanding of how such an engine works. I am currently putting together systems. I am aware that there is no right answer to my question as there ...
user avatar
2 votes
1 answer
5k views

What is a faster alternative to a GetComponent from a RaycastHit?

I have a basic AI car script which needs to interact with other cars around it. I would like to access variables from the other cars to help one car identify what the other cars are doing so they can ...
user avatar
  • 2,729
2 votes
1 answer
690 views

Component based architecture in TypeScript

I'm doing a game using Phaser with TypeScript. I want to implement a component based architecture for Actors. What I'm trying to achieve is this: ...
user avatar
2 votes
1 answer
1k views

ECS - Components inside components?

Reading up on ECS, I've tried to implement a simple 'game', if you can call it that. Basic concepts : You have planets(entity), they produce gold. (gold is a component inside planet) Planets can ...
user avatar
  • 163
0 votes
1 answer
60 views

Changing the current state of an entity in the middle of an update step or wait for the end?

Let's say that I use a behaviour component that holds a function call to be called every update step assigned to an entity. Inside that function call I'm changing the active state for the entity to ...
user avatar
0 votes
0 answers
112 views

Change entity's size based on health [ECS]

I'm making a kind of entity component system framework and I have a doubt: I have two components 'health_damage', 'physic' (which contains position, weight,...) and 'sprite' (position, dimensions...)....
user avatar
  • 585
6 votes
1 answer
5k views

A more data oriented design approach to Entity Component System game engine

I'm creating my first c++ game engine project (for learning purposes) and in it I've attempted to implement an entity/component system utilizing some data oriented design principles while also not ...
user avatar
  • 393
-1 votes
2 answers
104 views

How to solve this component based events response issue?

I'm working on a new game architecture and I have issues with the handling of events in our component-based approach. We have a component Match. When a match ends, an event Match_end is sent. There ...
user avatar
6 votes
2 answers
4k views

Entity-Component-System data storage design

I'm working on an ECS and I've already read a lot of articles about it. Most of these articles are talking about a simple case (store data contiguously, read it in a single for loop). However the real ...
user avatar
  • 335
2 votes
2 answers
2k views

Component oriented programming for rich RPG world

I've asked this question on several forums but didn't get the proper answer yet. So, in my opinion, it is a really theoritical and deep, but I really can't deal with it by myself. What is my goal? I ...
user avatar
0 votes
1 answer
1k views

Data-oriented design and Component Sytem cross-referencing

Let's assume we're talking about a game (engine) which is written in C++. This is more like a design question but I can't find any suitable description. Component System The Component System says ...
user avatar
  • 335

1
2 3 4 5 6