Adventure Games and Interactive Fiction

Haul and Pull

by Gamefic on April 18, 2016

The Gamefic project went through a major overhaul this weekend. Most of these changes have been in development for months. Saturday I started merging them into the master branch on the GitHub repo.

Changes to game project structure. Plot scripts use the .plot.rb file extension. (Files with .plot and .rb extensions can still be imported, but .plot.rb is preferred.) All scripts reside in the scripts directory by default, including the main and test scripts that used to be in the source directory's root.

Another major change that breaks backwards compatibility: plots now use "script" instead of "require" to import scripts. Although "require" seemed more intuitive, the differences in how it works within the context of a plot carried too much potential for confusion.

Web skins. I'm concentrating on two skins right now: standard and minimal. The standard skin is a simple but robust skin that is suitable for most parser games and includes automated links for multiple-choice scenes. The minimal skin contains the bare minimum required for a parser-based game.

New features for the Web platform. One of my longstanding goals has been to improve and streamline the process for building web games. This release includes several important steps in that direction. HTML files are now generated from ERB templates and a config file that defines required assets. With the config file, developers can explicitly define what assets should be included from the SDK.

The JavaScript API for integrating web apps with games has been reduced to a single interface. The implementation in the minimal skin hooks into it with just under 40 lines of code. The standard implementation isn't much more complicated, with about 20 additional lines of code to add multiple-choice hyperlinks.

Documentation. I've started adding YARD comments for classes and methods.

Upcoming Changes and New Features

There are only a few more things I want to finish before releasing version 1.0 of Gamefic and the SDK.

Additional skins. Two or so more web skins with more support for hypertext and multimedia.

Improved scene management. Scenes are one of the more powerful aspects of Gamefic, but they're also one of the hairiest. The helper methods (scene, multiple_choice, etc.) hide some of the complexity but introduce warts of their own.

More documentation. Everything from YARD comments to tutorials and code samples.

In other news, work on the IDE continues. I'm using it now for nearly all of my Ruby and Gamefic development. At this point it consists of two major components: Gamefic Studio, the IDE that integrates with the SDK; and Solargraph, a general-purpose IDE for Ruby. With any luck I'll be able to release early versions of both later this year.