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 Joncom

I'm building a generator to create maps and I'm at the point where I need to decide how animated tiles will be handled. And so...

I'm curious if there is a significant speed advantage to using the built-in method for animating map tiles over creating entities that simply look like tiles.

It's been suggested that many of the checks that entities do which use CPU can be disabled. Even so, will I run into problems if a large map contains 150-300 animated entities on screen at once?

1 decade ago by Graphikos

You could get pretty intimate with Impact's source to see the difference between drawing from the backgroundMap vs an Entity. I'd assume them to be very similar.

An old benchmark tool shows hundreds of animated entities worked very well:
http://impactjs.com/forums/help/lots-of-entities-very-slow-performance

I debated this a year ago when working with lots of animated entities. You can see more information in this thread which also talks about how the benchmark works.

1 decade ago by Joncom

Quote from Graphikos
I don't know if there is any major bottlenecks/repercussions with spawning and killing entities all the time but I'm about to find out.
I'm interested how that went for you... Sounds like you did not take the hundreds of entities approach, but it's neat that the benchmark seems to indicate it can be done.

1 decade ago by Graphikos

I instead I went with raw context draws... pushing over 2,000 draws so I had to go to the very basics. I wasn't looking for animated but I imagine being animated wouldn't bring down performance much. All it takes to animate is to draw something different because its already drawing something, which is the expensive part.

If I recall I believe I still used the CollisionMap but did my own draws for the tiles. So I didn't use the BackgroundMap but I also didn't use Entities.

1 decade ago by Joncom

That's a good point.

It seems intuitive to thing animating it must be a lot more work, but in a way it is already animated (sorta) in that it's never the same draw, it just looks the same.

I think my mind is at ease about this animation stuff finally :)
Page 1 of 1
« first « previous next › last »