Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8943599
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T11:48:55+00:00 2026-06-15T11:48:55+00:00

I’m cutting my teeth on randomization in games and trying to figure out the

  • 0

I’m cutting my teeth on randomization in games and trying to figure out the trick that games like Binding Of Isacc & Sperlunky use of pre-fab level fragments arranged randomly to create a functional floor/level, something along the lines of this:

A floor will always contain the player, exit and a bonus room (yellow dot). Rooms that are connected are directly connected to each other.

I have a faint idea of how to go about it: Start by creating an multi-dimensional array that holds the tilemap & grid data:

public static var levelLayout:Array =
[[tile,grid],[tile,grid],[tile,grid],[tile,grid]
[tile, grid],[tile,grid],[tile,grid],[tile,grid] etc]

And from there, go through each grid space, roll to see if that spot is nothing, also making rooms nothing if they are isolated and then begin to assign rooms from an shuffled array that contains all the tilemaps/grids.

Am I on the right track? How should I handle the exits? Any help would be appreciated. Cheers

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T11:48:56+00:00Added an answer on June 15, 2026 at 11:48 am

    Start by making a perfect maze (a maze where you can get to any point in the maze from anywhere else in the maze). This helps create a network of rooms that are connected in a winnable/solvable way.

    There are plenty of tutorials out there for doing this. This one is a little dirty and has a bunch of code you may not need, but it’s good to look through some relevant examples of this to understand different approaches:
    http://www.emanueleferonato.com/2008/11/28/perfect-maze-generation-with-as3/

    I’ve had good luck with a recursive backtracking algorithm:
    http://en.wikipedia.org/wiki/Maze_generation_algorithm#Recursive_backtracker

    Consider each cell in the maze to be a room. Once the maze is built, you know which rooms are connected to other rooms, so make each room have a means for either having a door to connect to the next room, or a wall. You probably would want to make like a 4×4 perfect maze.

    Ways to spice it up-

    You can safely remove deadends from your maze and it will still be perfect. Once the maze is generated, loop through all cells in the maze. Any cell that has 3 walls is a dead end, and you can wall it off completely. Or make it a secret room or whatever.

    Add loops to the maze. Randomly connect 2 rooms in the maze that weren’t previously connected. This still keeps the maze perfect, it just makes it a little more open.

    This is fun territory, enjoy it 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I've got a string that has curly quotes in it. I'd like to replace
I am trying to render a haml file in a javascript response like so:
I know there's a lot of other questions out there that deal with this
I'm trying to create an if statement in PHP that prevents a single post
Let's say I'm outputting a post title and in our database, it's Hello Y’all

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.