Impact

This forum is read only and just serves as an archive. If you have any questions, please post them on github.com/phoboslab/impact

1 decade ago by matteray

When EntityPool is enabled for an entity, number of "draws" in debug bar constantly increases.

Here is my situation: I have an entity which is killed after exiting the screen and re-spawned after that again and is killed again after exiting the screen and goes on ...

At the start, I see 1 entity and 1 draw in debug panel but after a while draw count increases. The wierd thing is that the entities count is always 1. It is like "60 draws" and "1 entities" after a minute or two. When I disable entity pooling for that entity, this does not happen.

Any ideas why this happening?

1 decade ago by dominic

Sounds weird. I suspect there's may be something going wrong in your entities reset() function. Can you show the code for this entity?

1 decade ago by vincentpiel

The poolling built in impact has many design flaws, the worst being that it creates more garbage than it saves.
I could advice you to use my pooling library on github, which worked great for a few games already, but in fact, since you only have one single entity to re-use, faster and simpler is not to kill() the entity, but rather just re-place it where you want it to be.

1 decade ago by dominic

@vincentpiel: can you elaborate on this?

The only big difference I can see between Impact's pooling and your library (apart from the API) is that Impact's pools are cleared on each level load, while you choose to retain them throughout the whole game.

Case in point: Using Impact's pooling in XType on the Wii U makes a tremendous difference compared to using no pooling at all. So it can't be that bad :)
Page 1 of 1
« first « previous next › last »