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 ...
3
votes
1answer
71 views
how to make weapon charge up behavior using composition
I am trying to design different weapon behaviors.
Right now, there are 3 different types of weapon behaviors that i would like to implement.
When not pressing anything, weapon fires at a ...
0
votes
1answer
52 views
How to force a custom component on every GameObject?
I want to have a custom component which will have a drop down. I want this to be applied to ever GameObject in the project, which means every GameObject in the hierarchy and every GameObject prefab. ...
1
vote
1answer
38 views
AI: dealing with movement driving the same inputs as the player
My AI design is pretty simple. I have different entities that can be possessed either by the player or the AI.
Those entities have an "Input" component that holds the states of the actual inputs, like ...
0
votes
1answer
39 views
Central logic in entity-component-architectures
I've build a architecture based on the entity-component-system-idea.
So I got
Components - Just store Data
Systems - Operates isolated on Components
Scripts - Which are just objects from type Script ...
0
votes
0answers
58 views
How to properly process 2 entities in 1 system? If possible, is this recommended?
I'm using Ashley ECS framework, in ECS framework the Component handles only purely data while System handles the processing of the data. Now, I've encountered a problem which I have 2 entities which ...
1
vote
1answer
62 views
Deserializing component array using JSON
I have a collection of serialized components in JSON format:
{
"components": [{
"class": "com.package.component.PositionComponent",
"x": 100,
"y": 100
}, {
"...
0
votes
1answer
94 views
Entity polymorphism and entity attributes
I want to design the entity system of my game in a way such that entities are modular, easily modified without affecting other entities, and finally easy to add new types of entities. So ideally some ...
0
votes
0answers
29 views
Animations and timed events in a UI
I'm making a GUI framework for my game and I want to add animations. For example when a textbox appears, it can fade in and scale up to size. I want to give the framework user the ability to combine ...
3
votes
1answer
97 views
How can I facilitate communication between “attack” and “movement” components?
I'm currently programming in Unreal, but this is more of a component oriented design question.
I'm trying to follow a component driven aproach, and I have currently achieved creating a movement ...
9
votes
2answers
207 views
How can I support component-to-object communication safely and with cache-friendly component storage?
I'm making a game that uses component-based game objects, and I am having a hard time implementing a way for each component to communicate with its game object. Rather than explain everything at once,...
1
vote
0answers
87 views
When NOT to use ECS architecture? [closed]
I'm familiar with the notion of entity-component-system architecture, and its advantages over traditional class trees. That being said, are there scenarios where one wouldn't want to use entity-...
0
votes
1answer
96 views
Component messaging system - using integers vs message objects
I'm currently working on a component based system for my game, and I've decided to use a messaging system to communicate between components. I've read some on the subject and it seems that most people ...
1
vote
1answer
267 views
Updating a multithreaded Entity-Component-System
I am currently trying to implement an (sort-of) Entity-Component-System. I've got the gist of it, that is, how an ECS is supposed to work. So far i have 4 classes in my design (not yet fully ...
0
votes
1answer
30 views
Issue with Button component
When I add a Button component, it looks like this:
Normally, it should look like this:
How can I fix this issue?
4
votes
1answer
286 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
0answers
43 views
Custom Scene Component Do Not Register Children
I have made a class that is derived from USceneComponent which contains 4 references for itself and two UStaticMeshComponents. Simply I am trying to make a tree structure. When I first create actor (...
1
vote
1answer
184 views
Transform components in ECS
Many game engines I've seen which are based on an Entity Component System. It has some kind of a Transform Component as a necessary component attached to all of their entities. While this does seem to ...
1
vote
1answer
140 views
Relation between game systems and components in a component-based architecture?
Based on a question I previously asked here regarding to decoupling input from other components of an entity I developed a small component architecture on top of XNA to understand how everything works ...
3
votes
2answers
112 views
Reusable component design
I'm working on an engine for my game (in C++). I've done the graphics related stuff and I've started working on UI (user interface). When I was working on buttons I've realized that hardcoding every ...
3
votes
1answer
459 views
Should I implement Entity Component System in all my projects?
I'm not here to ask for any specific code implementation, I'm here just to make my ideas clearer. But let me explain the situation:
I have already developed some little and amatorial game projects (...
4
votes
2answers
509 views
Complex system-component dependencies in entity-component system?
I am trying to design a typical (data-oriented) ECS engine. The issue I am struggling with is that my rendering system have to rely on two different sets of entities to actually do rendering.
My ...
0
votes
1answer
89 views
ECS: performance of many systems cycling on entities
I have been working with an ECS for my current game and I noticed that I came up with quite a few systems that go over lists of entities that sometimes overlap, so it's not unlikely that I loop on the ...
0
votes
1answer
144 views
How to make my components only contain raw data?
I'm reading that Components in ECS are just only data and have no logic. I'm trying to follow this and I got that working:
class Sprite : public Component
{
public:
Sprite(const std::string &...
2
votes
2answers
185 views
Low performance from unordered_map when accessing elements in member template function in derived class
I'm trying to implement a component based architecture on a game engine project. Each GameObject has an unordered_map that holds a pointer to Component base class. At this point, I only have one ...
0
votes
0answers
86 views
Avoiding circular referencing using a Finite State Machine in a Component Based Architecture
While answering this question, I realised I had made the same mistake in my own code for a game I am writing using an Entity-Component System. The problem arose when I decided to use a Finite State ...
1
vote
1answer
158 views
Handling multiple input mapped to single in-game controls
I am trying to map multiple input types to single in-game controls using libGDX's InputProcessor and ControllerListener interfaces. Currently, I have created a single InputType interface which is ...
7
votes
2answers
483 views
Create entity from template in component-based engine
For my project I would like to use a component-based entities in C++. My current implementation is split to these parts:
Systems - Contain a map of components of certain class and operate on these. ...
2
votes
1answer
294 views
Communicating with Collision System in ECS
I have read tons of articles and forums threads about ECS but still can't understand how anything in engine should communicate with Collision System. Let's say I have Input System that handle keyboard ...
2
votes
1answer
808 views
Creating a Static function inside my class to handle small housekeeping tasks
I have used Unity 3D for quite some time, and a lot of my game programming experience originates from using UnityEngine.
Writing in XNA, I am setting up a nested list of objects. Each object will be ...
0
votes
1answer
156 views
How to manage a vector of “Component” base class?
I'm trying to implement a component based design for a game i'm making. I decided to write it in c++ but i'm not very good at it. Coming from a java background I encountered a problem when trying to ...
1
vote
1answer
211 views
How can I handle invulnerability in an entity system?
I currently have an entity component system with messaging. The messages are delivered to each subscriber, but each subscriber gets their own copy, basically meaning that altering a message doesn't ...
-1
votes
2answers
3k views
How to enable and disable scripts on a Game Object?
This worked briefly yesterday, I believe I did something to mess this up. All my inputs that I put in are correct; therefor, it must be the code. I want to switch players. While the red cube's script ...
2
votes
2answers
381 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....
4
votes
3answers
229 views
Single Switch Script vs Multiple Scripts
Would it be better to have one script that switches or have multiple scripts with each with their own function?
In example, Lets say I am making a powerup script.
Option 1: Create a single powerup ...
1
vote
1answer
121 views
Unity3D - GameObject as a static function
Newbie Unity3D/C# developer here.
I've tried learning Unity3D during my May/June college vacation and came across a problem:Code 1:
CameraObj returnVoid;
void Start ()
{
returnVoid = GameObject....
1
vote
0answers
206 views
How to architect systems is Enity Component System, in C++ [closed]
When creating an ECS in C++, what are good, simple approaches to architecting the systems.
Should each system be a static function of a dedicated class (is this semantically different than just ...
2
votes
1answer
339 views
Character states in component based entity system
I'm working on a Zelda-like game (github), and I made a component-based entity system.
I've a Scene class which holds a std::vector of SceneObject.
SceneObject is a collection of components
Scene ...
2
votes
2answers
183 views
Unity : callbacks in component based design
I am trying to use component based design in Unity3d v5. If I have 2 separate C# scripts attached to enemy ships like below:
Script1.shipDead() - Remove game object and show explosion animation
...
0
votes
0answers
189 views
Cross component communication -Java
I am making my first simple game engine and decided to go with a ECS (Entity component system) from inspiration from Unity.
I spent quite awhile online trying to figure out how to implement it. I ...
2
votes
1answer
304 views
Client-Server Game Communication (w/ Protobuf, Relevancy and Delta Compression)
So, I have reached another problem while trying to implement my client-server communication. From everything I've read there are three main ways to minimize packet size:
Only send what has changed ...
3
votes
1answer
127 views
Access Entities components via the Entity that holds them, or via a separate System?
Now, I'm implementing a component based game engine and I came to a thought: Which way should I access my components?
Have a list of Entities, which have a list of Components, and access them by ...
1
vote
3answers
541 views
Responsibility of rendering in a component/entity game engine
I am developing a simple component/entity game engine in C# (https://github.com/alexvm/BlueShift) and have a few questions regarding the responsibility of certain items in the engine itself. I have ...
3
votes
3answers
2k views
How do I define a required component on a Unity game object?
I have a script that expected the game object to have a Terrain component.
Is there an attribute I can add (or some other way) which will prevent a designer from adding my script/component/...
2
votes
1answer
1k views
Who Handles Collision in a Component Based Entity System [duplicate]
I kind of stucking at my current plattformer protoype for learning the component based entity system pattern.
I have CollisionComponent and a CollisionSystem. The CollisionSystem checks every frame ...
3
votes
1answer
214 views
Trouble Using Component Base Pattern
I am trying to use a component based pattern on my new project. The last projects I did the old fashioned way. Base class and derive from that until your brain hurts. This time I wanted to do it on a ...
0
votes
2answers
4k views
How to cleanly serialize/de serialize a Dictionary whose values are of a derived class using c# newtonsoft json [closed]
I am working on and entity component system and I am storing entities as a JSON file. Components are stored in an entity as a Dictionary of components. I am using newtonsoft's JSON library.
After ...
2
votes
3answers
138 views
Building a C-E engine in a high level language, how can I integrate optional lower-level components that own overlapping state?
To clarify, by overlapping I do not mean overlapping between said components, but rather, let's say I have:
My entity contains components, and a parent-children system. Call it a mandatory Hierarchy ...
0
votes
2answers
331 views
Handling differing inventory items on use interactions
Hey there my fellow programmers. Looking for a little input into a potentially smelly code problem (I was about to post this on the Code Review SE, let me know if that's the more proper place).
After ...
1
vote
1answer
102 views
How to deal with tags in a component
I have a component called "ReflectOffCollision". This component should obviously not need to be aware of specific details about the game such as tags. The problem is, I want to apply this script to an ...
0
votes
2answers
301 views
Handling player and AI in a component based structure dynamically?
I'm trying to find a way to allow both input and AI to call actions of an actor in a component based structure for a 2d turn based game. The actions make use of the components. To keep the system ...