Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6332431
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T18:15:46+00:00 2026-05-24T18:15:46+00:00

Ok. So there are several methods to implement Collision detection like R-trees, Quadtrees, BSP

  • 0

Ok. So there are several methods to implement Collision detection like R-trees, Quadtrees, BSP trees Recursive Dimensional Clustering (RDC). Or maybe more.

My problem is that I have about 6-8 enemies on stage, some of them moving some of them static and also I have the Hero who is shooting with three types of missiles at same time. So I get about 70-100 objects on stage at a time.

My question is, which algorithm to use for this type of problem, and which is the common practice? Also which is the most efficient?

I was thinking of implementing Quad trees but I read that thy can be slow, or I am wrong?

ps: Can I use Octal trees or they are strictly for 3D?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T18:15:47+00:00Added an answer on May 24, 2026 at 6:15 pm

    If you only have say, ten enemies and a hundred bullets or so I doubt any complex spatial structure will benefit you all that much. Checking every bullet against every enemy amounts to a thousand checks, and the gains in performance compared to maintaining a more complex structure is in my opinion too small.

    Depending on how fast your game is, you could get away with checking for collisions every other frame (or even less often) instead of every frame. That’ll give you a nice 100% performance boost on your collision detection.

    I recommend simply doing this:

    for each(var enemy:Enemy in _enemies){
        for each(var bullet:Bullet in _bullets){
             if(bullet.x > enemy.x - enemy.width / 2 && 
                bullet.x < enemy.x + enemy.width / 2 &&
                bullet.y > enemy.y - enemy.height / 2 && 
                bullet.y < enemy.y + enemy.height / 2){
                    trace("collision!");
             }
         }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

If there are several methods in the test class, I found that the order
There are several different methods for converting floating point numbers to Integers in JavaScript.
There are several filter methods for dates (year,month,day). If I want to match a
current situation: I have a service with several typical service methods like create(), remove(),
I have a class that currently has several methods that take integer parameters. These
There are several types of objects in a system, and each has it's own
There are several ways to iterate over a result set. What are the tradeoff
There are several plugin options for building a search engine into your Ruby on
There are several web applications which allow you to send photos from your mobile
There are several people about (myself being one of them) who have been developing

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.