RGSS

Last updated

RGSS (Ruby Game Scripting System) is a scripting language based on the object-oriented programming language Ruby. It has been developed specifically for use in the RPG Maker series of role-playing game creation software.

Contents

Features

Language versions

The following language versions are integrated into three RPG Maker versions:

Software versionRGSS versionRuby versionNotes
RPG Maker XP RGSS1.8.1Referred to as RGSS1 in this article.
RPG Maker VX RGSS21.8.1
RPG Maker VX Ace RGSS31.9.2p0

Yukihiro Matsumoto stated in his diary, "RPG Maker XP apparently comes with Ruby 1.8.1 (with the regular expression engine Oniguruma) built in under the name RGSS. I am proud to see 'Ruby (c) 1993-2003 Yukihiro Matsumoto All Rights Reserved' written in small letters." [2]

The later version released in 2015, RPG Maker MV, switched to a JavaScript-based game engine, and so only the three language versions above are available.

RGSS1

RGSS1 is the first version of RGSS integrated into RPG Maker XP.

Specifications

  • Fixed display resolution of 640×480 pixels.
  • Frame rate: internal processing runs at 40 frames per second (fps), while rendering occurs at 20fps (or 40fps with "smooth mode").
  • If Graphics.update is not called for over 10 seconds, a Hangup exception is triggered.
  • In debug mode, the variable $DEBUG is set to true. This may cause the game to behave differently than in normal gameplay, especially when dealing with threads.

Modules

  • Audio: Handles sound output, including playing background music (BGM) and sound effects (SE).
  • Graphics: Manages screen rendering, frame updates, transitions, and visual effects.
  • Input: Processes input from the keyboard and gamepad.
  • RPG: Contains classes that represent game data such as actors, items, skills, and enemies.
  • RPG::Cache: Caches bitmap images to improve performance and reduce memory usage during gameplay.
  • Zlib [3] : Handles the "Zlib" library for data compression and decompression.

Classes

  • Display & Graphics
    • Bitmap: Represents a bitmap image for drawing text, shapes, and sprites.
    • Color: Defines RGBA color values for tinting and blending graphics.
    • Font: Controls font properties like size, style, and typeface for text rendering.
    • Plane: A sprite type that tiles a repeating pattern, commonly used for fog or panoramic backgrounds.
    • Rect: Represents a rectangle for defining areas within bitmaps or screen regions.
    • Sprite: Handles 2D image rendering.
    • Tone: Controls color tone adjustments.
    • Viewport: Defines a viewport, which is a rendering area for sprites.
    • Window: Creates UI windows composed of multiple sprites.
  • Exception handling
    • Hangup [3] : An exception triggered in RGSS1 scripts when Graphics.update hasn’t been called for a prolonged period.
    • Reset [3] : An exception triggered when the F12 key is pressed. This exception cannot be caught with the rescue clause.
    • RGSSError: An exception for RGSS-specific errors, such as accessing a disposed bitmap.
  • Data & Game Systems
    • Table: A multi-dimensional array for storing numerical data. Supports up to three dimensions and is faster than standard arrays.
    • Tilemap: A kind of sprite displaying map tiles based on data from the map editor.
    • TilemapAutotiles: Used internally by Tilemap to manage auto-tiling behavior. Not typically accessed directly.
    • RPG::Sprite: Extends Sprite with added functions commonly used in games.
    • RPG::Weather: Manages weather effects like rain, snow, and fog.
  • OS Access

RGSS2

RGSS2 is the second version of RGSS integrated into RPG Maker VX .

Changes

  • The default screen size is 544×416 pixels, and it can be resized during runtime. The startup resolution is fixed.
  • Frame rate upgraded to 60fps; "smooth mode" removed.
  • No exceptions occur if Graphics.update delays.
  • Fonts can now load from files inside the game folder.
  • The Tilemap class was significantly revamped. Other game libraries and data structures were also partially altered.
  • In debug mode, $TEST = true; $DEBUG is unaffected.
  • Not fully compatible with scripts written for RGSS1.

Modules

  • Audio: Handles sound output, including playing background music (BGM) and sound effects (SE).
  • Graphics: Manages screen rendering, frame updates, transitions, and visual effects.
  • Input: Processes input from the keyboard and gamepad.
  • NKF [3] : A Ruby module handling "Network Kanji Filter" (NKF) for Japanese character encoding conversion.
  • RPG: Contains classes that represent game data such as actors, items, skills, and enemies.
  • Zlib [3] : Handles the "Zlib" library for data compression and decompression.

Classes

  • Display & Graphics
    • Bitmap: Represents a bitmap image for drawing text, shapes, and sprites.
    • Color: Defines RGBA color values for tinting and blending graphics.
    • Font: Controls font properties like size, style, and typeface for text rendering.
    • Plane: A sprite type that tiles a repeating pattern, commonly used for fog or panoramic backgrounds.
    • Rect: Represents a rectangle for defining areas within bitmaps or screen regions.
    • Sprite: Handles 2D image rendering.
    • Tone: Controls color tone adjustments.
    • Viewport: Defines a viewport, which is a rendering area for sprites.
    • Window: Creates UI windows composed of multiple sprites.
  • Exception handling
    • Reset [3] : An exception triggered when the F12 key is pressed. This exception cannot be caught with the rescue clause.
    • RGSSError: An exception for RGSS-specific errors, such as accessing a disposed bitmap.
  • Data & Game Systems
    • Table: A multi-dimensional array for storing numerical data. Supports up to three dimensions and is faster than standard arrays.
    • Tilemap: A kind of sprite displaying map tiles based on data from the map editor.
  • OS Access
    • Win32API [3] : A Ruby class allowing access to Windows API functions.

RGSS3

RGSS3 is the third version of RGSS integrated into RPG Maker VX Ace.

Changes

  • Ruby upgraded from 1.8.1 to 1.9.2p0, improving interpreter speed and string processing.
  • Encrypted archive format changed, reducing game startup time.
  • Not fully compatible with scripts written for RGSS1 or RGSS2.

Applications

Basically, all RPG Maker games using the XP, VX, and VX Ace engines are programmed with RGSS.

Programmers use RGSS to modify the preset scripts provided at the beginning and build systems not possible with event commands alone.

It is also possible to build scripts for your favorite game system from scratch without using any of the preset scripts. Though RGSS is tailored for role-playing games, it can also be used to create games in other genres, such as action titles.

As for the previous versions of RPG Maker without RGSS, it was not easy to freely resize text, customize menus, or create enemies with extremely high hit points (e.g., 10 quadrillion). Event commands could handle such cases, but often resulted in complex and inflexible code lacking versatility.

However, by using RGSS, the game data can be rewritten at the script level, eliminating the need to call up special events, making production much smoother.

There are many websites that host custom RGSS scripts, and most of them are easy to use and designed to be copy-pasted directly into the preset scripts.

Drawbacks

Debugging difficulties
Beginners have a hard time finding the cause of errors when they occur. Even in the previous versions of RPG Maker, bugs caused by the way events were organized could be hard to figure out. Moreover, with RGSS, there is also the risk of Ruby syntax errors occurring. The default error dialog only displays the bare minimum of error messages, making it difficult for beginners to understand what they mean at first glance.
Custom script conflicts
When you use multiple custom scripts obtained from websites, they may conflict with each other and not work properly. These scripts may redefine some of the class methods defined in the preset scripts. Therefore, when you use two or more scripts that relate to the same classes or methods, the expected functionality of the scripts may be impaired due to the existence of classes or methods with features different from those assumed in each script. To avoid such conflicts resulting from method overriding, script authors often alias existing methods or use custom namespaces. Both techniques have pros and cons, and so integrating scripts distributed on the Internet requires careful consideration.

Game libraries

There are many Ruby-based game libraries as follows:

See also

Footnotes

  1. This setting can be changed by editing the "Game.ini" file.
  2. Matsumoto, Yukihiro (2004-07-17). "Matzにっき(2004-07-17)". MatzNikki (in Japanese). Retrieved 2025-07-11.
  3. 1 2 3 4 5 6 7 8 These classes and modules are not documented in the reference manual and other documents that come with RPG Maker.