How do I Connect random generated nodes together??

  • Hi Pulstar, I'm still getting islands with your latest one...

    Perhaps because I'm using too low number of nodes? I only need 10-15 max.

    Perhaps I broke something

  • The solution should work for any number of nodes. Although the execution time should be proportional to the square of the number of nodes.

    I think what is happening is the pontifex function not firing. Either because node booleans were not reset to false after new lanes were generated or because the conditions for it firing did not work. I did a few dozen runs of this and did not encouter the issue eith the version i attached to my previous post. Unless that is an old file.

    Send me the link to your capx via PM. I wil check what the issue is in 10 hours when I get home.

  • Done, thanks again.

  • Hello guys,

    Sorry to bump this topic since all this time ^^' ... I prefer reopenit instead of open a new one ...

    So this is why i'm here, i would like to make the Generation in a different way and i have start something that work well, but i'm stuck in this point, when i generate the link i would like a way for the algo do not create a link on a one that already exists or on a node near him, just can create link where no one exists and beetween random 0 to 3.

    This is the begining of the CapX : https://www.dropbox.com/s/uqar7eh32i4px ... .capx?dl=0

    Hope someone can help =D

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hey evillair, <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile">

    Just an interesting note...

    It might be worth looking at the "Delaunay Triangulation".

    It's probably overkill for what you're building, and it specifically produces a mesh of triangles which is a bit stricter than what you require, but it has some nice properties.

    The Delaunay Triangulation does a good job of connecting nearby points without creating sliver triangles.

    It's the dual graph of the voronoi graph.

    If you're familiar with voronoi patterns, for the Delaunay Triangulation, you get the center points of the voronoi cells, and create links between points in bordering cells.

    Boris Delaunay, who came up with this Triangulation solution, worked on this back in the 30s. He also climbed mountains, and somewhere there's one named after him. I don't know much else about him, so I can only assume he lived as hard as he mathed.

    Here's a visual animation of a Delaunay Triangulation algorithm working on a set of random points.

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