Pages: [1]
  Print  
Author Topic: oRoom shape collection sharing (for random level generation)  (Read 482 times)
kinnik
Bean
*
Posts: 193


View Profile
« on: August 10, 2010, 08:26:18 PM »

Here we can share any oRoom shapes and use them in each others mods.
Please post any room shapes you'd like to share and take and use any you find here!

I think the best form to share them would be:

"0000000000"+
"0000000000"+
"0000000000"+
"0000000000"+
"0000000000"+
"0000000000"+
"0000000000"+
"0000000000"+



oRooms are the building block of the randomly generated levels in spelunky.
They mark the space for all the elements of the game to be created.

When the level is made the game randomly picks from several (like > 150 for all level types!) 'shapes' to make up each level from.  Each level uses 16 oRoom shapes, in a 4 by 4 grid.  These level 'shapes' tell the game where to place solid bricks, push blocks, players, trees (i think?), spikes, snakes (in the snake pit), start/finish and likely many more things.  These shapes are keep track of in a series of numbers and letters. the number '0' is an empty space, the number '1' is a brick, '2' is a random chance of a brick, '7' a chance of spikes... and many other letters and numbers. You can find an index of all the letters/numbers and their meaning at the bottoms of each scrRoomGen script.


All together they would look like this:

"110000000040L600000011P000000011L000000011L0000000110000000011000000001112222111"

I find that if you write them with breaks and align them, they are much easier to read:

"1100000000"+
"40L6000000"+
"11P0000000"+
"11L0000000"+
"11L0000000"+
"1100000000"+
"1100000000"+
"1112222111";

(Oh, MAN I hated that shape! Can anyone post a picture of it?)



You can find the code for the oRoom shapes in the scripts:
scripts folder / level generation /

scrRoomGen1 - 5, black market and yeti cave

Simply remove the blocks of code that say
"60000600000000000000000600000000000000000000000000000222220000111111001111111111"
and replace them with the ones you find here...

Orr....

Change the code that reads:

n = rand(1,10)

and change it to read one more:

n = rand(1,11)

Then add your shape new shape on the end, INSIDE THE BRACKET:

Code:
case 9:{...}
case 10: {.....}
case [b]11[/b]: { strTemp = "110000000040L600000011P000000011L000000011L0000000110000000011000000001112222111"; break; [b])[/b]

If you'd like (i'd like) you can make the code look like this and it'll work just the same but be easier to read:

Code:
case [b]11[/b]:
{
    strTemp = "1100000000"+
                   "40L6000000"+
                   "11P0000000"+
                   "11L0000000"+
                   "11L0000000"+
                   "1100000000"+
                   "1100000000"+
                   "1112222111";
    break;
[b])[/b]



OK, go ahead and take & leave.

And feel free to ask any questions about how this works if you don't understand!
Logged
kinnik
Bean
*
Posts: 193


View Profile
« Reply #1 on: August 10, 2010, 08:51:35 PM »

OK!  Here are all the room shapes for "spelunky labyrinth"

Because labyrinth uses the rooms to make up a maze, the room shapes are designed to make tunnels goes in specific directions.

 Left dead-end, right dead-end, up DE, down DE, left AND right, left and up, left and down, right and up, right and down, L R & U, L R & D... ect ect... untill left right up and down.

The start room peices,
the room shapes for hallways,
annd snake pit.

all in a TXT because it was too big to simply post here (>20000 characters)

http://www.mediafire.com/file/4a42724vjbe31e4/spelunkyLabyrinthRoomShapes.txt


I think that's all right now... ??  The end rooms are the same as the start rooms.

Does anyone know how to put these in a better format?
Logged
TyrOvC
Mossbaby
*
Posts: 357


This text is not random :(


View Profile WWW Email
« Reply #2 on: August 10, 2010, 09:02:37 PM »

You've got to do some more case by case coding for linking multiple room contents together to make anything much more interesting then the default Spelunky ones, if you're just using default Spelunky contents.  Like the way that the top, middle, and bottom rooms of snake pits are linked together in the room path finding script, for example.

Then, isn't there separate code for choosing and filling in "obstructions" in the appropriate places (preselected?) in the chosen room?

Edit:
Nice to see some initiative with messing with the level generator.
« Last Edit: August 10, 2010, 09:08:30 PM by TyrannicalOverlordC » Logged

kinnik
Bean
*
Posts: 193


View Profile
« Reply #3 on: August 10, 2010, 09:25:18 PM »

true.  having unique 'clusters' of rooms are the most interesting part of any level.

-the snake pit (three rooms together in vanilla?)
-the lake (four rooms)
-the yeti cave i think..  ??

but... the meat and potatoes (the bulk) of the game is the 'nothing' rooms between everything!  Very important as well, I think.


That said, if people want to design 'clusters' or room shapes..
maybe a 3 room bat cave or an extra long boulder run?

I'd be happy to give folks info on how to do this in your mods!

 
Logged
Pages: [1]
  Print  
 
Jump to: