Getting Started with Dagon in Windows - Senscape/Dagon GitHub Wiki
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.
-
Download the latest release of Dagon, which is in the form of the Asylum teaser and unzip it. It's available here --> http://www.FaceThehorror.com/teaser.
-
Play the Asylum demo. To do this, just open up the folder and 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.
-
Open up the Asylum folder again and take a look at the file structure. The Cfg file and all of the Lua files can be read with a simple text editor or better yet in LuaEdit 2010 (http://luaedit.sourceforge.net/) or Notepad++ (http://notepad-plus-plus.org/). Agustin has heavily commented the files.
-
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.
-
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.
-
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.
-
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.
-
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 github.com. 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.
-
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 (All About 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 ([[ Making bundled .tex files with KSConvert 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.
- 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.
Imari 11-3-2012