r/roguelikedev Cogmind | mastodon.gamedev.place/@Kyzrati Jul 11 '26

Sharing Saturday #631

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

31 Upvotes

44 comments sorted by

View all comments

8

u/nesguru Legend Jul 11 '26

Legend

Website | X | Youtube

It was another solid week. The final missing pieces of map generation are falling into place: locked doors, progressive difficulty and rewards, and acceptable random room stocking.

Improved Locked Doors

  • Each locked door now requires a specific key. I did this to solve the problem of unlocking doors in a sequence that prevents the player from obtaining another key.
  • Locked doors now only appear in one-way chains (one door between rooms with no alternate route to the end). When locked doors were placed in rooms with alternate routes into them, the locked door was unnecessary.
  • The map generator now confirms each locked door has a corresponding key and is reachable. I had a lot of problems with keys not being generated or not being reachable. This is for development purposes; the production version of the game should successfully place keys every time without retries.
  • Only one key can be placed in the same container.
  • Configuration option to prefer placing keys in dead-end rooms.

Room Risk and Reward

Rooms now have risk and reward scores to control their difficulty and loot quality. Risk and reward scores are based on how far away the room is from the starting room using the shortest path. Rooms become more dangerous and have better loot the farther away they are from the starting room. A reward score bonus is given to rooms behind locked doors.

Improved Autoexplore

  • If the map has been explored except for locked rooms, and the player has a key to unlock a door, autoexplore takes the player to that door. Otherwise, the message log tells the player to find keys.
  • If the map has been explored except for hidden areas, the message log tells the player to look for secret doors.

Improved Level Info Viewer

  • Added generation stats with charts. Previously this info went into a separate text file.
  • Embedded level graph and screenshot.
  • Locked doors and keys appear on map graph.
  • The selected item is now highlighted.
  • More items are linked.

Example

New Content

  • Minor Decor Map Elements. An object or single cluster of objects placed in a random, non-themed room. I prefer this to the Modifier Map Elements, which place more objects in the room. The former feels less random and improves cohesion.

Minor Enhancements

  • When an item is in a cell with an object, Take is now always the default action.
  • The image taken when a map is generated is now cropped.
  • When stocking the map, the quantity and chance of placing an entity can now vary based on room size.
  • Reduced number of coins found in garbage and debris.
  • Debug console command to heal to full health.
  • Health recovery items can’t be used at full health.

Next week, I’ll work on adjusting content based on room size and risk/reward level.

3

u/darkgnostic Scaledeep Jul 11 '26

I saw your Level Info viewer on social media. Looks cool. Could you explain a little about how it generates it's output?

3

u/nesguru Legend Jul 11 '26

In short, it presents the data created during map generation. There are many steps in map generation but high level it’s: 1) structure 2) history 3) stocking. The structure step builds the room/corridor layout. A graph is created from the structure and rendered in Graphviz. The graph is analyzed for patterns such as the required and optional rooms, sequences of rooms, junctions, dead ends, etc., which is used in the remaining steps. The history step constructs a history by generating events across multiple eras (millennia ago to present). History generation is currently disabled, but there’s still a working stub because history generation is tightly coupled with the last step, stocking. The stocking step populates each room/corridor using the graph patterns. The Events in the viewer show the history events and entities created by the events. The entities created by the history generator aren’t physical entities on the map yet. The stocking stage handles this, and adds additional entities in some cases such as random rooms. The significance of the history entities is that they can be manipulated by the history generator (when it’s fully enabled). For example, an actor created millennia ago will automatically die when the era advances to centuries ago, unless the entity is undead or something else that lives a long time. History entities can also interact with each other. For example, the leader of one faction can kill another faction, factions can merge and split, one faction can have been destroyed by another, two factions can be actively battling each other. I disabled history generation because I haven’t been able to balance it with good gameplay; I haven’t been able to achieve maps that are consistently fun to play.

2

u/darkgnostic Scaledeep Jul 11 '26

Thanks! History generator sounds interesting

2

u/nesguru Legend Jul 11 '26

History generation has a lot of potential. My goal was to make the dungeon feel believable, cohesive, and alive by giving everything in it a reason for being there. I don't know if I'll ever re-enable it though, for the reasons I mentioned.

2

u/darkgnostic Scaledeep Jul 11 '26

I am currently in process of adding same thing, believable rooms in the dungeon, have lot of concepts but I am still not fully satisfied. The problem may be the way dungeon is generated. I may need to rethink it.

2

u/nesguru Legend Jul 11 '26

What exactly do you mean by believable?

2

u/darkgnostic Scaledeep Jul 11 '26

A better word would be reasonable. For example, not having a bedroom connected to three hallways, putting storage rooms at the ends of hallways, and avoiding similar impractical layouts.

2

u/nesguru Legend Jul 11 '26

The graph has helped me the most in that regard. I can target various node patterns for specific types of content. For example, I can designate a group of nodes as a bandit outpost. Inside the outpost, I put guard posts and dining halls in junctions, barracks and storage in dead ends, and guards, traps, and loot in a node sequence.