top of page
Kyle and Rich

Generating Believable Rooms


February ended up being a busy month for us. So, we skipped our regular blog post. The last month has been focused on improving and polishing our room decorating systems and increasing our prison biome’s room diversity. In this post we take a look at some of our latest room decoration work with some screenshots.

First, let’s talk about how we define a decorator. A decorator is a static object that can be placed into the world on a floor or wall tile. Decorators have the following properties:

  • Graphics / Animations

  • Sound Effects (Ambient / Triggered Events)

  • Tags

  • Light Source Definitions

  • Burn / Destruction rules and events

  • Pathing rules

  • Projectile rules

  • Visibility rules / Z ordering

  • Flow Properties

  • Generation placement restrictions

  • Event Triggers

  • Companion Decorators

Once you have decorators defined they need to be placed in room definitions in order to appear in the game. Our previous procedural generation posts touched on room generation to some degree. The basic idea is to take a defined rectangle of tiles, consider it a “room”, and then procedurally populate it with decorators and NPCs in an interesting way. A room’s definition dictates the number of floor decorators, wall decorators, NPCs, ..etc that can spawn in that room type. Rooms can then be associated with a “Room Set”. A Room Set is a list of room definitions and their chances of spawning when that set is called by generation. Room Sets are then assigned to biomes to be spawned as part of the generation process.

One of the first problems we ran into with decorations is that while they make the game visually appealing they can cause some pathing issues. For example, when decorators block doors or hallways. One way we improved this was to define per decorator restrictions. For instance, shelves and bookcases have a restriction that forces them to only spawn when there are 3 adjacent wall tiles. This prevents those decorators from spawning in front of doors. Next we made many decorators destructible when attacked. This means that even if a decorator blocks your path, you can easily clear the obstruction. Making decorators destructible also allows us to spawn events like loot drops, explosions, ..etc leading to more interesting game-play and decision trees. Basically any decorator can now be used as an event trigger or produce chain reactions of destruction. They can also be used to hide from ranged attacks or to keep an enemy at distance during a fight.

Another issue we ran into had to do with implementing variety. Initially we were individually listing each decorator that could spawn in each room. When room generation is choosing what decorators to spawn it picks randomly from a list of all decorators for that room and then attempts to place it. Because of this, if you want to include decorator variations, you would be unintentionally increasing the chance of those decorators spawning since there would be multiple entries in the list. For this reason we added a feature that allows us to add decorators by tag. Now, if we have 30 different blood splatter decorators, we can tag those decorators as “blood splatter” and add one decorator entry to the room decoration list for “tag: blood splatter”. Now, when the room rolls on the list of decorators and hits the “tag: blood splatter” entry it will choose from the list of all 30 decorators tagged as “blood splatter”. Since all decorators can have multiple tags this can lead to a more curated decoration experience while still allowing for aesthetically pleasing variations.

Another big change is adding companion decorators. Companion decorators are a configuration of a single decorator such that when it spawns it can include other decorators in adjacent tiles. A good example of this is rugs. For a 3x2 tile rug to spawn, the top center tile is placed by the room generation process and the rest of the rug arrangement is filled in by companions. This is also used for large tables or campfires with sleeping bags around it.

Another special type of decorator, similar to companions, is “Flow Decorators”. Flow decorators, like companions, are placed as a single source tile. From that source tile, other decorators can be placed in a radius out from the source in any pathable tiles. The decorators that flow out from the source can be chosen by tag or explicitly defined. This is how we place water tiles that seem to flow from pipes on the wall or generate patches of grass, flowers, or mushrooms.

Overall, our goal is to do as much with our procedural generation systems as possible. There are times, however, where a more human touch may be necessary. For that purpose we retain the ability to create custom rooms by hand and seed them into the generation algorithm. This allows us to create rare unique experiences that can offer curated challenges and rewards to discover.

We’re always looking to improve our systems and create a more interesting game-play experience. Feel free to reach out to us on Twitter or Reddit with your thoughts. We’re looking forward to getting Much Dungeon into your hands as soon as possible.

Love Always,

Much Software

38 views0 comments

Recent Posts

See All

Comments


bottom of page