How do I create and use a quadtree/octree with events to speed up collision detection ?

From the Asset Store
Fully commented source code/event sheet & sprites to create a space shooter game
  • Hello, today i would like to create an octree data structure to increase the performance of my game with events, what would be the best way to do it ?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • The Wikipedia articles on them have pseudo code on how they are done. In construct I’d say utilize the json plugin to manage the data structures needed, although they probably could be done with arrays albeit with some tedium.

    There are simpler structures like a uniform grid with a list of the objects in them, as well as binary space partitions that may work well too.

    If your levels has stuff mostly on a grid I’ve had great speed boosts from using and array to store if a grid location has an object or not.

    Guess the gist of all of them is adding/removing objects from the structure, and getting a list of objects overlapping an aabb.

    Event loops and picking kind of slow things down so for the greatest benefit I’d recommend utilizing JavaScript to do it if you can.

    So I’d say best, as in fastest, would be going with JavaScript.

    If utilizing just events, use json.

    But those are just general ideas.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)