Jump to content
The Dark Mod Forums

Procedural dungeon (crawler) generation (swift mazes)


Tels

Recommended Posts

You using the Prim's algorithm for mazes?

 

It would be kind of neat to have a random maze also with random points of interrest and routes that were generated with the maze.

 

Routes would be hard though. Maybe after building the maze into 'tiles' create the routes by 'solving' the maze randomly a few times and decide weather to plonk a guard in the a connected route if there are no more than 3 (for instance) guards passing?

 

And maybe if a guard can see all of his 'patrol' route - it's too small, or too near a corner - place him in a chair (napping or drunk/nap anim would be nice).

Edited by i30817
Link to comment
Share on other sites

No, actually the "maze" is manually generated. Generating the config file programmatically (aka random maze generator) is a second step. For now I worry about taking the maze and creating a working mission from it :)

 

However, just for the fun of it I did use an online maze generator and turned it into a working PK4, took about 5 minutes (I had to edit their generated maze text, as every column was doubled to make it look better on screen):

 

http://www.delorie.com/game-room/mazes/genmaze.cgi (generate as text, save, remove every second column, paste into config file):

 

Then you get something like that:

 

http://bloodgate.com/swift/media/screenshots/2012-08-18_maze.jpg

 

(Yes, it works, you need to walk for a few minutes to reach the exit :)

 

Here is a (somewhat older) config file that I used to generate the demo map. It contains quite a lot of things already, probably later this needs to be split into different files to make it easier to edit:

 

http://bloodgate.com/swift/pub/dod.cfg

 

The basic idea is that the human specifies the overall layout, but some of the details are randomized – cobweb here, a rubble there, today a door in this wall, tomorrow at this wall.

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

I like this a lot.

 

Beyond the Dungeon Crawler use case, this could also be a way to get more non-mappers to build with TDM.

After they've gotten their toes wet, some folks are likely to move up to Dark Radiant for some custom flourishes.

 

If I can add this to TDM's Moddb page as a side-project that would be a cool way to gather some traffic though it would

also be good to have your own Moddb profile for the Dungeon Crawler specific aspect.

 

I wonder if the Arx End of the Sun folks would be interested in adding this framework?

Dungeon Crawling is a closer kin to that project.

 

If you can get folks into making these dungeons you might even pickup new TDM art assets from folks who are into

that style of game rather than stealth.

Please visit TDM's IndieDB site and help promote the mod:

 

http://www.indiedb.com/mods/the-dark-mod

 

(Yeah, shameless promotion... but traffic is traffic folks...)

Link to comment
Share on other sites

Looks fun, Tels. Might be cool if you go in a Rogue-like direction, with simple stuff you pick up on your way,maybe even some RPG abilities, and each level in the dungeon levels up in difficulty, with maybe 5 levels to the climax... be kind of fun for a quick game. It's just you have to dmap everything in advance & can't keep it growing in-game, but that's ok. Gamers can just run it themselves and get a new map to play each time.

What do you see when you turn out the light? I can't tell you but I know that it's mine.

Link to comment
Share on other sites

I wonder if it goes towards nethack and others with final death and no saves. "Retrieve the amulet of Zot from dungeon level 20-25." Starting a new game would generate all the floors for that unique game.

 

And it is not necessarily limited to dungeons: I'm pretty sure one could make outside or city modules/tiles as well, they just need somewhat larger tile size.

 

This is quite a cool idea.

Clipper

-The mapper's best friend.

Link to comment
Share on other sites

While indeed my focus is adding a moderate mix of RPG elements later, right now I'm still struggling with some basic infrastructure work. Like:

 

* having "secret" areas that are counted when you enter them and display a statistic.

* Or random ambient sounds (creaking, dripping, wind howling), that are either at static, predetermined places, or occur just "in your head" randomly.

* water puzzles, spike traps etc.

* player lantern that runs out of oil and needs to be refilled (no point of being stuck in a dark hall if you can just turn the lamp on all the time :)

* [endless list here]

 

In the direction of regenerating the dungeon randomly, this is a lot harder than it sounds. You can generate any kind of maze easily, but it needs to be fun, interesting, and not some cookie-cutter type of repetition. For me the reason why LoG works, is that the basic level building blocks are generic, cookie-cutter type, but they are arranged in interesting pieces, and that later step is probably manual (and much harder to automate).

 

The idea of "nethack and rogue" is definitely there. But there is also the technical problem of map geometry havign to be dmapped - that alone prevents a lot of interesting "re-arrange the map at start" situations. Just building one big room and inserting everything as func-statics does not work, either, as it would kill performance.

 

But anyway, now that I have a working demo level (see website :), the next step will be some modest randomizations performed at map start.

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

I'd also compare it to Torchlight (haven't played II yet). The maps are randomly generated (much moreso than say, Diablo II), but contain themed elements, traps, puzzle elements, and particularly interesting use of the elevation.

 

And, nice diary.

Edited by jaxa
Link to comment
Share on other sites

I'd also compare it to Torchlight (haven't played II yet). The maps are randomly generated (much moreso than say, Diablo II), but contain themed elements, traps, puzzle elements, and particularly interesting use of the elevation.

 

Didn't know there is a Torchlight game, is it related to the television series?

 

And, nice diary.

 

Thanx :) There is a new diary entry up, detailing how per-location fog works.

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

If I can add this to TDM's Moddb page as a side-project that would be a cool way to gather some traffic though it would

also be good to have your own Moddb profile for the Dungeon Crawler specific aspect.

 

I'd think its better on is own page, but apart form never having done this, I don't have a good name for it yet :) Swift Mazes is just the generator, not the final product.

 

I wonder if the Arx End of the Sun folks would be interested in adding this framework?

Dungeon Crawling is a closer kin to that project.

 

If you can get folks into making these dungeons you might even pickup new TDM art assets from folks who are into

that style of game rather than stealth.

 

Yeah, do you have any contact to these guys?

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

You can try to make a underwater 'elevation' to shake it up. It's a bit hard to make sure that the player can 'solve' the maze then though.

 

Level up stairs, rope arrow zones, and pits would be nice too... Even better if there is no actual zone transition but just a portal (because using rope arrows would be consistent, though i guess it can be faked by placing one on the levels 'descending').

 

I don't know how you can do typical increase in difficulty with pure stealth. BTW, i'd love if you or TDM stole/tweaked the arx fatalis magic system - it's even open source...

The runes would be great 'highlevel treasure' in such a system, though they have the problem of being combinatory unlike the books system in nethack derivatives (in a combinatory system at first finding a rune is bloody useless unless it can already do something very weak - arx fatalis doesn't - and by midway you're probably casting everything you will since the late game spells tend to be complex to cast for taking many runes. BTW, if you do add a spell system, please please don't add fireballs or other wide radius spells.

Edited by i30817
Link to comment
Share on other sites

You can try to make a underwater 'elevation' to shake it up. It's a bit hard to make sure that the player can 'solve' the maze then though.

Level up stairs, rope arrow zones, and pits would be nice too... Even better if there is no actual zone transition but just a portal (because using rope arrows would be consistent, though i guess it can be faked by placing one on the levels 'descending').

 

I am not sure what you are getting at here, tho? Are you talking about making "multiple levels"? That would probably better if you have different maps, where each "game level" is one map. In LoG it works that way, you go down some stairs and are in the next level. There is a loading transition, but you can always go back.

 

I don't thinkone could implement "5 levels in one map", tho, as this might reach the memory and entities limits.

 

I don't know how you can do typical increase in difficulty with pure stealth. BTW, i'd love if you or TDM stole/tweaked the arx fatalis magic system - it's even open source...

The runes would be great 'highlevel treasure' in such a system, though they have the problem of being combinatory unlike the books system in nethack derivatives (in a combinatory system at first finding a rune is bloody useless unless it can already do something very weak - arx fatalis doesn't - and by midway you're probably casting everything you will since the late game spells tend to be complex to cast for taking many runes. BTW, if you do add a spell system, please please don't add fireballs or other wide radius spells.

 

I have not decided yet if I can implement spells. It depends on how much resources it eats, how to make it work properly, still be fun and not cumbersome etc. Adding physics puzzles comes first :)

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

As I said before in conversation with Tels, I think this project definitely has a lot of potential in terms of gameplay - I'm not a fan of dungeon crawlers, never been, because of how the old school ones were nothing but endless mazes filled with "statistics" fights and item/key hunts in my eyes; but if you can get this type of universe (traps and dangers inside a dungeon) and mix it with TDM's gameplay of AI with realistic senses, physical coherence (be it awereness to light levels, sounds and interaction with the (moveable) environment), combat system and player's abilities, and I can picture an interesting game where the puzzles and traps could be complemented by organic enemies (you can sneak past them or fight) and a responsive environment/architecture that you can actually interact with, climb, push, knock over, etc.

 

Thanx :) There is a new diary entry up, detailing how per-location fog works.

 

I'm VERY much interested in this feature, as well as the player light. With different fogs per location you make it possible to create smooth differences in places like a big room with abundant light (very thin fog), a normal, dark corridor (medium), or a pit or scary crypt that is pitch black (heavy), all the while keeping a gradual limit to how far the player can see (right now, impossible due to the way ambient lights work).

 

PS: The link to your demo is broken, it seems.

Edited by RPGista
Link to comment
Share on other sites

Yeah i'm talking about multiple maps. I thought of this because one of my favorite dungeon crawl game series (Realms of Arkania) used ropes so you could go up and down pits.

 

Realms of Arkania had a really neat hardcore survivalist aspect where most game objects had one or two uses (though it was mostly passive so bad things don't happen). It was not as ridiculous as Nethack (i suspect because of the saves), but much more nature agression focused than monsters - you are much more likely to get pneunomia and die from a river crossing than a strange disease from a fight

 

BTW RPGista, not all roguelikes are like that (all aleatory). Try Tome4 or liberal crime squad. One is very tradictional in that it's combat focused, but still quite filled with quests (and favors the nice approach of unlocking classes and abilities in-game). The other doesn't have quests per-se and it's definitely combat focused but it's very... thematic.

 

SaveScummedWow.png

Edited by i30817
  • Like 1
Link to comment
Share on other sites

Yeah i'm talking about multiple maps. I thought of this because one of my favorite dungeon crawl game series (Realms of Arkania) used ropes so you could go up and down pits.

 

Since the generated maps are 3D, there is really no reason why one "level" can't be 8km deep (engine limits nonwithstanding :)

 

The basic "you need to go to the next level" is here more a design choice, the "next level" could be "up", or "down", or "sideways" or "behind this door".

 

The demo map already contans a "pit", just try it :)

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

PS: The link to your demo is broken, it seems.

 

Ooops. :blush: Restored the file. Note it's a slightly older version w/o the fog as the current version uses features from v1.09 and I first need to find a way to backport them via scripting to v1.07.

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

Didn't know there is a Torchlight game, is it related to the television series?

 

Torchlight was basically an indie game that copied a lot from Diablo 2 (included some ex-Blizzard on the team). Torchlight 2 was released 2 days ago and adds multiplayer elements, among other things.

 

It's on the current Humble Bundle: http://www.humblebundle.com/

http://en.wikipedia....wiki/Torchlight

http://www.torchlightgame.com/

http://www.torchlight2game.com/

Reddit AmA: http://www.reddit.co...omments/105md1/

 

As I said before in conversation with Tels, I think this project definitely has a lot of potential in terms of gameplay - I'm not a fan of dungeon crawlers, never been, because of how the old school ones were nothing but endless mazes filled with "statistics" fights and item/key hunts in my eyes;

 

I'd also check out Ancient Domains of Mystery (ADOM):

 

http://en.wikipedia....ains_of_Mystery

http://www.adom.de/

 

Looks like the creator latched onto the Kickstarter craze and is remaking the game this month. So this game has had on/off development for about 18 years.

Edited by jaxa
Link to comment
Share on other sites

I'd also check out Ancient Domains of Mystery (ADOM):

 

http://en.wikipedia....ains_of_Mystery

http://www.adom.de/

 

Looks like the creator latched onto the Kickstarter craze and is remaking the game this month. So this game has had on/off development for about 18 years.

 

Fantastic stuff. I fear I'd buy it Toprchlight, I'd never get out of playing anymore :)

 

Not sure about ADOM, tho, ASCII interfaces are not my thing.

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

Sorry guys, I actually never played any roguelike games (yeah I know, played a lot of real text-based rpgs though (books) ;) ), I was actually meaning games like Eye of the Beholder, or games "in which heroes navigate a labyrinthine environment, battling various monsters, and looting any treasure they may find" (wikipedia). They just are a tad too simplistic for me. It wasnt even the actual navigation, I loved Dragon Lore 2 and it was also "constrained, chunk by chunk movement", but with varied environments, npc interaction and strong story elements (btw, just took a look, the city is so old but still has some quite detailed architecture:)

 

http://www.youtube.com/watch?v=JR0MOmsTzWA&feature=relmfu

 

The point I was trying to make is that even though the classical dungeon crawl experience is not my cup of tea, I still think this project has several points of interest, the gameplay I was talking about, the proccess of creating a basic map framework without even going inside DR and then taking it from there (possibly saving a good chunk of work depending on what kind of map you have in mind), and technical features like we are seeing already (player light, location-based fog densities, etc).

Edited by RPGista
Link to comment
Share on other sites

I still think this project has several points of interest, the gameplay I was talking about, the proccess of creating a basic map framework without even going inside DR and then taking it from there (possibly saving a good chunk of work depending on what kind of map you have in mind), and technical features like we are seeing already (player light, location-based fog densities, etc).

 

More like, this project is the best thing since unsliced bread.

Link to comment
Share on other sites

More like, this project is the best thing since unsliced bread.

 

:D

 

Speaking of goodies, I spent all day trying to figure out how to emulate some features on older TDMs, or even finding out which version TDM you are actually running at. In the end I learned a LOT about scripting, and found a few working solutions for hard problems, and also learned more about object oriented scripting (which is great!) and the limits of D3 scripting (which is not so great...)

 

However, with all that (and the general TDM debugging I did today) I didn't manage to actually get anything backported to v1.07 or got any work on randomization done. BUT when testing I saw that the PK4 on bloodgate actually does not include torches in v1.07 - so the entire level is black. In v1.08 or current, it has torches... Whooops! That is not how it was meant to be.

 

I included a small fix in the PK4, so please redownload and try it again if you are testing with v1.07.

 

More on all that next weekend.

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

I'm not dead yet :)

 

The last week I was busy finishing up some details. For a prototype, it is often enough to get a working proof-of-concept. However, for a stable software, things must be more robust.

 

For instance, as a first shot the included ambient light was placed where the player started and had a size of 2000 units. This is enough for small testmaps, but gives artefacts on real maps. So now the generator figures out how big the generated map is, where the closest non-empty block to the center is, then places the ambient light there, and then resizes it so it still covers the entire map - but not more. Phew!

 

A lot of work, but now it works. In the same line I have made parsing more robust, fixed some small problems, reducing debug output, and and and. I also started refining some of the prefabs and experimented with wall grimes.

 

Of course, there are some new exciting features :)

 

The first is "location shift". Each location can now have an offset associated with it. So you can f.i. make one or two "connector prefabs" and then move a location half a block up, down, right or even a combination of the two.

 

Here is an example:

 

[Location 0]
name=Entry level

[Connects]
1	   separator_stairs_east   2 on Location 1				 Leads up

[Level 0]
········
·┌─┐···
·│S1···
·└─┘···
········

[Location 1]
name=Loft
offset=0 0 36

[Connects]
2	   air			 1 on Location 0				 Back
3	   air			 4 on Location 2				 Exit

[Level 0]
·······
··───··
·2   3·
··───··
·······

[Location 2]
name=Exit

[Connects]
4	   separator_stairs_west   3 on Location 1				 to the loft

[Level 0]
········
·┌──┐···
·4  │···
·└┐X│···
··└·┘···
········

 

And the resulting map:

 

post-144-0-18328900-1348944582_thumb.jpg

 

You can see that the location in the middle is shifted up, even tho the map still consists of only the basic blocks (labeled with A, B, C and D are the prefabs in the image). That breaks free from the grid-size and makes for more interesting levels. Here two prefabs with steps are used to connect the locations together.

 

The nice thing is that inside the location you can use the same prefabs, which means you don't have to produce every prefab in two (or more) versions depending on wether you want to use them in a "normal" or a "shifted" location.

 

 

The second feature is reskinning of worldspawn and func_statics. (Entities like moveables will be done via spawnarg support later). Basically, it lets you change the texture on everything inside a prefab in a specific location. So the sewer can get dirtier the lower you come, or the tunnels use sandstone instead of lime somewher e else.

 

This basically also lets you re-use the same prefab more often, adding varity without having to redo the work. And it is something that is impossible in DR - switching the texture on worldspawn or func_static is only possible with a lot of manual labour.

 

Here is the definition:

 

; change all textures on worldspawn brushes and patches in this location
all worldspawn: brick/grainy_blocks01=brick/even_small_blocks01
; change all textures on entity (func_static) brushes and patches in this location
all entities: brick/grainy_blocks01=brick/even_greyish01
; change all textures in the prefab ceiling_hole (regardless of worldspawn, or entity)
ceiling_hole: brick/grainy_blocks01=brick/bricks_dirty_yellow
; change all worldspawn textures in this prefab only
empty worldspawn: brick/grainy_blocks01=brick/bricks_ind_grey

 

Here are two images that hopefully explain it :)

 

With the definitions used (it's an example, excuse the horrible mix of textures :)

 

post-144-0-81338300-1348944795_thumb.jpg

 

Without the reskin section:

 

post-144-0-36053000-1348944847_thumb.jpg

  • Like 2

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

It is very interesting to see the modules starting to go full 3D on that perspective shot! Not only that but the prototype also shows a cool attempt of creating a "place" (the small steps, the altar and the light coming from above), which is beyond the proof of concept and goes directly to a practical use example. ;) I can see the maze getting "vertical" now, with the player moving down or up as he advances. I guess the next step would be to have floor over floor, like you suggested before?

 

Reskinning seems like a huge time saver, but I wonder if the stress of creating the system you described and using it (without being a programmer I mean) would be heavy? Would it be possible to load the prefab in an interface (like how we have now in DR), apply changes to the surface textures, and then save it in your modules set for use in the map? Of course, changing the whole module at once (or just the floor, or walls) can be done remotely by code and save you a lot of effort, but being able to load the prefab and change it by hand (aligning tough textures, changing their scale, all that manual work), and then save it and instantly use it in the map as a personalised set is also a reasonable way of doing it, I would think.

 

PS: I was taking a look at the page, I was wondering if it would be possible to translate your fog mechanics to any map, or is it done with particular code? I would be really interested in giving it a try, whenever it is available! :)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recent Status Updates

    • Sotha

      Brushes: ~1300
      Patches: ~990
      Entities: ~960
      Ambients: Done, EFX: Done, Objectives: Done, Briefing, Done, Location System: Done.
      Going to final polishings before beta.
      · 0 replies
    • Sotha

      WIP mission name confirmed: "The Last Offering"
       
      · 7 replies
    • Sotha

      Today I started writing readables for my WIP mission.
      I wrote my usual text and then crammed it into AI and boom, high quality stuff comes out.
      I used to say that clipper is the mappers best friend, but now it seems it is more like "AI is the mappers best friend."
      · 2 replies
    • The Black Arrow

      Just saw further into 2.13 development, or is it 2.14? Anyway, proper Parallax Mapping...Absolutely fuck yes, please!
      · 2 replies
    • nbohr1more

      Happy Halloween! "Gem of Souls" is out:
       
      Psst, someone let Darkfate know...
      · 1 reply
×
×
  • Create New...