Git Product home page Git Product logo

entitycomponentsystem's People

Contributors

cazadorro avatar

Watchers

 avatar  avatar

entitycomponentsystem's Issues

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.

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 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 photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.