Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411433 Posts in 69363 Topics- by 58418 Members - Latest Member: Pix_RolleR

April 20, 2024, 06:33:44 AM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsCommunityDevLogsVERSNOOF
Pages: [1]
Print
Author Topic: VERSNOOF  (Read 2350 times)
moonmagic
Level 4
****



View Profile WWW
« on: September 05, 2009, 12:20:06 AM »



Actual tiles, mocked up into a scene.



Temporary tiles, in-game screenshot.

Versnoof is a procedurally generated dungeon crawl. You are undergoing a coming-of-age ritual in a cave on the Olympic Peninsula. You start the game with a lantern, a knife, and food and water for three days. Prior to entering the cave, the you were dosed with a hallucinogenic drug that makes you sensitive to psychic vibrations. By turning the lantern off and focusing, you will be able to sense danger and the presence of helpful items.

The goal of the game is to survive the vision quest. Without revealing too much, after a day of living inside the cave, you find yourself unable to leave. Your only choice is to descend into the cave and try your luck with its denizens.

Here is a basic test (all art is temporary) of the level generation. It includes:

- An entrance
- An exit! (press 'z')
- Treasures (randomly generated based on age of tile and size of room)

Find the exit to generate a new cave. Special thanks to ChevyRay and pgil particularly, as I stole / adapted a lot of your code from examples.

DOWNLOAD
« Last Edit: September 10, 2009, 12:32:44 PM by moonmagic » Logged

|
akuryo
BANNED
Level 0
*


View Profile
« Reply #1 on: September 05, 2009, 01:24:50 AM »

procedurally generated dungeon? Testing this now.

edit : Myeah, this has been done with game maker, and the collisions TOTALLY suck, you go half through every wall, and i don't see any work behind this, except the random generated terrain, with suck too.
Logged
Doktor_Q
Level 2
**



View Profile
« Reply #2 on: September 05, 2009, 06:14:06 AM »

Nice idea. A few comments though:

- make the dungeon floors a little bigger, if you can.

- make the treasure only collect if you press Z. Also make them leave an "open chest" object behind.

- do something about that collision detection. At the very least, it looks like it was made for a square a few pixels smaller.

- also if you can, make it so you can move back up to the previous floor. I can give you some tips on how to make it easy to recreate the exact same level, instead of saving the whole thing.

Recreating the same level:

At the start a game, assign random values to somewhere between four and eight integers in an array. When you generate a level, instead of using rand() or similar functions, use a complicated, entirely made-by-you equation that uses the randomly assigned numbers from the beginning, and the level number. If you manage to do it without using random, then the character can travel up and down freely, and each floor will be same for the rest of that play through/save game. To change the level setup, just change those starting variables.
Logged
moonmagic
Level 4
****



View Profile WWW
« Reply #3 on: September 05, 2009, 08:07:33 AM »

Kikaru: Thanks very much for the feedback!

The treasure chests are just there to see if I can generate something, and to give me something to do; I intend to replace them with crystals that can only be seen when the light is off (got the light working last night).

I did make the bounding box for the player a few pixels smaller to make it easier to move around; when I replace the sprite, it will no longer go through walls. I know it's ugly right now, but I'm trying to use placeholder as much as possible so I can get the engine finished.

About generating the previous floors: can I use Game Maker's random seed functions to do this? It feels like I might be able to. If not, I am sure there are roguelike helps around on the interwebs to do it.
Logged

|
Doktor_Q
Level 2
**



View Profile
« Reply #4 on: September 05, 2009, 01:00:14 PM »

I didn't realize you were using Gamemaker. To be honest, I have no idea (I haven't used Gamemaker), though I think Spelunky does something to that extent using hash functions, so you could try asking around/looking up stuff on that.
Logged
moonmagic
Level 4
****



View Profile WWW
« Reply #5 on: September 05, 2009, 06:50:21 PM »

Yeah, definitely; if I go with the "dungeon escape" route common to the -hack family, I definitely will have to have some way of recalling levels.

I was intending on keeping things fairly claustrophobic, with a small light radius and few mobs, so I might be able to just load levels from external data. I think it would be more elegant to use random seeds, though.

Logged

|
Doktor_Q
Level 2
**



View Profile
« Reply #6 on: September 05, 2009, 07:07:19 PM »

Random is definatly good, but being able to move back to a previous level is quite handy.

Perhaps you could do something like this with hash functions:

Have a 'base' hash that represents the dungeon as a whole. When you generate a new dungeon, make a new one of these.

Next, have certain parts of the hash change based on the floor number. If the changes to the hash are just subtle enough, and consistent, then you can now travel up and down through the dungeon at will.
Logged
moonmagic
Level 4
****



View Profile WWW
« Reply #7 on: September 09, 2009, 02:49:11 PM »

Some tiles for the walls and floors:



Special tiles next, such as cave crystals, fungi.

Also, cave paintings and bones.

Taking a break from hitting my head against the level save / load stuff. Making graphics makes me happy.
Logged

|
Sam
Level 3
***



View Profile WWW
« Reply #8 on: October 05, 2009, 03:43:25 AM »

For 'remembering' past floors, you've two options really:

Either store a seed number for each floor (which could be randomly generated when a new game is started.)  That way each time you enter a particular floor the game looks up that floor's seed number in a nice simple list, and generates the floor fresh.  So long as the procedural generation of the floor occurs "all at once" and with the just-seeded random number generator it'll always produce the same thing.  The problem is that it'll also produce the same treasure and enemies as the first time the player entered.  So you may want to maintain a list of which treasure items have been picked up for each floor, and remove those from the map once it has been generated (unless you're happy for there to be respawning treasure of course.)

The other option is to generate all the floors at the start, and just store them in some big level data storage thing.  I've no idea how that would work with GameMaker's built in level handling stuff.
Logged
moonmagic
Level 4
****



View Profile WWW
« Reply #9 on: October 05, 2009, 07:46:05 AM »

Yeah, I was looking at storing the level state in a file as you leave the level, and then keeping track of the current level with a global variable. I don't use GameMaker's level save / load stuff; it would just be file_text_write_string() after generating the level. I'm really excited about this game, but I'm working on two others at the moment, so I'm resisting the urge to work on it. Try and finish some projects first.
Logged

|
Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic