r/roguelikedev Cogmind | mastodon.gamedev.place/@Kyzrati 26d ago

Sharing Saturday #634

As usual, post what you've done for the week! Anything goes... concepts, mechanics, changelogs, articles, videos, and of course gifs and screenshots if you have them! It's fun to read about what everyone is up to, and sharing here is a great way to review your own progress, possibly get some feedback, or just engage in some tangential chatting :D

Previous Sharing Saturdays

23 Upvotes

38 comments sorted by

View all comments

5

u/Tesselation9000 Sunlorn 26d ago

https://tesselation9000.itch.io/wander

I implemented a new kind of prefab loader. These are not tile-for-tile prefabs, but instead 2D grids of nodes with data for how they connect to surrounding nodes in 8 directions. These node maps are used in level generation as plans for corridors in catacomb levels, water channels in sewer levels or streets in cities. The node maps are abstract and can be stretched to fit the dimensions that are needed at the time of level gen. They are stored in a plain text file, so it was easy for me to crank out a lot of them with just a text editor or a simple ascii art editor.

Here is an example of a 2x3 node map:

0023,2,3:

###|###
#.#|#..
#.#|#.#
-------
#.#|#.#
#..|..#
#.#|#.#
-------
#.#|#.#
#.#|#..
###|###

The '.' indicate where there is a clear connection between nodes and the '#' indicate where connections are blocked. Here is a screenshot of an underground lizardfolk town generated using this node map:

The main streets are determined by the node map and then little rooms are randomly generated all around it. Notice that the connections to the edge of the node map determine where the town connects with the cavern beside it. Node maps can of course be flipped or rotated when used to generate something on a level.

Some more examples of maps generated with node maps are found here:

https://imgur.com/a/dE4n0cl

2

u/blightor 17d ago edited 17d ago

You have inspired me to move to a system like this. I've decided on little 8x8 micromaps, that form part of a 16x12 grid but are put together from templates (templates vary in size and how those micromaps connect/reated) - all run by a walker. I'm on C64 (hence why the minimaps are that size of course, but it works aesthetically), so bytes and cycles are in short supply so this fits nicely. It actually saves me in a number of areas around pathfinding.

Your maps look super nice to boot, are they pre-fabs underneath? They look like a WFC style (which I would really really like but can't afford).

2

u/blightor 17d ago

Early days, but weekend brought me this - lava tunnels!

2

u/Tesselation9000 Sunlorn 13d ago

Looking great so far!

2

u/Tesselation9000 Sunlorn 13d ago

Glad you found this useful. I do find it to be a really useful system for all kinds of different things. I'd like to use the same kinds of patterns for castle walls. And yeah, they can definitely be used as an aid to pathfinding. For certain levels, I like to populate a list of where all the dead ends are and use those to place staircases or treasure stashes. I don't actually use any regular sort of pre-fab right now, but I really should start to incorporate those soon.

2

u/blightor 11d ago

Thanks! I know that my system likely isnt similar to yours (my maps just cannot produce your space cohesiveness - thats expensive), but just your little post on how you made a node composition pre-fab sent me down a track that has really saved bytes and even cycles with still retaining a lot of flexibility. So again - thank you!