Skip to content

Implement quadtrees for general use in game engine #358

Description

@nwinter

We're running some O(m*n) algorithm performance bottlenecks where we have to compare all Thangs of one type against all Thangs of another type which may be nearby, and doing that with two arrays of Thangs isn't efficient since we're ignoring distance information. It gets even worse when we have to recalculate distances for each comparison, and when we need to include line of sight, then we're doing raycasting, and raycasting is terrifically slow. Good examples include determining whether Collectors can collect Collectables and which friends and enemies a Thang can see and hear.

It would be better to have a general quadtree implementation we could put Thangs in so that various Systems could perform faster. Quadtrees are a form of binary space partitioning and I'm sure many JS or even CoffeeScript implementations exist that we could adapt to our Thangs.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions