Jump to content
  • Advertisement
Sign in to follow this  
tariq9112003

Particle Engine slows down game(XNA 4.0)

This topic is 2834 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey guys i am an xna beginner..i am learning the language using the aaron reed xna 4.0 book.so here's the problem,in the program i am running,whenever particles are created ,the game freezes for a second.its the same case with deletion of particles.Why does this happen?
Please let me know if i should post my code...

Share this post


Link to post
Share on other sites
Advertisement
The common cause is that there are a lot of dynamic allocation when they are created so that your memory is fragmented. The solution is to have 256 particles of each type preallocated and when the limit is reached, replace the oldest particle of the same type. To avoid spending time on deactivated particles, use a circular interval for each type to remember what particles are active.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!