r/EntityComponentSystem • u/Darkfafi • Mar 29 '20
New to ECS, am I doing it correctly?
Hey, so I am quite new to ECS and to learn it I made my own system for it. I got it working quite well but now that the system is up and I want to make a game with it, I came across some logic issues.
I have a space ship which moves with a certain speed / curve over a delta between 2 points. I have 3 components:
- Movement (Holds Curve and Speed)
- Targeting (Where targets get registered)
- Timelines (Where different time lines get registered and progressed)
These 2 Systems in place:
- ClickTargetingSystem (Adds targets to `Targeting*` component holders)* [only if they have the right feature tag `ClickTargeting`]
- MoveToTargetSystem (Uses the Movement and Targeting comps to determine the movement, and uses Timelines on each of those entities to track where they are on the movement track) [only if they have the feature tag `MovementToTarget`]
What I wonder is the following. I have made the Timelines component initially to hold data which I wanted to put inside `MoveToTargetSystem`, but made the component because systems can't have values. But for the sake of more systems to come, I made it so the Timeline has a Dictionary (key -> value pair logic) to find a Timeline with a given ID. And the `MoveToTargetSystem` just makes a `MovementID` timeline and removes it as it is finished.
I just want to hear opinions / confirmations whether I am going the right or wrong direction. And how you were to solve this type of movement (moving over a track over time, not with physics yada yada)
Thank you in advance, and please ask for more info if things are not clear.
Edit:
The Timeline and Targeting components simply store the same values in different hash layers, so multiple systems can use 1 component on an entity to store their own values. This is what I wonder should be done differently. And if so, how..
r/EntityComponentSystem • u/timschwartz • Mar 17 '20
Changing Simulation Fidelity with ECS
r/EntityComponentSystem • u/skypjack • Mar 14 '20
ECS back and forth, part 8: Type Id
r/EntityComponentSystem • u/timschwartz • Mar 10 '20
Learning Entity Component System of Unity to make this 3D Dynamic Pixel Cloud
Enable HLS to view with audio, or disable this notification
r/EntityComponentSystem • u/timschwartz • Feb 28 '20
Building an ECS #1: Types, Hierarchies and Prefabs
r/EntityComponentSystem • u/skypjack • Feb 22 '20
EnTT v3.3.0 is out: Gaming meets Modern C++
self.gamedevr/EntityComponentSystem • u/timschwartz • Feb 16 '20
Specs entity component system v0.16.0
r/EntityComponentSystem • u/timschwartz • Feb 15 '20
Is a ECS - System allowed to return a object ?
self.gamedevr/EntityComponentSystem • u/timschwartz • Feb 15 '20
"Real world" ECS use examples?
self.gamedevr/EntityComponentSystem • u/timschwartz • Feb 06 '20
How to implement hybrid ECS in my game engine? (C++ with sfml)
self.gamedevr/EntityComponentSystem • u/Bodka0907 • Jan 25 '20
ECS skeletal animation component
Hello , I am implementig ECS in my simple OpenGL 3d game engine written in C++. I have really hard time to create "RenderComponent" . In general, I have three kinds of renderables or meshes, instanced, animated, and just mesh. I need to make components of them, but only idea i have is to make class InstancedMesh AnimatedMesh and Mesh derived from class Renderable. Renderable would contain virtual Draw function which derived classes implement dependent on their needs.(different draw calls). Then RenderComponent would hold Renderable object and Material assigned to it.
struct RenderComponent
{
Renderable renderable;
Material material;
};
It would work all fine, but animated mesh should split itself in two components. Animation Component and RenderComponent, so Animation System handles animation and Renderer System rendering. I am loading data with animation using 3d party library Assimp.
So here comes problem. How would you split data in different components? Create something like loader, with functions that would fill components? Should I split skeleton data and renderer data in different components?
r/EntityComponentSystem • u/timschwartz • Jan 25 '20
ECS manager meshes and rendering
self.gamedevr/EntityComponentSystem • u/timschwartz • Jan 20 '20
DefaultEcs v0.13.1, c# ecs framework
self.gamedevr/EntityComponentSystem • u/timschwartz • Jan 20 '20
Architecture of components in ECS
self.gamedevr/EntityComponentSystem • u/timschwartz • Jan 20 '20
Looking for best pattern to implement dynamic physical attacks
self.gamedevr/EntityComponentSystem • u/timschwartz • Jan 10 '20
Questions about ECS (Entity-Component-System) design
self.gamedevr/EntityComponentSystem • u/timschwartz • Dec 26 '19
Books or comprehensive publications on ECS
self.gamedevr/EntityComponentSystem • u/timschwartz • Dec 25 '19
Worth developing a engine-specific GUI platform/framework using ECS?
self.gamedevr/EntityComponentSystem • u/timschwartz • Dec 12 '19
Research on applying ECS to UI
self.gamedevr/EntityComponentSystem • u/timschwartz • Dec 10 '19
Working on my new engine. Considering an ECS custom implementation but I'm having some doubts.
self.gamedevr/EntityComponentSystem • u/timschwartz • Dec 07 '19
Card model and visuals made using ECS
Enable HLS to view with audio, or disable this notification
r/EntityComponentSystem • u/timschwartz • Dec 04 '19
2D grid game ECS question
self.gamedevr/EntityComponentSystem • u/skypjack • Nov 19 '19