Saturday 15 August 2015

The Dynamic Dungeon

This week I have been plotting out a series of ideas for how to add interactivity to the dungeon. Often the dungeon can feel flat and lifeless, an empty husk used simply as a container for enemies to wait to be slaughtered. I wish to dismiss this feeling and make the dungeon seem just as dynamic as its denizens. So to do that the player needs to feel that the dungeon itself can be interacted with, and the dungeon needs to change in meaningful ways in reaction. A few methods are outlined below:
  • Destructible Walls - Many roguelikes include the ability to dig through walls, allowing the player to tailor the dungeons layout to their needs. However this provides complications with many pieces of content where the entrance/exit are well defined, and the ability to enter at any point breaks it. This tends to be countered by 'undiggable' wall types.
  • Traps - A staple of roguelikes, traps activate some affect when triggered, often by being stepped onto. The most common traps are single tile direct damage traps, though more complicated setups are sometimes used. These can often feel cheap, as their short range nature require tricks to get the player to step onto them, like making them invisible.
  • Puzzles - An interconnected series of things that interact in some way, the a solution that provides some form of reward. An excellent method for adding interactivity to the dungeon. The issue being that generating a good, interesting puzzle can be very hard.
As interesting as these would be to add it was not what I started with. So the first task I completed towards dungeon interactivity is a thing I like to call 'Fields'.
Fields are a single tile area of some substance, that interact with other Fields (and the entities within them) in some fashion. For example a Fire that can be put out by pouring water onto it, turning the water into steam. These fields can be placed in the level by various methods, from an entities death (a spore releasing a cloud of poison gas on death), to a dungeon feature (smashing a fountain releasing a constant stream of water).

Like everything else in my game the fields are data driven, having a series of data points that define their properties. They are as follows:
  • Field name - This is the name of the field, used for checking if a neighbouring field is the same as this one
  • Tags - A list of tags that define the properties of the field, using for the interaction map (Examples are Hot, Cold, Gas, Poison, Explosive).
  • Stacks - A value representing the strength of the field.
  • Layer - The field 'layer' it exists on. Currently I have Ground and Air.
  • Duration Style - This defines its lifespan. I currently use Permanent, Fade (slowly reduces the stacks until the field disappears) and Collide (disappears on first collision with an entity).
  • Spread Style - This defines how the field spreads. I use Flow (flows out down the 'stacks' gradient), Adjacent (spreads to nearby tiles with stuff in them), Wander (randomly wanders around) and None (doesnt spread)
  • Field Interactions - A map of field name or tag to an interaction event. Currently supported interactions are Spawn (spawn a field of the specified type) or Propogate (applies some effect to every field tile joined to the src tile).
  • OnTurn - A list of effects to apply every turn. Examples are Damage and Healing. 

An example of spreading fire:











Water putting out fire and turning into steam:











Lightning hitting water and propogating through it:

No comments:

Post a Comment