User Tag List

Results 1 to 5 of 5

Thread: Polygon or pixel collision . which is faster?

  1. #1
    Clicker Fusion 2.5 DeveloperiOS Export ModuleSWF Export Module
    Yima's Avatar
    Join Date
    Feb 2008
    Location
    Sweden
    Posts
    104
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Polygon or pixel collision . which is faster?

    Hi!

    I have a question about platform collision detection performance. Normally I just place backdrop objects as obstacles, which I use for collision detection (I use several detectors attached to a box that I move around using fastloops). However, I started working on a polygon based approach, where I use an editor to store "hit boxes" in an array by clicking and dragging (much like drawing boxes in a drawing program). The array contains the start and end X and Y coordinates for each box, and collision would be handled by looping through the array to see if the coordinates of my detectors overlap with the edges of my stored boxes.

    What I am wondering is whether this "polygon based" approach would be better for performance than placing actual backdrop objects to do pixel collision checks. A great advantage with the editor I am making is that it is really quick to click and drag the different collision areas. Also, it's easy to save the "levels" to a file, which makes it possible to load levels into a single frame instead of using the CF editor to create levels in several frames. If it's bad for performance I'll have to solve it differently, though.

    If anyone has any inpout on this matter I would be happy

  2. #2
    Clicker Fusion 2.5 Developer
    PsichiX's Avatar
    Join Date
    Jan 2014
    Location
    Poland, Cracov
    Posts
    31
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Polygon. Pixel perfect checks all pixels in bounding box. Polygon checks only edges. I would recommend Box2D for complex physics if there is built-in or extension for Box2D support.

  3. #3
    Clicker Fusion 2.5 DeveloperiOS Export ModuleSWF Export Module
    Yima's Avatar
    Join Date
    Feb 2008
    Location
    Sweden
    Posts
    104
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the quick reply! I really like Box2D, but I find it quite educational to develop own tools as much as I can. Also, the platform game I am working on will be quite simple, so the physics of Box2D would likely be overkill for my project.

  4. #4
    Clicker

    Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Jun 2006
    Location
    Killeen, TEXAS
    Posts
    1,037
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    box2d doesnt work correctly in fusion.

  5. #5
    Clicker Multimedia Fusion 2 Developer
    Jax's Avatar
    Join Date
    Jul 2006
    Location
    UK
    Posts
    693
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm a bit confused about whether the polygon collision code is written in MMF or in an extension? If it is the former then it seems unlikely to me it would be faster; not because the method is worse (it is clearly better) but just because of how slow MMF based code is compared to native code (and the pixel based collision detection is native). Perhaps it would be best to do some benchmarking?

Similar Threads

  1. Request pixel shader "Convex polygon"
    By SEELE in forum Hardware Accelerated Runtime
    Replies: 33
    Last Post: 4th August 2013, 10:17 PM
  2. Collision with pixel?
    By Digitalic in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 28th January 2011, 07:41 AM
  3. Collision Pixel Color
    By Blood_Wist in forum Multimedia Fusion 2 - Technical Support
    Replies: 12
    Last Post: 13th December 2010, 04:17 PM
  4. Testing the collision of a specific pixel
    By Boba Fonts in forum Multimedia Fusion 2 - Technical Support
    Replies: 11
    Last Post: 27th August 2009, 09:17 PM
  5. polygon collision
    By Bruto in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 3rd December 2007, 10:57 AM

Posting Permissions

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