Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411579 Posts in 69386 Topics- by 58445 Members - Latest Member: Mansreign

May 05, 2024, 02:54:56 PM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsDeveloperTechnical (Moderator: ThemsAllTook)Level Generation?
Pages: [1]
Print
Author Topic: Level Generation?  (Read 1910 times)
Zeiya
Level 0
*


View Profile
« on: June 29, 2009, 01:57:57 AM »

What would be the easiest way to create a simple level randomiser/ generator (for example, like in Spelunky) in actionscript 2? I'm thinking creating an array and getting it to (something) under a few guidelines but i'm not sure.

Is there a better/ easier/ more efficient way?
Logged
hagel
Level 0
**



View Profile
« Reply #1 on: June 29, 2009, 04:58:49 AM »

There is a thread here about procedural map generation.
Logged
Μarkham
Level 10
*****



View Profile WWW
« Reply #2 on: June 29, 2009, 08:30:36 AM »

In the game I'm currently working on, I've got the level tiles stored in a two-dimensional array.

The first thing generated is the minimal path needed to get from start to finish, and then it adds in random tiles from there.
Logged

Xion
Pixelhead
Level 10
******



View Profile WWW
« Reply #3 on: June 29, 2009, 09:07:44 AM »

if you start with an empty map wouldn't the shortest path just be a line?
Logged

Μarkham
Level 10
*****



View Profile WWW
« Reply #4 on: June 29, 2009, 09:28:05 AM »

I meant minimal in the sense that there is at least one randomized path that leads from start to finish that the player can effectively cross without getting stuck before generating all the other stuff around and on top of it.
Logged

Afinostux
Level 2
**

Forgotten Beats


View Profile
« Reply #5 on: June 29, 2009, 11:08:42 AM »

X-com probably has the simplest approach. to my knowledge, they have a big list of premade blocks of tiles that their maps are made of, and these blocks constrain one another's placement in logical ways. for instance, a block of road must connect to either the end of another block of road or to the edge of the map. That system gives you the triple benefit of having hand designed portions of levels, having randomised levels, and not having to deal with any sort of hardcore level generation stuff. I'm pretty sure spelunky does a similar thing.
Logged

BorisTheBrave
Level 10
*****


View Profile WWW
« Reply #6 on: June 29, 2009, 12:00:43 PM »

Let me be the first to say to say, don't use AS2. This is a dead language. Learn to use AS3, so you can take advantage of other libraries, and you don't end up with performance problems (random level generation can be non-trivial performance wise).

The block idea is good, as it's the easiest way generate anything resembling overall structure. But you can also randomize inside blocks and/or predtermine the outer blocks. Basically, getting some sort of compositional process going allows stronger customization of the levels.

Finally, read! There's tons of literature on the subject (a lot of this forum), and each tends to give a different "feel". Pick those which are best for your game.
Logged
Zeiya
Level 0
*


View Profile
« Reply #7 on: June 30, 2009, 12:27:20 AM »

Thanks for the quick replies. Smiley BorisTheBrave, i actually chose to learn as2 because there were more tutorials available from a quick search. I plan to migrate to as3 soon. ZeuglinRush, thanks particularly to you since that's what i was thinking of and you just clarified it for me.

edit: since it's been brought up, a tutorial for as2 to as3 conversion would be fantastic
« Last Edit: June 30, 2009, 01:27:54 AM by Zeiya » Logged
Kneecaps
Level 3
***



View Profile
« Reply #8 on: June 30, 2009, 07:07:47 AM »

Here's one.
Logged
Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic