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 ...

learn more… | top users | synonyms

0
votes
0answers
7 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 ...
0
votes
0answers
49 views

what makes good component base code in unity engine? [closed]

I have read a little on it, but still don't think I can appreciate what makes for good, maintainable component based code. Please suggest some principles to consider? As is, I really dislike the code ...
0
votes
1answer
51 views

Right place for Entity logic

In terms of Component Entity System, where should I put an entity logic that should be processed on each animation frame? Say, I wish some logic like "when x-position is more than .. start rotation ...
0
votes
1answer
62 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
59 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
91 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 ...
2
votes
1answer
172 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
216 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
46 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
108 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
91 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 ...
1
vote
0answers
82 views

Are there any popular games using a component entity system? [closed]

I've been looking around, and it seems that almost everyone agrees that entity component systems are better for game development than, say, MVC. However, I couldn't find any successful games that ...
0
votes
0answers
53 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 ...
0
votes
1answer
67 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
260 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
164 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
735 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
122 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
173 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
493 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
273 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 ...
4
votes
3answers
201 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
85 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 = ...
1
vote
0answers
196 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
244 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
1answer
118 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
152 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
232 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
123 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
402 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
1k 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 ...
2
votes
1answer
653 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
208 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
2k 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
135 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
206 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
93 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
268 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 ...
0
votes
2answers
117 views

Gameobject-Component model with many background tiles - long iteration time

So I'm making a game engine for a game I'm making - the game is a 2D tile-based game I've implemented a gameobject-component style for the engine, for decoupling reasons However, every frame, the ...
2
votes
2answers
526 views

Entity Component System Coupling

Lately I've been working on a small personal project which is basically an Entity Component System framework with autoupdated Systems. While I have a pretty good idea on the way the framework should ...
1
vote
1answer
123 views

How can I resolve component types in a way that supports adding new types relatively easily?

I am trying to build an Entity Component System for an interactive application developed using C++ and OpenGL. My question is quite simple. In my GameObject class I have a collection of Components. I ...
2
votes
4answers
820 views

Executing Components in an Entity Component System

Ok so I am just starting to grasp the whole ECS paradigm right now and I need clarification on a few things. For the record, I am trying to develop a game using C++ and OpenGL and I'm relatively new ...
3
votes
2answers
488 views

Implementig State-driven agents in an Entity-Component-System

A state-driven agent is an agent that performs an action based on its current state. The logic can be implemented through the use of a D-FSM that changes state depending on the Agent's "perception" ...
1
vote
2answers
816 views

How can I correctly use an unordered_multimap as entity and component storage?

The Setup I've made a few games (more like animations) using the Object Oriented method with base classes for objects that extend them, and objects that extend those, and found I couldn't wrap my ...
0
votes
2answers
200 views

Data oriented design vs visibility

I'm almost sold on the concept of a data oriented engine -- however, one thing still eludes me. If we pack the data from a large level into huge arrays and go over them, any visibility system that we ...
2
votes
1answer
211 views

How should an object that uses composition set its composed components?

After struggling with various problems and reading up on component-based systems and reading Bob Nystrom's excellent book "Game Programming Patterns" and in particular the chapter on Components I ...
2
votes
2answers
322 views

What are the advantages of having component logic in a “system” versus the component itself?

For the past few days I've been trying to make my first game. I did some research on usual development practices and patterns and I settled on a composition system where the different components ...
0
votes
1answer
175 views

Adding Components (classes) to unordered_map in Entity? (Possible typeid as key issue)

I've got a little test put together that has a couple simple Components that are supposed to be added to an Entity, but the addComponent function isn't working; I think it's got something to do with ...
0
votes
2answers
578 views

Component based architecture: “pure” or some inheritance?

(I asked a similar question, but it had more questions inside it and I feel it wasn't clear enough, so I'm opening a new one). Until recently I implemented all my games using an inheritance ...
2
votes
1answer
235 views

Viewing one of multiple worlds in a component entity system?

I've been working on a space simulation game. The player can control a ship and fly through wormholes to get from one solar system to another. I would like the player to be able to switch the camera ...