Page 1 of 2

2d Platform Game - Random Level Generation

PostPosted: Oct 3, 2002 @ 2:13am
by brendan
Hi all,
I'm creating a platform game, and was wondering if anyone has any good ideas on creating random levels, the levels consist of multiple layers:

Layer 1: (background)
Layer 2: (objects) etc etc etc....

these are in the form of a linked list etc....

the random generation would have to produce (plaforms, walls, etc) the background behind the layers would be std... it would also be good for it to add items to the level, i.e a key to open a door, items to collect to complete the level etc, as well as the bad guys ;-)


The levels range from [20][20] to [500][500] in size, so there is quite a range.

Does anyone have any "good" way of doing this, or is there some code out there already?

The way I see it there are 2 ways, create the path first, then put in "bugus" material, or randomly create and test until it is playable.....

anyhow ideas?

PostPosted: Oct 3, 2002 @ 2:18am
by sponge
Can't help much, but I have a feeling this will be a tough project. Never seen randomly generated sidescroller levels before. You could have a preset bank of sorts, sections of levels, and have these sections of levels pieced together. That would ensure the quickest, playable random generator.

PostPosted: Oct 3, 2002 @ 3:45am
by brendan
yes, that may work, if they consisted of about 8x8 "blocks", but then you would have to define then as a 1-16 block for entry/exit points, i.e left,right,up,down or any combination 2^4 and then you would have to make sure the entry/exit point existed in the "middle" of the 8x8 section...

All you then need to do it have a start group and an end group of blocks... creating the groups in between types 1-16, there could also be a few different variation on a group block etc ie 16 types of group type 1 (left exit etc), this could be selected randomly.

this should simplify the random generation part, i.e just checking theres a path.... but with 16 type of blocks with 16 variations etc it would look random enough!

I suspect the code would be somewhat like a "pipe" game with the water comming down the line....

;-)

(anyhow still complicated)

PostPosted: Oct 3, 2002 @ 4:37am
by sponge

PostPosted: Oct 3, 2002 @ 7:30am
by TechMage

PostPosted: Oct 3, 2002 @ 8:38am
by Guest

PostPosted: Oct 3, 2002 @ 9:53am
by pazazzo
already heard of the unofficial fullscreen weeboo ? take a look at this 4mb .avi file:
[edit] if the .avi link doesn't work try this one:

again, this is not official, it was another experiment since i've been a big weeboo fan from the very beginning of its availibility. so, the game idea, it's name and the used sound effects in this video are copyright by frederik malmer ! everything else (graphics & code) was done by me...

maybe, if someone really likes to release a final version, featuring more levels, i could provide code or help a little here and there, there's also a small level-editor i made for this version...

anyway, the whole thing is still courtesy of frederik malmer, so he really should be asked first ;)

PostPosted: Oct 3, 2002 @ 10:05am
by Guest
delete?

PostPosted: Oct 3, 2002 @ 2:42pm
by Malmer
pazazzo.

Howcome you never told me of this? It's cool.

As for Weeboo, I won't give out the sourcecode to it, because it is so crappy I'm somewhat ashamed of it. Was a port of a DHTML game I made, so it is basically translating JScript code into C++. Add to that that I had to change some things and it eventually turned out to be pretty messy. In other words: It is a wonder it even works.

Either way...this is so fun. Just one thing. My name is spelled the swedish way: Fredrik Malmer. No extra 'e' in Fredrik.

Oh...for all you fans out there...if there is time in the future there might be a future for a new Weeboo game. I mean...quite a lot could be done with the little hairy guy. Oh, incase you didn't know. Weeboo is a rabbit. :)

PostPosted: Oct 3, 2002 @ 2:44pm
by Malmer
Oh, the reasons for weeboo not being fullscreen are:

1) Quite bad code makes it slow so on lowerend devices (MIPS, SH3) it really wouldn't run very well
2) The DHTML version had that size, so I feel like changing all too much.

PostPosted: Oct 3, 2002 @ 3:34pm
by pazazzo

PostPosted: Oct 4, 2002 @ 12:00am
by Jadam

PostPosted: Oct 4, 2002 @ 12:32am
by Dave H

PostPosted: Oct 4, 2002 @ 7:19am
by TechMage

PostPosted: Oct 7, 2002 @ 3:35am
by brendan