Getting Started

There are really two ways to make a game with Dagon. One is by working with the uncompiled C++ files in a program like Microsoft Visual C++ Express 2010. The second is by building “on top” of the Dagon teaser and gradually substituting your assets and scripts for the Asylum files. This information covers the second option.

  1. Download the latest release of Dagon, which is in the form of the Asylum teaser and unzip it. It’s available here -->

  2. Play the Asylum demo. To do this, just double click the Dagon.exe. file. You’ll see that Asylum is a series of “steps” through 360 degree nodes. It also utilizes overlays, animations, sound, and particle effects. When you’ve familiarized yourself with Asylum, press ESC to exit the demo.

  3. Open up the Asylum folder folder and take a look at the file structure in the folder. You can read the Cfg file and all of the Lua files with a simple text editor or better yet in LuaEdit 2010 ( or Notepad++ ( Agustin has heavily commented the files.

  4. Again, to use the engine for your own game, you’re going to build on top of the Asylum teaser, gradually adding your files and removing the Asylum files. So first, copy the entire Asylum teaser folder to a location of your choice and rename it. Rename the copy folder to the name of your game.

  5. Open up the Dagon.cfg file. The Cfg file sets up some of the global basics for the game such as the control mode for navigation, screen display characteristics, effects, subtitles, etc. For now, I’d just open your text editor and change debugMode from false to true. This will allow you to see and use the in-game editor, by pressing either the Tab or the tilde (~) keys when the game is running in Dagon. Also, change the name of the script to the name of your game. Save and close.

  6. The main Lua file is named Asylum.lua. Rename it to the name of your game and open it up in your text editor. This file first loads the modules that control the Intro and Readme overlays and the other modules that control doors, text and audio feedback, and initiate the journal overlay, among other functions. It also allows you to adjust effects, the uses for your hotkeys, font for the Journal module, cursors, and background music or ambience. In this file Dagon also creates the Intro and Readme modules and takes care of updating and resizing these components and the Journal. It defines the right click function of the mouse to toggle the journal or journal icon to be hidden or visible. Finally, it loads the nodes of your first room, switches you to it, and starts the intro overlay, which plays on top of it. Once you’ve made a few nodes and room files you’ll change “Cafeteria” to your first room.

  7. In the Modules folder, are Lua files which implement several important features, some of which are specific to Asylum. These are complex, but customizable, and thankfully are heavily commented by Agustin. These files, of course, work in tandem with the code that you’ll add to your room files.

English contains the text and references to the corresponding audio for the feedback that appears to the player on the bottom of the screen when hotkeys or spots are clicked. It also contains the text for the journal. When feeds, leads, thoughts, or notes are attached to hotspots in your room files, the text is found here. Hotspots are multifunctional in Dagon and are simply called “spots.”

Intro contains the splash screen, title, and credits that appear as an overlay at the start of the game.

Journal controls the journal overlay and its icon, how they toggle open and closed, resize to fit the player’s screen, and add in the lines of text. In the Asylum teaser, the journal functions as both journal and inventory. The central section on “Entry management methods” contains functions that are referenced in your room files when items are added or used.

Notes contains functions relating to specific items in the journal module.

Readme contains the two-page Readme overlay, which plays when “Reminder” is clicked on the Journal.

Tools contain the functions for the hotkeys (gamma, snapshot, and camera speed) and the doors. Note in the addDoor function how the parameters are set and compare them to how a door in one of the rooms is created. This piece of code cuts down on a great deal of code in the rooms. Note also why your doors’ audios and videos need to be named as they are in the Resources folders. The section “asynchronous comment” specifically refers to the key to the cell door, which is picked up in the Infirmary and used there on the cell door. The text for the key which appears in the journal depends upon whether or not the player has discovered what the key can be used for.

  1. Before you can go very much further, you’re going to need to add in some assets and to get access to the wiki. For access to the wiki, first make an account at It’s free and there is no need to set up repositories, just make an account name. Contact Agustin with your account name to be added to the Senscape organization on github.

  2. Next explore the folders within the Resources folder to add in your assets -
    Audio must be in Ogg format and Videos in Ogv. Some of these files also have a naming convention that must be followed in order for them to work properly in Dagon. These are the audio files that begin with door_, lead_comment_, lead_feed_, lead_note, and step_ and the Video files that begin with door_.

Cursors are Tga format with transparency, 128 x 128 pixels, 72 dpi. Fonts are TrueType.

Nodes represent the “steps” within each room and these are in the Tex format, which is native to Dagon. To make each node you’ll need to render out a cubic panorama as six 2048 x 2048 sides in Tga format. You can use 512 x 512, 1024 x 1024, etc., but Dagon currently calculates using the 2048 x 2048 sizing, so beware. The method for creating these cubic panoramas varies from program to program. Examples in Blender, Vue d’Esprit, and Thea are covered on the wiki ( … -Cube-maps). You’ll need to combine and convert the Tgas to Tex format with the ksconvert.exe utility and this is also described on the wiki ( … rt-Utility).

The images folder contains various image files in jpg, png, or tga format used for as overlays. This includes the images needed for any module overlays such as the journal, intro, and readme, as well as the patches used on spots.

  1. The Rooms folder contains a Lua file for each area in your game. In each room file you’ll add and connect the nodes, add music or ambience, and add in the interactivity and puzzles that make up the bulk of your game. At this point, I’d suggest looking at Cafeteria.lua carefully and reading Agustin’s comments, then running Dagon.exe in the Asylum teaser and seeing the results of the code. Do this with each room to understand by example how each bit works. There is much more information on the wiki, but hopefully, this will be enough to get you started.

Nice overview Imari! Gives that specific feel for getting started that isn’t too dry and official.
Why don’t you post this in the Wiki? IMHO one of the main reasons wiki’s don’t get any respect as official documentation is that people rely on the forums too much, (don’t want to RTFM) and posters that don’t focus on the wiki just end up feeding into that. I think forums should be good places for questions AFTER people have read the wiki.
Not to denigrate your effort btw! But I’ve been on so many forums where the wiki is just half-assed and documentation (especially for newbies) is mainly LOTS and LOTS of questions on the forums. Like standing at a cocktail party of university professors and attempting to get a BA in history by asking questions.
It’s all about corporate culture, and we are on the ground-breaking committee. The inertia we create now will determine how the future of this open-source project grows…

Just a follow up to last post.
There are two kinds of people: those who want to learn as they go and those who want to inhale all the info and once before starting. I’m of the latter and I think that most people are of the former, so I just want to apologize for sounding like everybody should be like me. :oops:

Hi, shadowphile. :slight_smile:

I plan to add the above plus a couple of other bits into the wiki, but I just didn’t have the time to fight Markup today. :wink: I’ll try to place them properly into your nice framework.