RGSS Specifications

Starting a Game

Game folder

Normally, you launch RGSS by double-clicking the icon for the game file, Game.exe (or Game if the Windows option "Hide extensions for known file types" has been turned on). The folder that contains this file is called the game folder.

In-progress games can be started up by selecting [Playtest] from the menu or [Battle Test] from the Troop database. In both cases, the game will start in debug mode, and the built-in Ruby variable $DEBUG will be set automatically. While battle testing, the variable $BTEST will also be set to true.

Game operation is specified in Game.ini, the configuration file.

Game.ini

The Game.ini file is automatically created and updated by RPGXP. It can also be edited manually with Notepad or another text editor.

Example:

[Game]
Library=RGSS100J.dll
Scripts=Data\Scripts.rxdata
Title=RubyQuest
RTP1=Standard
RTP2=
RTP3=
Library

The name of the RGSS DLL. This file is usually installed in the Windows system folder.

If there's a DLL specified in the game folder, it will be given precedence.

Scripts

The data file in which scripts are stored, specified with a path relative to the game folder.

Ruby's scripts usually take the form of text files with the extension .rb, but RGSS uses one proprietary packaged file. This file cannot usually be edited without using RPGXP's script editor. The data is comprised of multiple sections and is executed in the listed order, as displayed.

Title

The game title, displayed in the game window's title bar.

RTP1
RTP2
RTP3

The title of the RGSS-RTP the game is using. If the specified RTP isn't installed, an error message will be displayed.

If you place an RGSS DLL (specified by Library) in the game folder without specifying an RTP, you can create a game that doesn't require RTP to be installed. This distribution method isn't actively recommended, but it might be advantageous when a large majority of the materials used are original creations.

RGSS-RTP

RTP (Run Time Package) is a mechanism that reduces game data size for distribution. RTP contains standard graphics and audio files used across many different games. Installing these materials as a common file before playing a game eliminates the need to download duplicate files over and over.

The RGSS-RTP configuration file can use the following methods from the built-in game library to access files as though they were in the game folder. The extensions can be left off the file names that are passed to the methods below--their file types (such as .png or .mid) are identified automatically.

Bitmap.new, Audio.bgm_play, Audio.bgs_play, Audio.me_play, Audio.se_play, Graphics.transition

Installation Data

RPGXP's default RTP is the single "Standard" type, but structurally speaking, you can use multiple RTPs at the same time. If you know how to make an installer, follow these steps to create a unique RTP at the user level. However, using common names for RTP titles, such as "Extension", is not recommended; they might conflict with the names of new, official RTPs in the future.

By default, RTP is installed in the following folder:

[CommonFilesFolder]\Enterbrain\RGSS\[RTPName]
Here, [CommonFilesFolder] is the location of the Windows "Common Files" folder, while [RTPName] is the name of the RTP. Here's an example:
C:\Program Files\Common Files\Enterbrain\RGSS\Standard

The RTP installer creates a string value containing the RTP name in the "HKEY_LOCAL_MACHINE\SOFTWARE\Enterbrain\RGSS\RTP" registry key and uses it to set the path. RGSS recognizes the string specified in this key as the RTP.

Encrypted Archives

Encrypted archives make it difficult for others to analyze and/or rebuild the game contents. Normally all data and graphic files (not audio files) are stored in Game.rgssad. You can create an encrypted archive by checking the [Create encrypted archive] box when compressing the game data.

The files within the encrypted archive can use the following methods from the built-in game library to access files as though they were in the game folder:

load_data, Bitmap.new, Graphics.transition

When there is an encrypted archive in the game folder, the script data (normally Data\Scripts.rxdata) defined in the Scripts line of Game.ini will always be read from the archive. This is a limitation that prevents files within the archive from being read by an external script.

Due to its nature, the encrypted archive's internal format has not, and will not, been released to the public. Please refrain from analyzing it.

Other

Character Set

RGSS uses the UTF-8 character set. UTF-8 is a way of encoding Unicode, a character set that can display letters and characters from all the world's languages.

Ruby's built-in variable $KCODE (not included in this reference) is set to "UTF8" by default. RPGXP's script data and all other string data are also in UTF-8, so you don't have to worry about any encoding conflicts as you build your game.

However, to guarantee proper operation, you should not create games that include characters only available in Unicode, as Windows 98 and Windows Me do not support it.

Smooth Mode

RGSS games usually run at 20 frames per second, but you can check [Smooth Mode] in the game's Properties to run it at a 40 fps framerate instead. This is why the scripts move at an internal rate of 40 fps whether [Smooth Mode] is on or off. Be aware that most values, like wait length, will be handled as though they've been doubled.

You can change the framerate with Graphics.frame_rate.

Properties

The term "property" is used in the game library overview. This is not a concept in Ruby's specifications, but rather a term unique to RGSS.

For example, this is how to obtain and set a sprite's x-coordinate (Sprite#x):

x = sprite1.x         # obtain
sprite2.x = x + 32    # set

For the sake of convenience, methods that are defined to both obtain (read) and set (write) via assignment operators in this way are called "properties".

Converted from CHM to HTML with chm2web Pro 2.85 (unicode)