Dagon Overview - Senscape/Dagon GitHub Wiki

The Main Elements of Dagon

The Virtual Enviroment

Dagon is for creating adventure games, and those can often be thought of as a collection of places to move between. From a certain perspective, there is a nesting of places in Dagon from largest to smallest:

Rooms->Nodes->Slides->Spots

  • Rooms contain the largest regions and have the least detail. They can be assigned sounds, a collection of Nodes or Slides, their own timers to spontaneously trigger things, and that is about it.

  • Nodes are the heart of Dagon. Nodes must always be created inside a room. The panoramic display can only show Nodes. They can be assigned many things like sounds, timed events, mini-images, mini-video patches, various cursor images, spots, etc. All of these elements are tied to the panoramic viewer that is the core display element of Dagon.

  • Slides are a special category in Dagon. They are the 2D equivalent of a Node but also have attributes of 2D Screen Graphics (more on that later). Because they are simpler, they can have many of the same elements as a Node but not all. They are listed here as ‘smaller’ than Nodes because they are often used to zoom in statically on a detail image in a node, although it’s possible to describe an entire game that navigates directly from one Slide to another to mimic an old-fashioned click & slide style game with no panoramic viewing at all. Slides are also ideal for non-environment user interface backdrops for preferences and such. (See 2D Screen Graphics later)

  • Spots are very flexible and powerful. Without spots a game would at most be nothing but a virtual tour of a static place, moving from one place to another.
    A Spot is a region in the virtual display of the node (or a region in a Slide image) that has an arbitrary shape to define a clickable-space or location for audio.
    A node (or Slide) can have an many spots are desired.
    Spots roll-up a variety of things the designer might want to do within a specific region of the virtual background or Slide image.

  • Spots have a clickable zone, with an arbitrary shape described by a closed outline of connected lines.

  • Spots can be given an action when clicked. There are some pre-built actions, or custom script can be called.

  • Spots can be used to change small areas (a static image) of the background during game play.

  • Spots can be used to animate small areas (a mini-video) of the background during game play.

  • Spots can be used to locate a sound that moves with a panoramic node direction. Spot audio files are always mono so that Dagon can pan it from speaker to speaker in sync with the view direction.

  • Spots can be programmatically changed by the script to change behavior during play. With mouse interaction alone, clicking on spots can define virtually the entire interaction of a game.

2D Screen Graphics

The Environment described above is intended to describe the virtual world of the game. But games need graphics strictly limited to the computers display screen, which is where the 2D graphics library comes into play.
These are used to overlay flat elements that stick with the screen and do not move with the environment. They can also be visualized as a hierarchy of elements, though not as complicated as the environment graphics.

Slides -> Overlays -> Images & Buttons

  • Slides were described previously for in-game elements that need a 2D touch, but can also provide a 2D background for menus, preferences, credits, logos, etc. Because they overlap functions with in-game context and all they offer (node jumping, etc), they can be used to build, for example, a jump-map to anywhere in the environment without the use of overlays or buttons.

The key similarity between the Node and Slide is that both provide the ultimate background. If 2D elements need to be overlayed onto these (still visible and active) backgrounds, then use Overlays, Images and Buttons. Also worth remembering is that Screen FX (but not Camera FX) will overlay a Slide image, which would generally not be desired for menus and such.

  • Overlays are simply containers for collections of Images and Buttons. They can be moved about the screen, or turned off or on. Any Images or Buttons assigned to an overlay will move with it. They have no visibility or size themselves, but are more like an invisible hand. Moving the overlay will move all of its collection. Disabling an overlay will make all of its elements disappear.

  • Images are simply 2D pictures used to show graphical elements. They can be turned on or off, moved about (relative to its parent overlay), layered on top of each other, caused to fade in or out, and that is about it.

  • Buttons are like Images but they can also be assigned special cursors when hovered over, respond to clicks to perform some function, disabled or enabled, given timers, or be assigned sounds.

With this set of elements it is possible to create almost anything required for the game, even an entire 2D game if so desired, although that would ignore a large part of the Dagon Engine.

Some examples of common game elements that would use these elements:

  • Standalone:
  • An inventory system.
  • A journal for recording and displaying notes.
  • Reading books or literature.
  • Puzzles.
  • Closeup interaction with equipment.
  • A mapping system.
  • Displaying credits
  • Showing popup menus
  • In cooperation with the panoramic navigation:
  • A live compass
  • A handheld detector of some sort
  • A GPS unit
  • As an overlay encompassing the entire panoramic screen while navigating:
  • A night-vision bezel
  • View through a helmet
  • View through a telescope
  • A heads-up-display with scores, icons, etc like World of Warcraft.

Screen Effects

Screen effects cover the entire screen of the node display (not the 2D graphics) and provide various visual distortions, movement or brightness/color changes as desired. Some of them affect the screen pixels individually, like noise or brightness changes, and some of them affect the player's view, causing special motions like breating or involuntary 'scared' movements.

Screen Text

For dialogue, thoughts, reminders, or any kind of need to display text, there is a system to manage libraries of text and display them or or any text sentence on the screen, at the bottom. Text scrolls up and fades out as it builds up. The built-in 'Feed' system that manages screen text also has libraries of text to manage dialogue, and also allows the simultaneous playing of a sound. The intention is to both read and hear dialogue, although other uses like an audio 'stab' with certain alarming text is one idea.

To bring it all together, here is an illustration of how the various elements are related:

Nesting of Locations in Dagon

This illustration describes how the various graphical elements are stacked up according to how they are seen:

Visual Layers

Audio

A game wouldn't be any good without sound and Dagon has a simple system for adding as much sound as you want.

  • Audio resources are always stored in the Resources/Audio sub-folder.
  • All audio files should be in the Ogg Vorbis format (.ogg or .oga) in single-channel only.

Audio is always brought into the script as an 'Audio object'.

  • The Audio object can be ‘attached’ to almost anything so that it will have its own related sound(s).
  • The same Audio 'object' is the basis for all sounds, be they voices, sound effects, music, background sounds, or user-interface feedback like beeps or clicks.
  • Rooms, Nodes, Slides and Spots can each have their own sounds.
  • Rooms and Nodes can also have their own footstep sound for when movement occurs.
  • Repetitive sounds can be triggered by Dagon timers or more sophisticated forms of script gymnastics.
  • Music sounds can be triggered manually in the script, often in layers that can fade in or out as the scene requires.
  • Buttons can be assigned a sound that can be used as a default click, usually for buttons that actually look and act like real buttons or switches.
  • Multiple audio objects can be started and stopped, or forced to synchronize.

Details of how audio is used in specific situations is fully described in the relevant sections later.

Timers

Without control over time, a game would be totally lax and only react to the player, never taking action on its own. No spontaneous sounds, no way for the game to bring a real-time dimension to the experience. More later....


Modules

To extend the power of Dagon and allow would-be game designers more flexibility to customize their games, there are some pre-rolled LUA modules that can be used as-is or modified as desired.
These are described in the Scripting with Dagon section.