Jump to content


Photo

Procedural dungeon (crawler) generation (swift mazes)

swift mazes dungeon crawler

73 replies to this topic

#51 motorsep

motorsep

    Advanced Member

  • Member
  • PipPipPip
  • 884 posts

Posted 08 October 2014 - 09:56 AM

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

#52 Tels

Tels

    Mod hero

  • Member
  • PipPipPipPipPip
  • 15024 posts

Posted 08 October 2014 - 10:20 AM

@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

#53 motorsep

motorsep

    Advanced Member

  • Member
  • PipPipPip
  • 884 posts

Posted 08 October 2014 - 10:37 AM

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.

#54 Tels

Tels

    Mod hero

  • Member
  • PipPipPipPipPip
  • 15024 posts

Posted 08 October 2014 - 12:46 PM

No, the generated works in two stages:
  • 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)
  • The user builds a map that says which prefab goes where.
  • 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:
  • by the user as drawn ASCII map
  • 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:
  • 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)
  • 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

#55 Tels

Tels

    Mod hero

  • Member
  • PipPipPipPipPip
  • 15024 posts

Posted 08 October 2014 - 12:47 PM

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

#56 motorsep

motorsep

    Advanced Member

  • Member
  • PipPipPip
  • 884 posts

Posted 08 October 2014 - 01:35 PM

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

#57 Tels

Tels

    Mod hero

  • Member
  • PipPipPipPipPip
  • 15024 posts

Posted 09 October 2014 - 06:28 AM

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.billsgame.../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

#58 Tels

Tels

    Mod hero

  • Member
  • PipPipPipPipPip
  • 15024 posts

Posted 09 October 2014 - 07:18 AM

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:

Spoiler


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

2014-10-09_maze.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

#59 jaxa

jaxa

    Advanced Member

  • Member
  • PipPipPip
  • 1305 posts

Posted 09 October 2014 - 07:24 AM

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

#60 Tels

Tels

    Mod hero

  • Member
  • PipPipPipPipPip
  • 15024 posts

Posted 09 October 2014 - 07:37 AM

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

2014-10-09_maze_ingame.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

#61 Tels

Tels

    Mod hero

  • Member
  • PipPipPipPipPip
  • 15024 posts

Posted 09 October 2014 - 07:38 AM

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

#62 jaxa

jaxa

    Advanced Member

  • Member
  • PipPipPip
  • 1305 posts

Posted 09 October 2014 - 07:47 AM

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.


ss+(2014-10-09+at+07.46.24).png
  • Tels likes this

#63 Tels

Tels

    Mod hero

  • Member
  • PipPipPipPipPip
  • 15024 posts

Posted 09 October 2014 - 07:58 AM

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

#64 jaxa

jaxa

    Advanced Member

  • Member
  • PipPipPip
  • 1305 posts

Posted 09 October 2014 - 09:41 AM

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, 09 October 2014 - 09:42 AM.


#65 Tels

Tels

    Mod hero

  • Member
  • PipPipPipPipPip
  • 15024 posts

Posted 09 October 2014 - 10:32 AM

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

#66 Tels

Tels

    Mod hero

  • Member
  • PipPipPipPipPip
  • 15024 posts

Posted 17 October 2014 - 06:42 AM

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

#67 nbohr1more

nbohr1more

    Darkmod PR, Wordsmith

  • Development Role
  • PipPipPipPipPip
  • 8866 posts

Posted 17 October 2014 - 08:39 AM

I've been wrapped up in the engine discussion but I'd love to try this.
Please visit TDM's IndieDB site and help promote the mod:

http://www.indiedb.c...ds/the-dark-mod

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

#68 Anderson

Anderson

    Advanced Member

  • Member
  • PipPipPip
  • 1015 posts

Posted 18 October 2014 - 04:12 PM

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.

 


#69 Anderson

Anderson

    Advanced Member

  • Member
  • PipPipPip
  • 1015 posts

Posted 20 October 2014 - 12:49 PM

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.steampo...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.

 


#70 Tels

Tels

    Mod hero

  • Member
  • PipPipPipPipPip
  • 15024 posts

Posted 25 October 2014 - 09:23 AM

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

#71 Tels

Tels

    Mod hero

  • Member
  • PipPipPipPipPip
  • 15024 posts

Posted 30 October 2014 - 09:04 AM

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:

2014-10-30_darkmatter_selection.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 ;)
  • Anderson likes this
"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

#72 jaxa

jaxa

    Advanced Member

  • Member
  • PipPipPip
  • 1305 posts

Posted 30 October 2014 - 09:51 AM

http://swift-mazes.com/dm.html
  • Tels likes this

#73 jaxa

jaxa

    Advanced Member

  • Member
  • PipPipPip
  • 1305 posts

Posted 02 January 2018 - 01:53 PM

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



#74 Anderson

Anderson

    Advanced Member

  • Member
  • PipPipPip
  • 1015 posts

Posted 02 January 2018 - 02:28 PM

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.

 




Reply to this topic



  


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users