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

2
votes
1answer
621 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 ...
7
votes
2answers
5k views

Tips for Component Based Entity System message handling

I'm trying to implement a component-based entity system but am a bit confused on how I should handle the messaging. There are two problems I'd like to resolve so I can test the system. Below is the ...
18
votes
4answers
4k views

How to implement behavior in a component-based game architecture?

I am starting to implement player and enemy AI in a game, but I am confused about how to best implement this in a component-based game architecture. Say I have a following player character that can ...
0
votes
1answer
70 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 ...
0
votes
1answer
135 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
68 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
175 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
153 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
56 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
179 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
176 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
100 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
115 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
175 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
115 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
2answers
583 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 ...
3
votes
2answers
374 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" ...
2
votes
4answers
646 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 ...
1
vote
3answers
315 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 ...
1
vote
1answer
88 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 ...
1
vote
1answer
439 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 ...
2
votes
3answers
565 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 ...
0
votes
0answers
77 views

How do you use Lua with several game objects / components?

I haven't found a lot of information / tutorials on this subject, so I figured I'd ask here. I would like to use Lua-Alchemy (the Flash port of Lua) to be able to load scripts and run console-like ...
3
votes
1answer
193 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
1k 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 ...
0
votes
2answers
144 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 ...
2
votes
3answers
125 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 ...
6
votes
3answers
794 views

Entity Component System for HUD and GUI

This is a very rough sketch of how I currently have things designed. It should, at least, give an idea of how my ECS is currently designed. If you notice in that diagram, I have basically split ...
0
votes
2answers
247 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 ...
3
votes
5answers
2k views

How should IDs be assigned in an entity component system?

I haven't actually implemented this system yet. I'm trying to work through the major conceptual hurdles before I actually start writing code, and the proper way to generate IDs is a little confusing ...
0
votes
2answers
104 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
452 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
116 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 ...
0
votes
2answers
169 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
197 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
7answers
1k views

is ECS a kind of (or vs) OOP? [closed]

Is Entity Component System (ECS) considered a part of OOP or is it a completely different concept?
2
votes
2answers
310 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
138 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
424 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 ...
9
votes
2answers
1k views

Entity/Component System and UI “Entities”

I'm still green to entity/component systems. I find that since I have useful components for drawing sprites (or spritesheets) and handling input (mouse/touch clicks), I naturally want to reuse these ...
2
votes
1answer
217 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 ...
5
votes
2answers
2k views

Component based game engine and dependencies - singletons [closed]

I am thinking about how to create component based game engine. I understand that all things should be very similar as in Data Oriented Design (each object is a collection of various structures as ...
1
vote
1answer
101 views

Passing a list of existing entities to a new client when using a component system?

My game server uses entities containing components to represent everything in the game world. This has worked great so far but I've run into a problem now that I'm allowing clients to connect to the ...
5
votes
5answers
1k views

How can I efficiently implement a bitmask larger than 64-bits for component existence checks?

In my ECS implementation, I use bit-wise operations (as described and illustrated in this thread) to tell an entity what type of components it currently consists of. So my Entity class has the ...
8
votes
3answers
2k views

How to avoid “Blob-Systems” in an entity component system?

Currently I am facing the following problem: I am trying to write a pong clone by using an entity component system (ECS). I wrote the "framework" all by myself. So there is a class which manages ...
5
votes
2answers
387 views

How to model interentity membership in entity-component architecture?

I'm falling in love with simple grace of entity-component design, although I still have issues breaking from MVC and OOP practices. Some of my game entities have membership relationships with each ...
1
vote
2answers
1k views

Entity Component System, weapon

I'm new to game programming and currently trying to understand Entity Component System design by implementing simple 2d game. By ECS I mean design, described here for example In my game I have ...
1
vote
1answer
195 views

Where to put my entity component messaging functionality?

I've done my research and read as many articles and posts on messaging and ECS's as I could find to help me get mine working. However, I'm at a roadblock on how to get my messag functionality to be ...
6
votes
2answers
433 views

Why are entities in a component system composed at run time?

Why are entity component systems the way they are? For example as far as I have seen it may look like this class Entity list of components add component remove component update ...
5
votes
1answer
902 views

Structuring server-side networking with entity-component systems

I've been working on an online game, and recently have been working on converting the base of the game to use the Artemis Entity System Framework. I'm having a bit of difficulty conceptualizing ...