entitycomponentsystem's People
entitycomponentsystem's Issues
Keys should be extensible to beyond 64 bits, and should be encapsulated into their own class
Keys currently are simply uint64_t's at the moment, and could benefit from being template classes based on the size of the key needed that can interopt with one another despite size template, ie 128bit key and 64 bit key. Such a class would also promote the dependency inversion principle, which is not emphasized in the current state of key.
Add assert statements for verifying key fit and other simple assertions of truth
currently assertions are not used, and may be helpful in future debugging attempts, keys should be verified via asserts.
Entity ID needs to be implemented
Entities need to be assigned IDs based on global static number for the last ID available. There are two ways this could be done
Even if you end up using the same memory as an old entity once the global pool is created, you should still be assigned a new ID based on the static last used global ID, to ease debugging of entity creation.
Or reuse ID, in which case it may not be useful to have since the ID correlates to the index of the entity 1 to 1.
AI nodes need to be added for moving entities that don't rely on input stream.
Currently only the player entity (which moves via input stream) and static prop entities are used. it would be useful to show case basic autonomous activity via random movements that don't exceed map dimensions and one that simply attempts to find the player every so often/avoids obsticals via A*.
Create Automatic Component deletion system
Components will need to be handled in the event that New gets called to create them. A global list of components (possibly a singleton for the class as a pool) should be created for these components. In the event that an entity is 'deleted' (ie entity is removed, but memory isn't necisarily removed) the components need to be removed from all systems. Two possible solutions exist for managing system references to these components.
First would be using a system that simply removes the components when the 'isAlive()' function returns false.
Another would be handling that at a separate time instance using a mod scheduler (each system in a system vector gets a turn to check for dead components)
Make ComponentNode lists inside systems wrapped inside Observers, and make them singletons
More System types will call for duplicate node types, resulting in more memory usage than necessary. This can be mitigated via singleton pattern on the nodes. Templated component node lists will create static array of templated node type, thus removing the need for memory duplication.
Make Entity class have singleton list of entities
Entity memory management should not be the responsibility of the individual using the ECS, nor should any external libraries handle this. Need to change Entity.h such that entity has static array member which holds all references to entities. Entities will be kept track of via a separate list of iterators to removed entities. Those will be replaced first in the event that a new entity is added, otherwise static entity list should be extended. Removal of enough entities at the end of the list should result in truncating the total amount of memory used when index of last entity is 1/2 the value of the size of the static entity array.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.