Results 1 to 10 of 18

Thread: PGDmC - Unknown Name

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Quote Originally Posted by code_glitch View Post
    I hope so too... My first 'issue' is the fact my game and attacks heavily rely on a particle effect system. Now how do you check whether 5,000 particles are hitting each player every frame... Hmm. I'm thinking of filtering it by angle then distance instead of re-calculating particle positions and then trying to match them.
    You could use a spatial collision algorithm - put each particle into a 2d grid 'slot' by it's location, and then when you check the player, see which 2d slots the player is covering and only look in those slots for particle collisions.

    This will speed things up lots!!

    cheers,
    Paul

  2. #2
    Quote Originally Posted by paul_nicholls View Post
    You could use a spatial collision algorithm - put each particle into a 2d grid 'slot' by it's location, and then when you check the player, see which 2d slots the player is covering and only look in those slots for particle collisions.

    This will speed things up lots!!
    I agree. You can use a regular grid, or a quadtree/octree, or an axis aligned BSP tree. Any of them will help. If the distribution is fairly regular, if you know that the density is at some level, then a regular is a quick and easy solution.

  3. #3
    PGD Staff code_glitch's Avatar
    Join Date
    Oct 2009
    Location
    UK (England, the bigger bit)
    Posts
    933
    Blog Entries
    45
    I found a novel solution now: particle are based on threthings; time, angle and speed. All I need is starting coords + (Time * Speed) and see if that is in the player area twice. One for the upper limit the other for lower. Then just use an if to check each particle in that range. Easy as 1, 2, 3 and so far seems fast enough (checking 1,000 particles every frame @ 55fps eats around 150-200mhz ) although speed tweaks are on the way to use those other cores more efficiently...

    Also looking into using the power of OpenGl HW and textures with some colour values and framebufferobjects to do some HW acc detection: at the power usage of 50,000 pixels/sec is not much right? Although since its POC code I doubt it will be part of the final entry TBH
    Last edited by code_glitch; 08-07-2011 at 10:20 PM.
    I once tried to change the world. But they wouldn't give me the source code. Damned evil cunning.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •