Procedural Level Generation

This forum is currently in read-only mode.
From the Asset Store
Template for dungeon/maze generation, using wave function collapse
  • Hello, again. I was wondering how one would make a procedurally generated level on loading the layout? I know there are many ways to do it, but I just cant think of any way of how it might work! I've looked it up on Google many times, but never found how it works.

    Think about Towerclimb, for example. It's made to not be impossible, and has most of its items intelligently placed when you need them. I assume it creates in rows, but how does it determine what goes where and when?

    Be as in-depth as you'd like, the more the better! (Just don't get to complex, please. xD)

    (By the way, Labyrinth's level generation (for the One Buck challenge) was ENTIRELY random. It just placed blocks and made them overlap so that they form some sorta cave. If it wasn't possible, it was ditched and a new one was made. I know that's not proper, and that there has to be a better way to do it!)

  • Prime numbers may be useful to you for repetition by the way, here's an excellent article with some good ideas and that will explain the concept better than I can!

    http://designfestival.com/the-cicada-pr ... designers/

  • Awesome, Ill keep that in my bookmarks.

    Also, I'm making a dodge survival game for now, so I can apply this later

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Search the completed addons section for plugins by arsonide

    He's got beyond awesome procedural generation stuff. Also, depending on your approach, if you need object memorization, or picking beyond construct's regular ability, the s plugin provides a lot of power in that regard at the expense of a steep learning curve.

    You need to decide what type of procedural thing you want to do, like will it be like worms? Spore? Or towerclimb. You'd probably have a different approach, what did you have in mind.

    You should always try tlo translate your words in to events or code if you get stuck. For instance

    We want powerups to appear randonly for a player at random spots

    If(random( 20)==5)
          Create powerup at random(1000),random(1000)[/code:1oj4sjxw]
    
    That means every tick there's a 1 in 20 chance of getting a powerup
    That's not what we want tho, we don't want them to appear, but to be at the next part of the level, and go by distance from the lastpowerup, not time passed
    
    Only if its further than some predetermined required distance:[code:1oj4sjxw]
    If (distance(character.x,character.y,character('lastpowerupx'),character('lastpowerupy') is greater than character('requireddistance') [/code:1oj4sjxw]
    
    Then create it off the screen on the rightside
    [code:1oj4sjxw]-----create powerup at scrollxright+10, floor.y[/code:1oj4sjxw]
    
    Set the new required distance randomly between 500 to 1500
    Set lastpoiwerupx and y variables to the new powerup position
    [code:1oj4sjxw]
    -----character set pv 'requireddistance' to random(1000) +500
    -----lastpowerupx = powerup.x
    -----lastpowerupy= powerup.y[/code:1oj4sjxw]
    
    You want to factor in current health, etc, add some pvs, and/or conditions, and/or actions, and you're on your way, when its not right because it appears too close to walls, and an extra condition that checks for that, or whatever., and keeping tweaking and adding until its where it needs to be.
Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)