0 Favourites

Dynamic Map Creation

This forum is currently in read-only mode.
  • Heya there.

    I'm trying to get Construct to generate a grid of tiles, with a predefined width and height of the grid. I also need to be able to give the squares a semi-random private variable that will determine what kind of 'terrain' that they will be - dirt, stone, air, etc.

    I've thought about using an array or loops to do this but I have no idea how they work. Anyone have any idea how to do this?

    Thanks

  • I'm trying to get Construct to generate a grid of tiles, with a predefined width and height of the grid. I also need to be able to give the squares a semi-random private variable that will determine what kind of 'terrain' that they will be - dirt, stone, air, etc.

    I've thought about using an array or loops to do this but I have no idea how they work. Anyone have any idea how to do this?

    An array would be exactly what you would want to use. And you should probably look into the Perlin Noise plugin as well, as it's great for creating random terrain and things alike.

    There's some stuff about that on the forums. But for simplicity's sake I just created a very basic example, which uses an array and the perlin noise plugin to create a crude map from sprites. It's only 2 events!

    http://dl.dropbox.com/u/2306601/simplearraymap.cap

  • Cool, thanks! That's the first step. Now for the hard part. I want to make a side-view, "cross-section" platformer as opposed to a to top-down game, where you can destroy and create tiles. Sort of like a 2D minecraft.

    That means I've got to do a few things I don't know how to do:

    • Establish a "ground level" that varies with hills and mountains, etc.
    • Dirt is almost inevitable at that "ground level", and get's less and less likely as the distance from the ground level increases.
    • As you get deeper and deeper, you get more and more stone until stone is inevitable. Similarily for empty air.

    As far as I can tell, this means creating some kind of function to replace the Perlin Noise. Any thoughts?

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • You could still use Perlin Noise if you wanted a cave-like structure. Which I'm guessing from your description is not what you're actually aiming for.

    As far as I can tell, this means creating some kind of function to replace the Perlin Noise. Any thoughts?

    Well, yeah. I'd say you should make up your own events to achieve this. I came up with an overly simplistic frame-controlled approach for example:

    http://dl.dropbox.com/u/2306601/mapthing.cap

    Probably not the most sophisticated way to do something like this, but maybe it'll give you some ideas. There's so much that you can do fiddling around with Construct.

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