Store all overlapping neighbours

This forum is currently in read-only mode.
  • If I add a hash table to a Object "Node"

    How can I fill that table with all the Objects that overlaps.

    (it could be a list and not a table)

    What I want to do is to build a graph of connected nodes and be able to do different graph traversals of that graph. So beginning in one Node how do i do a depth first search and a breadth first search.

    Normally in other languages I would pick a starting node and then recursively visit all of its neigbours. (depth first) Any idea on how to do this?

    And any sugestions for the breadth first search?

    And finaly.... preferably all these different traversals should be done in one frame. I have one implementation that visits the nodes one by one but only one in each frame.

    I hope the question is interesting enough to generate som answers

  • I'm not sure what you mean by overlap.

    It sounds like your trying to create a network system for paths, so you might have p1, p2, p3, p4, and p1 connects to p2,p3, and p2 connects to p4, and p3 connects to p4, etc. And you want to store the information about connections?

  • Assuming all objects are of the same size, you could just use a collision mask to get the data.

    http://www.mediafire.com/file/gigwzdfw1mt/collisionmask.cap

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I'm not sure what you mean by overlap.

    It sounds like your trying to create a network system for paths, so you might have p1, p2, p3, p4, and p1 connects to p2,p3, and p2 connects to p4, and p3 connects to p4, etc. And you want to store the information about connections?

    This much like what i have in mind. Im just dont know how to set it up

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