Git Product home page Git Product logo

entityx's People

Contributors

acron0 avatar alecthomas avatar chocolatemelt avatar deflinhec avatar deledrius avatar domdom avatar dustinfreeman avatar frankstain avatar hovatterz avatar iamphen avatar jeremyjh avatar jpleau avatar kumar8600 avatar larspensjo avatar lethal-guitar avatar lilywangl avatar marioliebisch avatar nodmgatall avatar radman0x avatar randompoison avatar roig avatar rupertsteel avatar sansumbrella avatar sjaustirni avatar svenstaro avatar theo543 avatar tivek avatar xw0 avatar zackthehuman avatar zandor300 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

entityx's Issues

Automatic System Updates

Would it be able to add a non-templated SystemManager::update() method that automatically iterated over the systems in the SystemManager and called update() on them? It would be more convenient than having to manually list the systems that you want to update. This would also help with dynamically setting up systems at run-time rather than compile-time.

Add systems.configure() call to readme

Just pointing out that we need to call this function after adding the systems.

class Level : public EntityX {
...
systems.add();
systems.add();
systems.add();
systems.configure();
...

Implicit conversion loses integer precision: 'size_t' (aka 'unsigned long') to 'int'

Hello ,

I know that the library currently does not support IOS but I am really keen on using it on mobile.
I am trying to compile your library for IOS 7.1 but I am running into problems when I try to compile it for the armv7 processors. I am getting these errors. Do you think it is worth doing -Wno-shorten-64-to-32 or it will affect the stability of the library ?

In file included from /Users/sab/DEV/libs/entityxIOS-1.0.0/entityx/System.cc:11:
In file included from /Users/sab/DEV/libs/entityxIOS-1.0.0/entityx/System.h:19:
In file included from /Users/sab/DEV/libs/entityxIOS-1.0.0/entityx/Entity.h:29:
/Users/sab/DEV/libs/entityxIOS-1.0.0/entityx/help/Pool.h:36:31: error: implicit conversion loses integer precision: 'size_type' (aka 'unsigned long') to 'int' [-Werror,-Wshorten-64-to-32]
int chunks() const { return blocks_.size(); }
                   ~~~~~~ ^~~~~~~~~~~~~~
In file included from /Users/sab/DEV/libs/entityxIOS-1.0.0/entityx/System.cc:11:
In file included from /Users/sab/DEV/libs/entityxIOS-1.0.0/entityx/System.h:19:
In file included from /Users/sab/DEV/libs/entityxIOS-1.0.0/entityx/Entity.h:31:
/Users/sab/DEV/libs/entityxIOS-1.0.0/entityx/Event.h:85:12: error: implicit conversion loses integer precision: 'size_t' (aka 'unsigned long') to 'int' [-Werror,-Wshorten-64-to-32]
return size;
~~~~~~ ^~~~
In file included from /Users/sab/DEV/libs/entityxIOS-1.0.0/entityx/System.cc:11:
In file included from /Users/sab/DEV/libs/entityxIOS-1.0.0/entityx/System.h:19:
/Users/sab/DEV/libs/entityxIOS-1.0.0/entityx/Entity.h:392:73: error: implicit conversion loses integer precision: 'size_t' (aka 'unsigned long') to 'uint32_t' (aka 'unsigned int') [-Werror,-Wshorten-64-to-32]
    Iterator end() { return Iterator(manager_, predicates_, unpackers_, manager_->capacity()); }
                        ~~~~~~~~                                    ^~~~~~~~~~~~~~~~~~~~
/Users/sab/DEV/libs/entityxIOS-1.0.0/entityx/Entity.h:394:85: error: implicit conversion loses integer precision: 'size_t' (aka 'unsigned long') to 'uint32_t' (aka 'unsigned int') [-Werror,-Wshorten-64-to-32]
    const Iterator end() const { return Iterator(manager_, predicates_, unpackers_, manager_->capacity()); }
                                    ~~~~~~~~        

Does not compile on Windows with Visual Studio 2013

Does not compile on Windows with Visual Studio 2013.

  1. First issue was gcc specific compiler flags. To remove:
  2. go to Project -> Properties -> Configuration Properties -> C/C++ -> Command Line
  3. Remove all the flags in the 'Additional Options' box
  4. Second issue: Cannot open include file: 'unistd.h': No such file or directory
    I think unistd.h is unix only. Need to find a replacement for Windows.
  5. After commenting out the first unistd.h include I saw (in simplesignal.h), I get lots of errors - 648 to be exact.
    Some of them I think are just missing includes. Some of them, I'm not sure if VS doesn't support some C++11 features? For example, in simplesignal.h, I get an error for this bit of code:
/// CollectorInvocation specialisation for regular signals.
template<class Collector, class R, class... Args>
struct CollectorInvocation<Collector, R (Args...)> {
  inline bool
  invoke (Collector &collector, const std::function<R (Args...)> &cbf, Args... args)
  {
    return collector (cbf (args...));
  }
};

The errors are:

  1. Error 12 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
  2. Error 13 error C2143: syntax error : missing ',' before '<'

Missing include headers in quick.h

Hi.
I am getting errors when using the quick.h file.
Solved it by adding include headers into quick.h to the event manager, entities manager and the system manager.

Use of shared_ptr versus custom pointer type

This is a reiteration of a questions I posed in a comment on a commit, added as an issue since it's difficult to navigate to the comment.

Would we be able to achieve the goals of contiguous memory by using std::shared_ptr with a custom allocator and deleter? I am curious to know more about the motivation for switching to the custom ComponentHandle type.

There are a handful of situations where I found the previous use of shared_ptr really useful.

Transform hierarchies:
I have a Transform component that stores an optional reference to a parent Transform. With shared_ptr, it doesn't matter if the entity (or other object) holding the parent transform is destroyed; the child transform's shared_ptr keeps the parent alive and the child maintains its correct total transform. With ComponentHandle, if the entity holding the parent transform is destroyed, the child transform's ComponentHandle will become invalid and the child will likely shift in space.

Pseudo-instancing:
Having the components as shared_ptr allowed for easily sharing the same component across entities.

Thread safety:
If you hold a shared_ptr in one thread, it will remain valid until it falls out of scope, even if all the references have fallen out of scope in another thread.

Thanks.

How Practical is: entities_with_components(...) ?

Hi Alec, excellent implementation of ECS!
I've been digging in the source code, finding and learning how you're managed to get it working in C++ so nicely. The whole thing is some next level shit, very impressive, I sometimes I feel I might never be able to write code like this, but I'm hopeful.

One thing that is bothering me is the fact that each system has to iterate through ALL entities in order to find entities with the appropriate components, and it's doing that on every update() call. Is that really necessary? That's a hell lot of bitmask checks and temporary tuples constructed and destroyed.

Now imagine 1,000,000 entities (particles and stuff) and 50 fairly small systems. On each game update we have to do 50 million bitmask comparisons just to find out what entities we're interested in.

So really... is this practical?

How's the performance when the list of entities grows?
Is it possible to have more than one pool of entities? e.g. Separate gameplay entities from GUI entities.
Could we register systems to events which will be notified when a particular component is added to some entity?
Could we have non-dynamic systems that store all entities they're interested in?

Would love to hear some thoughts on this. :)

Many thanks,
-Iggy

Are there any plans to remove Boost?

Python support aside, are there any major hurdles to removing boost? I have only spent a short while looking at the source but depending on boost is a bit of a red flag for me. My colleague and I are considering a fork to remove boost but any initial thoughts or reasonings would be appreciated...

Thanks ๐Ÿ‘

Removing the need of inheriting from the Component and Event template classes.

Since the Event and Component template classes are only used in order to provide type-integer mapping, there is no actual need to make users derive from them when creating a new component or event type. The type-integer mapping can still be retained using the type information from templates since the family functions are static and not concerned with instance state.

Add new managers to update loop

I think that you should be able to specify own Managers. Right now, you have EntityManager and EventManager. It would be nice if you could specify what managers you would like to use in the update loop and a way to create new Managers based on the code you have.

eg:

struct Level : EntityX<ShapeManager>{

}
struct SomeSystem : System<SomeSystem>{
    void update(ShapeManager &shapes, EntityManager &entities, 
            EventManager &events, double dt){
}

I don't know how hard this is or how useful it might be. But give the user availability to add their own Managers would be nice.

Documentation incorrect

In the documentation, it says to create entity and event mangager by

EventManager events;
EntityManager entities(events);

But that does not work because the constructors are private.
The objects have to be created using the corresponding make functions (at least thats what I would guess).

Alternate component pooling policies

At the moment, for any new entity, the only pool implementation is allocated in contiguous blocks of 8192 entities. It would be good to be able to have some different strategies for sparsely-populated/large components, or where we know the number of entities in a system is never going to reach 8192.

Eventless Entity System

After some experience using entityx, Events allow me to mess up the nice design I could have in entity systems, if I just spent more time looking for a proper solution rather than just going for the easy "Oh I'll implement an event and do it there..." approach.

-> If Events are not necessary to a completely functioning entityx, I would like to get rid of them, to simplify entityx and avoid potential pitfalls. Note : I now favor using lambda callbacks in components to signal something "out of the entity system domain". Compared to Events, I just need to be careful of the lifetime of the callback, as with any lambda.

What about named arguments for Components?

Hi,

First of all, thanks for this awesome piece of code! I'm having lot a fun using entityx in my new project :)
Coming from the Python world, I find named arguments sometimes really useful and clear, especially when you are reading some code you haven't since a while.
When I have to change some component parameters, I often find myself opening header files to remind me of the order of the arguments, which is a total waste of time. So, instead of reading:

character.assign<Physics>(7.5, COL_CAPSULE);

that syntax could be really easier to understand:

character.assign<Physics>(mass=7.5, shape=COL_CAPSULE);

I know it's not "really" C++ish, but Boost offers such a library and that's something that would still be optional for the users. What do you think?

Cheers,

Guillaume

PS: in the README, it should be "deps/Dependencies.h" instead of "deps/DependencY.h".

Example error

Hello,

In example.cc L244 there is a undeclared variable : M_PI

HerveM

entities_with_components<T> returns incorrect results after some entities have been destroyed

I just ran into this bit of weirdness after adding an "Expires" component and system to my project. It is probably caused by entity destruction creating pockets in the search space that are incorrectly skipped over.

The following snippet shows my system's update method, which compares the quantity of entities with the component actually remaining to the number returned by the entities_with_components query.

Below, I include the output from this loop, which shows that the query finds fewer entities with the given component than exist. Basically, destroying entities causes other entities to be forgotten (leaked) by the EntityManager.

size_t query_count = 0;
  for( auto expiry : es->entities_with_components<Expires>() )
  {
    query_count++;
  }
  for( auto entity : mEntities )
  {
    auto expires = entity.component<Expires>();
    expires->time -= dt;
    if( expires->time <= 0.0 )
    {
      entity.destroy();
    }
  }

  cout << "Stored count: " << mEntities.size() << ", query count: " << query_count << endl;
  // remove destroyed entities from our stored collection
  vector_erase_if( &mEntities, []( const Entity &entity ){ return !entity.valid(); });

Outputs:

Stored count: 5000, query count: 5000
Stored count: 5000, query count: 5000
Stored count: 5000, query count: 5000
Stored count: 5000, query count: 5000
Stored count: 4978, query count: 4956
Stored count: 4899, query count: 4798
Stored count: 4743, query count: 4495
Stored count: 4544, query count: 4128
Stored count: 4263, query count: 3626
Stored count: 3904, query count: 3047
Stored count: 3509, query count: 2447
Stored count: 3082, query count: 1888
Stored count: 2689, query count: 1419
Stored count: 2365, query count: 1082
Stored count: 2129, query count: 891
Stored count: 1941, query count: 729
Stored count: 1817, query count: 637
Stored count: 1745, query count: 586
Stored count: 1671, query count: 534
Stored count: 1595, query count: 488
Stored count: 1491, query count: 428
Stored count: 1413, query count: 376
Stored count: 1336, query count: 329
Stored count: 1260, query count: 296
Stored count: 1177, query count: 258
Stored count: 1095, query count: 233
Stored count: 1014, query count: 206
Stored count: 923, query count: 173
Stored count: 852, query count: 138
Stored count: 766, query count: 118
Stored count: 705, query count: 104
Stored count: 614, query count: 75
Stored count: 544, query count: 55
Stored count: 470, query count: 42
Stored count: 398, query count: 34
Stored count: 316, query count: 24
Stored count: 211, query count: 11
Stored count: 135, query count: 5
Stored count: 54, query count: 2
Stored count: 0, query count: 0

Systems configure method not called on 32bit system

Hi Alec,

i have a weird problem.
I mostly use Ubuntu 12.04 64bit , but because of a problem with another lib i tried to run my project in Ubuntu 13.04 32bit.

The problem i'm facing is that my GameManager derived from Manager, does not call the configure method of the systems added to the system_manager on gamemanager->start() and they are not called when i do system_manager->configure() either.

I have no clue why this is happening...

Use braced initialization when creating components

This is just a thought. If C++11's braced uniform initialization was used for internal component creation we could use structs without needing to write an explicit constructor.

new(pool->get(id.index())) C{std::forward<Args>(args) ...};

Say we have a simple Point struct..

struct Point {
  float x, y;
};

Arguments are forwarded, and no explicit constructor is required.

entity.assign<Point>(1.0f, 2.0f);

The downside to this is that only non-narrowing conversions are allowed. So if those floats were replaced by doubles or 32 bit ints you'd get an error.

entity.assign<Point>(1, 2); // narrowing error
entity.assign<Point>(1.0, 2.0); // narrowing error

Delta time variable type & naming

Hi there!

Would it be possible to customize the type of the delta time variables? In my case a double is a total overkill and a float would be just fine. This could be done using a typedef (or a C++11 using) combined with a #define somewhere.

On a side note, I think that "deltaTime" would be more readable and explicit than "dt".

More elegant iteration

I've noticed this pattern occurs very frequently, where the entity is thrown away when iterating over components. It's also kind of redundant having to pre-declare the component handles:

  void update(EntityManager &entities, EventManager &events, TimeDelta dt) override {
    Notification::Handle notification;
    for (auto _ : entities.entities_with_components(notification)) {
      notification->components_added.reset();
      notification->components_removed.reset();
    }
  }

With std::tuple this could be simplified to:

  void update(EntityManager &entities, EventManager &events, TimeDelta dt) override {
    for (auto c : entities.with_components<Notification>()) {
      std::get<0>(c)->components_added.reset();
      std::get<0>(c)->components_added.reset();
    }
  }

Better? Worse? Unsure.

Support for component dependencies

Hi,

it would be nice to be able to define dependecies between (or requirements for) components.
e.g. physics-component requires the entity to have a position/rotation-component

Copy constructor for Entity::assign(..) method?

Hi,

What do you think about bringing back the Entity::assign(component) method? Basically, it would just call the copy constructor of the component type C, so the memory would still be managed by Entity X, but you could send in a fully created object instead of having to send in each parameter of the object.

The only downside (I see) is that the user of the library would have to be cognizant of the fact the component was copied.

I ask, as my code currently uses the old assign method, and it's just much easier for me :) I would have no problem whipping up a pull request for this feature.

Cheers

Structure of Arrays Components and Custom Allocator Support

I've been looking at entityx and it seems like a great library, thanks for makings such a great library ๐Ÿ‘ .

Is there any plan/desire to add support for defining components as a struct of arrays (as opposed to making them arrays of structs as they are now)? I'm thinking something along the lines of what's described in this BitSquid post and the one before it.

Hand-in-hand with that goes custom allocator support. I know entityx already uses memory pools to keep cache coherency, but is there any way to provide your own allocation scheme to be used? I'll admit that I haven't looked too much into whether this option is already available, but it would be necessary to allow struct-of-array type components.

Thanks again for your hard work on entityx.

Entity.h and its two throw exception lines

I am working with EntityX on IOS and Android. Very nice project first of all. We originally had been using a custom rolled solution but maintaining it was becoming a major focus.

Only issue we have had so far. Entity.h throws an exception if you try and delete a BaseComponent. While this makes perfect sense (since programmer should use Entity::Destroy()) most of our projects and many IOS/Android projects disable exceptions (-fno-exceptions).

It is a mild inconvenience but we have to comment those lines out every time we update EntityX from source. It is also the only two throw statements in the codebase (outside of the testing code). Might be worth just having those delete functions spit something out to stderr, "Please call Entity::Destroy()".

More Flexible System::update() Signature

It would be nice to be able to pass custom information into the update() method of systems (i.e., something other than a delta time). In theory this could be done using the CRTP technique already employed by entityx to allow the base System to forward arguments directly to the custom update() method. However, to allow #74 (automatic system updating) to work we need a base class with a virtual function to define the signature of the update() method so that we can still iterate over all systems in the given SystemManager.

My proposal to solve both problems is to allow the user to define new base system types with different virtual update() methods, and then template the SystemManager to that type. For example:

// define new system base class with new update() signature
struct CustomPhysicsSystemBase : public entityx BaseSystem {
  virtual void update(entityx::EntityManager, entityx::EventManager, float deltaTime, CustomPhsyicsData& someCustomPhysicsData) = 0;
}

// define new templated class
template<typename S>
struct CustomPhysicsSystem : public CustomPhysicsSystemBase {
  // basically the same as the existing entityx::System<> type
}

// this is how you would implement a system with a custom update() signature
struct MyNewPhysicsSystem : public CustomPhysicsSystem<MyNewPhysicsSystem> {
  void update(entityx::EntityManager, entityx::EventManager, float deltaTime, CustomPhsyicsData& someCustomPhysicsData) override {
    // ...
  }
}

// to use the new custom systems:
entityx::SystemManager<CustomPhysicsSystemBase> physicsSystems;
physicsSystems.add<MyNewPhysicsSystem>();
physicsSystems.update<MyNewPhysicsSystem>(0.1f, CustomPhysicsData()); // just update MyNewPhysicsSystem
physicsSystems.updateAll(0.1f, CustomPhysicsData()); // update all systems with the same signature

One important thing to notice here is that you'd need a new SystemManager for each different update() signature you had, but I think that's worth it to have the greater degree of flexibility. This change might also help to address #64 because it would allow users who did not want to use the built-in event system to simply define an update() method that does not take an EventManager as an argument.

The only issue with this that I see so far is that the user would need to define the templated version of every new base type in order to get Families to work correctly, and that adds a lot of boilerplate to every new type the user wants to define. Since the templated system struct declaration is fairly short we could define a macro that does it for them, something like DECLARE_SYSTEM_TYPE(type, base) which would expand to:

template <typename Derived>
class type : public base {
 public:
  virtual ~type() {}

private:
  friend class SystemManager<base>;

  static Family family() {
    static Family family = family_counter_++;
    return family;
  }
};

Thoughts?

unsubscribe Events

I think there should be a way to unsubscribe a Receiver from an event like this

void update(EntityManager &entities, EventManager &events, double dt){
    if(/*some condition*/){
        events.unsubscribe<SomeEvent>(this);
    }
}

Alec if you think this is a good idea but don't want to do this yourself. I can possibly do it (if I have the skills) and submit a pull request.

Event Queue with EntityX?

Hi again folks,

I'm curious on what your thoughts are on implementing an Event Queue with EntityX?
My biggest concern with it is the fact that events are processed at a later time, and systems only hear about certain events a frame too late.

In the EntityX example.cpp we emit CollisionEvent from the CollisionSystem and we catch it in the ExplosionSystem, storing collided entities in a list that will be updated once ExplosionSystem::update() is called. We heavily rely on the order of updates, specifically that ExplosionSystem is updated after the CollisionSystem.

systems.update<CollisionSystem>(dt);
systems.update<ExplosionSystem>(dt);

If this was the other way around we would miss one frame, entities would move one frame further into each other before finally exploding. (Probably not very visible, but a quite concerning issue). The same effect happens when we introduce an Event Queue into the equation.

One solution I see is to have systems do all necessary work on the receive event method; they don't wait for update().

Here's my own example with the problem of missing a frame:

CollisionSystem::update(ex::TimeDelta dt) {
    //... check collisions
    events->queue<CollisionEvent>(e1, e2);
}

Application::update(ex::TimeDelta dt) {
    systems.update<CollisionSystem>(dt); //Queue CollisionEvent!!!
    systems.update<MovementSystem>(dt); //Nothing to resolve, okay keep moving
    systems.update<ParticleSystem>(dt); //Nothing to confettisize
    systems.update<RenderSystem>(dt); //Draw entities on top of each other
    systems.update<AudioSystem>(dt); //No sound to play

    event_queue.update(); //Now process CollisionEvent(e1,e2)
}

ss 2014-12-08 at 10 29 21

Is this a real issue or am I missing something really obvious?

Replication and unique IDs

Hi Alec,

This is more a question than an issue, but how you would replicate (for example, over a network) entities since the IDs generated are not ensured to be the same on every sides? Wouldn't it be a good thing to allow one to create an Entity with a given ID? Or a way to "tag" an entity with a UUID so it'd be possible to look them up fast?

Thanks,

Guillaume

PS: I'm adding a link to this interesting Gamedev answer: http://gamedev.stackexchange.com/a/29536

Inheritance problem

Hi,

First of all, your library is awesome ! ;-)

However, I've noticed a little bug.

Suppose you want to add a common functionality to some components, like the possibility of activating or deactivating a component.
You could define an interface, let's say "ActivatableComponent", which inherits publicly from "Component".
Now, suppose you have two components that could be activated, let's say "PhysicsComponent" and "RenderingComponent". They'll both inherit from "ActivatableComponent".
Now, if you want to add a "PhysicsComponent" to an Entity, it'll work, but the call to "PhysicsComponent::GetFamily" will actually call the "ActivatableComponent::GetFamily", and it'll be the same for the "RenderingComponent". Thus, if you then add a "RenderingComponent" on the same Entity, it'll replace the PhysicsComponent because they would be considered to have the same type.

So, how to deal with that ?

We can imagine that our "PhysicsComponent" inherits from both "ActivatableComponent" and "Component", but that would even be worst. When you'll add the component to an Entity, the template method will try to call the static function "GetFamily" on the template parameter type, but you would have a compile-time error: the compiler wouldn't know which "GetFamily" it should call (The one on "ActivatableComponent" or the one in "Component" ?).

My solution is to remove the family_counter_ variable from the "BaseComponent" class, and remove the "family" function from the template class "Component".
Instead, you could externalize this mechanism.
I mean, for example, outside of any classes, having:

namespace Details
{
  static std::atomic<Family> family_counter_ = 0;
}

template <typename C>
inline Family GetFamily(void)
{
  // I have a doubt, does family_counter_ need to be atomic if we want to be thread-safe, as we increment it while initializing a static variable (I think about C++11 thread-safe static initialization) ?
  static Family family = Details::family_counter_++;
  return family;
}

Now, for a template parameter "C", if we replace all calls to "C::GetFamily" by a call to "GetFamily", we shouldn't have problems anymore with inheritance, we'll actually get the real Family of the component. Plus, when we'll use our component, our code editor won't show us the "GetFamily" static function for code-completion, so it's a little bit less intrusive.

I haven't tested that solution yet, but I think it should work.

What do you think of that ?

Looping over all entities and all their components

Is there already a way to do this ?

All my components have a save() method and i just want to step through all entities (or all with a PersistenceComponent which already works) and call that method with no regard to what component i am currently saving.

And i apologize if this questions would resolve themselves if i understood all your code ;)

Version number missing in SONAME (libentityx.so)

Hello !

jason@buildvm:~/entityx/entityx/build$ readelf -d libentityx.so  | grep SONAME
 0x000000000000000e (SONAME)             Library soname: [libentityx.so]

The SONAME is libentityx.so, without version numbers.

An example (SONAME doesn't have to be 1, it could be 0, but from what I see 1.0 is incompatible with 0.x)

  • libentityx.so.1 could symlink to libentityx.so.1.0.1 (current release)
  • libentityx.so could symlink to libentityx.so.1

The SONAME would be libentityx.so.1

Does that make sense ? It would surely help distributions packagers since being able to install multiple versions of a library is something people sometimes want/need (ie: SDL/SDL2)

Thanks !

Typo in readme

The readme says

git checkout https://github.com/alecthomas/entityx.git

but it should be clone instead of checkout.


Under Options there's two bullets for ENTITYX_BUILD_TESTING.

Example request

Hello ,

I have read the tutorial on the main page but some of the stuff are changed in the latest release and can't compile. Can I request an example where an Entity is inflicting damage on a few monsters let say, throwing a bomb that will subtract their health. I just can't figure some stuff on how to combine your system with timed events like bomb for example. Something similar like in the Trefall's entity system:
https://xp-dev.com/svn/Trefall-ComponentSystem/TestEntity/main.cpp

Thanks in advance,

Alex

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.