Jump to content
The Dark Mod Forums

Procedural dungeon (crawler) generation (swift mazes)


Tels

Recommended Posts

@Tels: Do you have plans to generate floors (open and with ceilings/floors), allow for unique set pieces being connected with generated passages?

 

I'm not quite understanding the question?

 

Currently, the generated connects individual pieces, which can be 1x1x1 block, or multiple blocks large. Pieces can also overlap, but they don't have too. The blocksize is also arbitrary.

 

But there is not yet code that generates "a passage". Technically, it is possible, but I have not thought about it.

 

Since the input to the map generator are just text (.cfg) and the prefabs, it would be possible to generate a maze (or only parts of it) and then feed it to the map generator. I'm working on the middle ware, so to speak, but the editor front is atm out of my scope.

 

Could you maybe explain more what you mean?

"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

Oh, I thought your generator totally randomly generates dungeon. When we worked on Tomes of Mephistopheles, user could only specify the size of the dungeon (and number of floors, which we never implemented) and generator would build totally random dungeon based on the grid (512 x 512 as I recall) using pre-made architectural pieces. Each piece was pre-made as a cell (floor, walls, ceiling; or floor and walls; or walls only). All pieces were classified, so that certain pieces were put together, but not the others.

 

The idea was that eventually we had a unique scenes made, with markers to where hallways would connect. So when generator would build a maze, it would use unique scenes as reference points and build mazes from the entrances/exits to those scenes. By "scene" I mean a whole room pre-made, like a throne room. It would never change its shape, only items could be randomly placed inside.

 

I thought your generator works like that.

Link to comment
Share on other sites

No, the generated works in two stages:

  1. The user builds prefabs (either walls, floor, etc. , or items, or group of items, or entire rooms, there is no limit on what a prefab can be)
  2. The user builds a map that says which prefab goes where.
  3. The map generator assembles an FM from the two infos from 1: and 2: above

There are currently two ways the map can be specified:

  1. by the user as drawn ASCII map
  2. Generated by a script or editor (these do not yet exist, but since they only need to generate textoutput, it is possible to build them)

The "generate a random maze" or "generate a random room" step would be the job of the editor.

 

The map generator that generates the FM has also a few randomization pieces build in:

  1. premade: either the user specifies some randomness in the prefabs (50% or X% chance that prefab Y is included - the generated map always has it, or not)
  2. dynamic: the generated entities have a random chance to appear when the map first loads (each play of the FM will be different)

So far both do not really change the layout of the map - although I had some ideas about "fake walls" that can spawn or not, and thus make the map be different when you replay it. But this is not totally dynamic.

 

Of course, there is much work left to do, and help would always be welcome.

"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

Here is more info: http://swift-mazes.com/

 

if there is something missing, I need to improve the documentation :)

"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

Oh, so it's not random at all :(

 

It is already randomly in the things it places, but not yet the overall map layout. It is important to give mappers full control - if you achive that, adding random generation later is easy. If everything is random from begin, giving mappers control later is hard.

 

Anyway, full level randomnes can be easily done externally. I have written a script which turns generated mazes into levels :) Like from this: http://www.billsgames.com/mazegenerator/

 

Think of Swift Mazes right now as a tool like DR - it takes mapper input and turns it into a level - but it can be automated easily. Nothing prevents anyone from building a tool that randomly place rooms and passeges and feeds to output to SM to actually generate the map.

 

It works a bit like the Unix philosophy - each tool does one job and you can chain them together.

"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

Here is a simple test. I used this online maze generator (text mode, 2x2 for each block, 30x15 blocks, random seed 1):

 

http://www.delorie.c...zes/genmaze.cgi

 

The resulting maze was closed (added | at the top left and button right, added E (player start east) and X (level end) and inserted it into an empty cfg file. Result:

 

http://swift-mazes.c...smtest_maze.cfg

 

Run perl swift.pl smtest_maze.cfg:

 

 

 

te@te:~/src/swift/mazes$ perl swift.pl smtest_maze
Including projects/default/strings.cfg
Including projects/default/prefabs.cfg
Including projects/default/symbols.cfg
Creating location 0
Creating level 0 for location Maze
Parsing map for level 0 from Maze
 creating prefab corner_ne parent empty
Reading /home/te/src/swift/tod/prefabs/corner_ne.pfb
Reading /home/te/src/swift/tod/prefabs/corner_nw.pfb
Reading /home/te/src/swift/tod/prefabs/corner_se.pfb
Reading /home/te/src/swift/tod/prefabs/corner_sw.pfb
Reading /home/te/src/swift/tod/prefabs/floor.pfb
Reading /home/te/src/swift/tod/prefabs/ceiling.pfb
Player start 1, 1, 0 => 0° for difficulty 7, chance 1.
Reading /home/te/src/swift/tod/prefabs/wall_south.pfb
Reading /home/te/src/swift/tod/prefabs/wall_north.pfb
Reading /home/te/src/swift/tod/prefabs/wall_west.pfb
Reading /home/te/src/swift/tod/prefabs/chain_bent_east.pfb
Reading /home/te/src/swift/tod/prefabs/chain_bent_west.pfb
Reading /home/te/src/swift/tod/prefabs/chain_bent_south.pfb
Reading /home/te/src/swift/tod/prefabs/chain_bent_north.pfb
Reading /home/te/src/swift/tod/prefabs/wall_east.pfb
Reading /home/te/src/swift/tod/prefabs/exit_stairs_south.pfb
Merging alias level blocks in all locations.
Creating world #0.
Fitting locations to world 0.
Adding location 0 to world #0.
Processing links from location 0.
Adding info_location to 1, 1, 0 'E' 0
Adding player ambient light '0.1, 0.1, 0.2' to location Maze (0)
Adding player fog '-1, -1, -1' (radius -1, strength -1) to location Maze (0)
Including file script/swift_main.script
Generating connectivity map for world #0:
Building blocklist done, have 900 blocks.
Propagating visportals to neighbouring blocks... done.
Auto-visportaling world done, flagged 597 possible new visportals.
Optimizing auto-visportals
 Pass #1.
 Pass #2.
 Pass #3.
done, left with 323 possible new visportals.
Adding auto-visportals
Reading /home/te/src/swift/tod/prefabs/visportal_east.pfb
Reading /home/te/src/swift/tod/prefabs/visportal_south.pfb
done, took 0.222s, added 323 new visportals.
Map center 0,0,-100
Map size 11328, 5952, 390, -5664, -2976, -6056, 5664, 2976, -5666
Building world #0
Building location Maze (0)
Map contains 0 secret areas.
Adding player start at -5568, 2880, -5861 0°
Writing /home/te/games/tdm/fms/smtest_maze/maps/smtest_maze.map
Writing /home/te/games/tdm/fms/smtest_maze/maps/smtest_maze.darkradiant
Building script file for project (0 random_calls).
Writing /home/te/games/tdm/fms/smtest_maze/maps/smtest_maze.script
Writing /home/te/games/tdm/fms/smtest_maze/xdata/smtest_maze.xdata
Writing /home/te/games/tdm/autocommands.cfg
Writing /home/te/games/tdm/currentfm.txt
Launching TDM to dmap...done, dmap took 26.13 seconds.
Removing /home/te/games/tdm/autocommands.cfg
Writing /home/te/games/tdm/fms/smtest_maze/darkmod.txt
Writing /home/te/games/tdm/fms/smtest_maze/startingmap.txt
Writing /home/te/games/tdm/fms/smtest_maze/script/tdm_custom_scripts.script
Warning: File /home/te/games/tdm/fms/smtest_maze/maps/smtest_maze.aas32 not found for PK4
Warning: File /home/te/games/tdm/fms/smtest_maze/maps/smtest_maze.aasrat not found for PK4
Warning: File /home/te/games/tdm/fms/smtest_maze/maps/smtest_maze.aas100 not found for PK4
Packaging english.lang
Packaging german.lang
Packaging /home/te/games/tdm/fms/smtest_maze/darkmod.txt as darkmod.txt
Packaging /home/te/games/tdm/fms/smtest_maze/startingmap.txt as startingmap.txt
Packaging /home/te/games/tdm/fms/smtest_maze/xdata/smtest_maze.xdata as xdata/smtest_maze.xdata
Packaging /home/te/games/tdm/fms/smtest_maze/script/tdm_custom_scripts.script as script/tdm_custom_scripts.script
Packaging /home/te/games/tdm/fms/smtest_maze/strings/fm/english.lang as strings/fm/english.lang
Packaging /home/te/games/tdm/fms/smtest_maze/strings/fm/german.lang as strings/fm/german.lang
Done, took 36.55 seconds.

 

 

 

The entire process too literally 5 minutes. The result is a 5 Mbyte map file with 7575 brushes and 1351 entities:

 

post-144-0-12346700-1412857063_thumb.jpg

"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

And here is a screenshot from ingame (noclip, showPortals 1 and increased ambient light):

 

post-144-0-20664000-1412858248_thumb.jpg

"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

Should I try to redo my little map editor thing, if this project and your free time are alive again?

 

I'm currently in the process to make it easier for map editors to generate the config (e.g. no more drawing ASCII maps), but that still needs a bit of work. Plus, the backend takes a lot more work, too. Sorry, but the break did threw me off track for a long time.

"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 currently in the process to make it easier for map editors to generate the config (e.g. no more drawing ASCII maps), but that still needs a bit of work. Plus, the backend takes a lot more work, too. Sorry, but the break did threw me off track for a long time.

 

post-3727-0-00762300-1412858839.png

  • Like 1
Link to comment
Share on other sites

jaxa, maybe we should discuss this in PM? I have a few changes planned for easier editors. Have you ever tried the editor from Legend of Grimrock? I think they used a good model and would try to start with that :)

"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 have not used the Grimrock editor. The basic editor I posted two years ago was cobbled together from an earlier project that was able to handle "layers" of sprites (it was all images rather than ASCII) and transparent shadows as well. I'm willing to attempt whatever you want to do, so feel free to PM me at any time.

Edited by jaxa
Link to comment
Share on other sites

I'm planning a release of the framework (base scripts and entities), the generator (Perl scripts and libraries) and an example map.

 

Is anybody actually interested in that? My last call for alpha testers went unhead, so I'm a bit wary to spent the time to prepare a public release...

"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 planning a release of the framework (base scripts and entities), the generator (Perl scripts and libraries) and an example map.

 

Is anybody actually interested in that? My last call for alpha testers went unhead, so I'm a bit wary to spent the time to prepare a public release...

 

Seems not.. back to the drawing board then...

"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

Sounds interesting.

 

I think that this could work for some dungeon-based FM's. It's easy to imagine it for some mysterious Ctulhu-like mystified story.

 

Are you doing this alone?

"I really perceive that vanity about which most men merely prate — the vanity of the human or temporal life. I live continually in a reverie of the future. I have no faith in human perfectibility. I think that human exertion will have no appreciable effect upon humanity. Man is now only more active — not more happy — nor more wise, than he was 6000 years ago. The result will never vary — and to suppose that it will, is to suppose that the foregone man has lived in vain — that the foregone time is but the rudiment of the future — that the myriads who have perished have not been upon equal footing with ourselves — nor are we with our posterity. I cannot agree to lose sight of man the individual, in man the mass."...

- 2 July 1844 letter to James Russell Lowell from Edgar Allan Poe.

badge?user=andarson

Link to comment
Share on other sites

Speaking of Procedural dungeon generators.

There's an interesting game that came out with a similar design philosophy.

 

Turned out pretty well to be honest: http://store.steampowered.com/app/252570/

"I really perceive that vanity about which most men merely prate — the vanity of the human or temporal life. I live continually in a reverie of the future. I have no faith in human perfectibility. I think that human exertion will have no appreciable effect upon humanity. Man is now only more active — not more happy — nor more wise, than he was 6000 years ago. The result will never vary — and to suppose that it will, is to suppose that the foregone man has lived in vain — that the foregone time is but the rudiment of the future — that the myriads who have perished have not been upon equal footing with ourselves — nor are we with our posterity. I cannot agree to lose sight of man the individual, in man the mass."...

- 2 July 1844 letter to James Russell Lowell from Edgar Allan Poe.

badge?user=andarson

Link to comment
Share on other sites

Are you doing this alone?

 

Unfortunately, yes :ph34r: Help is always welcome. :)

 

Speaking of help, currently missions have to be created as text files. That is cumbersome, errorprone and not fun at all. Plus, only experts would be able to do it.

 

So I started a new side-project to create a graphical editor. The current plan is to have it run in the browser, with server-side support for save, load and dmap missions, as well as downloading the generated PK4 files.

 

It's too early to really show off, but rest assured work continues in the background :)

"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

Work on the editor continues. Instead of taking shortcuts I'm doing it "right", which means it goes a bit slower than I want, but it has the benefit that the code is much more cleaner and re-usable.

 

Anyway, the latest additions are:

  • a dialog that shows the current keybindings (note: They are dynamically generated, and updated automatically, f.i. when the menus get changed, or the language switches)
  • Selection tracking. You can use LMB (left mouse) to select one block, Shift LMB to select multiple, and Ctrl to deselect blocks.
  • Started some basics fror the renderer, prefab, map, block and location storage

Screenie:

 

post-144-0-72101700-1414677819_thumb.jpg

 

Please try it, and tell me what you think. (And no, it is not yet possible to actually edit or generate a map - I'm working on it ;)

  • Like 1

"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

  • 3 years later...

Can we get a dump of everything related to this project (code included) so it isn't lost to the sands of time?

 

If Terminator comes from the dead yes. :D

"I really perceive that vanity about which most men merely prate — the vanity of the human or temporal life. I live continually in a reverie of the future. I have no faith in human perfectibility. I think that human exertion will have no appreciable effect upon humanity. Man is now only more active — not more happy — nor more wise, than he was 6000 years ago. The result will never vary — and to suppose that it will, is to suppose that the foregone man has lived in vain — that the foregone time is but the rudiment of the future — that the myriads who have perished have not been upon equal footing with ourselves — nor are we with our posterity. I cannot agree to lose sight of man the individual, in man the mass."...

- 2 July 1844 letter to James Russell Lowell from Edgar Allan Poe.

badge?user=andarson

Link to comment
Share on other sites

  • 5 years later...

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

    • nbohr1more

      TDM 15th Anniversary Contest is now active! Please declare your participation: https://forums.thedarkmod.com/index.php?/topic/22413-the-dark-mod-15th-anniversary-contest-entry-thread/
       
      · 0 replies
    • JackFarmer

      @TheUnbeholden
      You cannot receive PMs. Could you please be so kind and check your mailbox if it is full (or maybe you switched off the function)?
      · 1 reply
    • OrbWeaver

      I like the new frob highlight but it would nice if it was less "flickery" while moving over objects (especially barred metal doors).
      · 4 replies
    • nbohr1more

      Please vote in the 15th Anniversary Contest Theme Poll
       
      · 0 replies
    • Ansome

      Well then, it's been about a week since I released my first FM and I must say that I was very pleasantly surprised by its reception. I had expected half as much interest in my short little FM as I received and even less when it came to positive feedback, but I am glad that the aspects of my mission that I put the most heart into were often the most appreciated. It was also delightful to read plenty of honest criticism and helpful feedback, as I've already been given plenty of useful pointers on improving my brushwork, level design, and gameplay difficulty.
      I've gotten back into the groove of chipping away at my reading and game list, as well as the endless FM catalogue here, but I may very well try my hand at the 15th anniversary contest should it materialize. That is assuming my eyes are ready for a few more months of Dark Radiant's bright interface while burning the midnight oil, of course!
      · 4 replies
×
×
  • Create New...