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?