Building the Adventure

An .WLA adventure file is simply an allegro Datafile Archive. It's a group of files made with the "dat.exe" tools. Think of it like a zip file. During the editing process, the files of the adventure are stored in a directory and are easily accessible. Then the build.sh or build.bat script can be executed to automatically compress all those files together into one .wla file.

The adventure files should be stored in a subdirectory with the name of the adventure. When the script is run, it takes the name of the subdirectory and create a .wla file of the same name in the /adventure directory. On windows, it will simply create an adventure.wla file. Rename it to what ever you want. The original expanded adventure files are not lost. But if they are modified, you need to call the build script again.

When creating a new adventure, it is advised to copy the /adventure/template directory into a new subdirectory of the name of the adventure you want. The template directory contains the strict minimum and the scripts to be able to build and adventure.

Adventure File Content

Here is a list of the files you are going to find in the template directory which are going to be combined as an adventure.

database.sqlite: This file is basically the SQL database. It holds many information relative to the game like classes, races, item templates, spells. But it also has empty tables which are going to be used through the game like characters, active effects, generated items, etc. You can open this file with any SQLITE editor to change the values if you want. Certain adventure elements like events will require database editing. Certain elements like textures are set up with the texture editor in the game.

maze.bin: This file contains the layout of the maze. The only way to actually edit this file is through the maze editor in the game. It's a blob of bits unreadable to the human eye. So the editor is essential.

credits.txt: This is a plain text file where you can place your credits for the design of the adventure. This text file will be appended to the game's credit when showing the ending of the game. The width is limited, so make sure you do not exceed the width of the ruler. The credits will end with the credits ending code at the end of the file. If you remove this piece of code, the credits will scroll indefinitely. (maybe I should code a safe guard for it.

Sub Datafiles

In order for adventure designers to add their own artwork and textures, the adventure manage sub datafiles which are in fact archives within archives. When the adventure is loaded, the sub datafiles are loaded and hooked at the reight place in the game (ex: textures with textures). So that they can now be available during the adventure editing.

Sub datafiles are actually a subdirectory where the files will be located. The script will generate a .dat archive will all the files in the directory. Then the .dat files will be added to the .wla archive afterward. Belowe you can see the list of sub datafiles, it should increases has the game development progress.

img_story.dat: Contains the artwork to draw during the introduction story and the ending story. The picture used is determined in the database with the picture ID field of the text table.

Loading Adventures

In the editor

When in the maze editor, if you load an adventure, you will select a directory. You need to manually copy the template directory to another name first as the editor does not do that. When the adevnture is loaded, it will load the database and the maze. Eventually, it will load textures and additional pictures that could be needed by the editor.

The editor basically manage the maze. But sometimes it requires information from the database. For example, when you want to hook up an event in the maze, it will take a look at the database to pull you out a list of events that you can chose from. This is why loading the database is mandatory for certain operations.

In the game

When a new game is created, the adventure is read. The database is duplicated and saved in the /savegame folder. So the savegame is a copy of the database inside the adventure. When the game is loaded, it will load the content of the adventure like the maze and sub datafile, and it will use the same game as a database. It will not use the adventure database anymore.

This implises that if you start a game. Any modification made the the database in the adventure will have no impact on the saved game. You need to start a new game in order for the changes to apply. Else the save game will simply be a copy of the old database ignoring any new modification you have made in the adevnture. Else, you need to make the modifications in the save game too.