Advanced random and Tilemap

0 favourites
  • 4 posts
From the Asset Store
Easily generate many levels from a set of pre-built scenes (Construct 3 template)
  • Hi guys,

    I am pretty sure it is straight forward, but how do I mix Advanced random and tilemaps together? I am digging into procedural map making. I tried a couple of times but failed miserably.

    I would appreciate some words of wisdom or a sweet tutorial link.🙏

    Cheers! 😊

  • Here's the simplest overview I can give.

    The advanced random expression Classic2d(x, y) will give you a random value between 0 and 1 for every pair of values (x,y) you enter. Classic2d uses a Perlin noise algorithm. The special thing about Perlin noise is that neighboring values won't vary too much from each other, so neighbors won't normally jump from .9 to .1, as opposed to purely random numbers.

    So the most basic implementation would be something like you tilemap coordinate indexes as input x/y, and then you can 0compare the result and decide what to do with it. For example if it is less than 0.5, then make it a water tile. If it is over, then make it land. This is a common use case for Perlin noise to generate an elevation map. For any given x/y coordinate, it will return an elevation in the form of a number between 0 and 1.

    That's the absolute basics. You can add layers upon layers of noise to build whatever you want. Unfortunately it's quite open ended so there's not really a one size fits all algorithm or tutorial. It just depends on what your end goal is and how good you are with manipulating numbers via functions (in traditional math/algebra terms, not programming).

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Ah now I see. So each (infinite) X,Y coordinates is given a value up front upon adding 'advanced random' - sure, it gives meaning now.

    So i guess the 'Seed' is just a random start x1,y1 coordination on the fractal map.

    Thanks a lot mate. :)

  • That was easy as pie. Five lines of code. God, I love C3.

    Thanks oosyrag!

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