Skip to main content

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
2 votes
1 answer
125 views

In my turn-based game, I have decided to make a separate layer of non-visual objects (everything is precalculated in my game and all of the visual effects are pushed to the animation queue). these non-...
Black Dice's user avatar
1 vote
2 answers
1k views

My problems with OOP: For a while now, I have been attempting to make full games on Godot, but I keep running into issues around poor organization and planning with my classes and OOP architecture. ...
Brigham Peterson's user avatar
1 vote
2 answers
263 views

I've been learning C++ and SDL2 and I'm trying to improve at using composition and for the longest time I thought it was only useful for making things like players, enemies, coins, etc, and I think ...
Konjointed's user avatar
12 votes
3 answers
5k views

How? I think I still don't properly understand how composition in Godot works. So, as far as I know, you 'compose' stuff in Godot, right? Like, if you want to make a rock you create a mesh node with ...
YoshGJ's user avatar
  • 535
0 votes
2 answers
972 views

I am new to game development and I am learning Unreal Engine right now. When a player character APlayer wants to interact with other actors (such as ...
D G's user avatar
  • 103
2 votes
1 answer
808 views

I am working on my first Tower Defense game and I got stuck with architecture. I found some past Q&A "Should the entity handle his own movement?", read about Entity Component approach, ...
Taras Fityo's user avatar
3 votes
2 answers
1k views

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 ...
JensB's user avatar
  • 157
0 votes
0 answers
135 views

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 ...
Joe Mom's user avatar
2 votes
1 answer
2k views

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 ...
JensB's user avatar
  • 157
0 votes
0 answers
191 views

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 ...
genaray's user avatar
  • 517
1 vote
1 answer
3k views

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 ...
Powski's user avatar
  • 13
2 votes
2 answers
4k views

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....
Floating Sunfish's user avatar
0 votes
0 answers
180 views

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 ...
Ryan Peschel's user avatar
0 votes
1 answer
143 views

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 ...
Ryan Peschel's user avatar
0 votes
1 answer
571 views

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&...
Ryan Peschel's user avatar
0 votes
1 answer
1k views

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: ...
G_hi3's user avatar
  • 111
1 vote
0 answers
128 views

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 ...
barak1412's user avatar
  • 111
2 votes
2 answers
3k views

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 ...
Daniel Marques's user avatar
1 vote
1 answer
731 views

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 ...
Pheonix2105's user avatar
0 votes
0 answers
294 views

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. ...
Dan's user avatar
  • 1
0 votes
0 answers
79 views

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

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 ...
Kiyo's user avatar
  • 27
1 vote
1 answer
339 views

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 ...
Sarah's user avatar
  • 59
1 vote
1 answer
224 views

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, ...
Hypergardens's user avatar
1 vote
1 answer
4k views

I'm having a very frustrating issue with GetComponent(). ...
mr-matt's user avatar
  • 2,779
0 votes
2 answers
2k views

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

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 ...
Yattabyte's user avatar
  • 1,043
2 votes
1 answer
651 views

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
3 votes
1 answer
3k views

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 ...
Alejandro's user avatar
0 votes
1 answer
402 views

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 ...
ZombieTfk's user avatar
  • 131
2 votes
3 answers
241 views

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 ...
Microseconds's user avatar
1 vote
2 answers
704 views

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
158 views

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

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....
Adrian Albert Koch's user avatar
4 votes
2 answers
2k views

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 ...
Ryoku's user avatar
  • 187
2 votes
1 answer
1k views

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 ...
EchtFettigerKeks's user avatar
0 votes
2 answers
432 views

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 ...
renno's user avatar
  • 115
5 votes
2 answers
9k views

---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 understanding ...
MoustacheSpy's user avatar
0 votes
2 answers
2k views

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
2k views

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 ...
TomShar's user avatar
  • 97
3 votes
2 answers
2k views

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 ...
TomShar's user avatar
  • 97
0 votes
1 answer
121 views

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 ...
Jason's user avatar
  • 423
0 votes
1 answer
75 views

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 ...
shole's user avatar
  • 101
5 votes
2 answers
693 views

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 ...
TomShar's user avatar
  • 97
1 vote
0 answers
204 views

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 ...
Martin Sand's user avatar
2 votes
1 answer
6k views

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 ...
mr-matt's user avatar
  • 2,779
2 votes
1 answer
801 views

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: ...
Guilherme Recchi Cardozo's user avatar
2 votes
1 answer
2k views

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 ...
Patrick's user avatar
  • 163
0 votes
1 answer
90 views

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 ...
FrameBuffer's user avatar
0 votes
0 answers
149 views

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...)....
Liuka's user avatar
  • 595

1
2 3 4 5 6