Advanced Random Cells

0 favourites
From the Asset Store
Easily generate many levels from a set of pre-built scenes (Construct 3 template)
  • Are you still interested in this Newt? I got super distracted playing with the new 3D shapes feature but I revisited this after the other post about the advanced random plugin bug. I've got a working example that can pull the node coordinates and voronoi vertices (right click to calculate and plot the vertices).

    dropbox.com/s/fem59cdrowu4ig3/Noise%20graph-voronoiscript.c3p

    The edge and cell information is also there but I don't really know how to utilize them at this point. They're available though!

    The points may not match the output from the advanced random plugin exactly, since the resolution of finding the node origins only resolves to the nearest pixel, while the actual points are probably not whole numbers.

    I also ran into some issues with fullscreen scaling and the drawing canvas coordinates when the window size doesn't match the viewport size. Not sure how to resolve it yet so I just left scaling off for now.

  • I think the plug needs a great deal of adjustment for most of the features, and I certainly don't want to reverse engineer it.

    It's not had a lot of debugging, but I suspect that will change with the new 3d stuff.

  • Spotted a Nepeo out in the wild and figured a ping might be appropriate to call attention to this. Would it be possible for you to provide the algorithms you used to generate cellular and voronoi noise? Or at least how you generated the original random distribution of points for the noise, which the rest of the noise can be calculated according to. The goal would be to get the node, vertex, and edge data if possible.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Spotted a Nepeo out in the wild and figured a ping might be appropriate to call attention to this. Would it be possible for you to provide the algorithms you used to generate cellular and voronoi noise? Or at least how you generated the original random distribution of points for the noise, which the rest of the noise can be calculated according to. The goal would be to get the node, vertex, and edge data if possible.

    Mmm so yeah I originally implemented this code, I'm not sure if it's been changed since I left Scirra but I'd guess not as it would change the behaviour.

    At its core it's a fixed tile based Voronoi implementation, this means it doesn't need to generate the whole grid ahead of time and allows the grid to be effectively infinite. But it also means the cells cannot vary in size.

    As such it's relatively easy to get the center of a cell either from the XY of a tile, or an XY location ( slower ). Getting the vertices would be much harder, as the edge information doesn't exist. So it would have to be derived from the centers of the surrounding tiles.

    If you are doing more advanced things... you might want to look into generating the cells yourself using JS. Provided you are working in a finite area it gives a lot more flexibility, and would allow you to do more work ahead of time making queries cheaper to perform.

    I'm happy to chat a bit about how to implement this stuff if you are interested. Also Red blob games talks a bit about how to use Voronoi cells and libraries they use in JS. Poisson disc sampling is a useful subject here as well, as it gives you better distribution/size/variation of cells. Sebastian Lague probably has some videos on both subjects as well, although I forget the exact case he used it for.

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