rough translation
New page
'''RGSS (Ruby Game Scripting System)''' is a [[scripting language]] developed by expanding the capabilities of the [[Object-oriented programming|object-oriented]] [[programming language]] [[Ruby (programming language)|Ruby]]. It is a Ruby implementation created specifically for use in the ''[[RPG Maker]]'' series of [[role-playing game creation software]].
The following language versions are integrated into three ''RPG Maker'' versions:
{| class="wikitable"
|+
!Software version
!RGSS version
!Ruby version'''<ref>[http://www.rubyist.net/~matz/20040717.html#p01 Matzにっき(2014-07-17)] 「RGSSなる名称でRuby 1.8.1(正規表現エンジンは[[鬼車 (ライブラリ)|鬼車]])が組み込まれているそうだ。」(2017年10月29日閲覧)</ref>'''
!Notes
|-
|[[RPG Maker XP|''RPG Maker XP'']]
|RGSS
|1.8.1
|Referred to as RGSS1 in this article.
|-
|''[[RPG Maker VX]]''
|RGSS2
|1.8.1
|
|-
|[[RPG Maker VX Ace|''RPG Maker VX Ace'']]
|RGSS3
|1.9.2p0
|
|}
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 in existence.
== Features ==
* Its syntax adheres closely to [[Ruby syntax|Ruby]] [[Ruby syntax|syntax]], allowing developers with Ruby experience to write scripts with ease.
* It introduces custom game-specific classes and modules. Most Ruby standard libraries are not bundled, and must be obtained separately if needed.
* Games run via the [[executable]] <code>Game.exe</code>, which includes the Ruby interpreter and definitions for built-in classes and modules.
* Scripts are executed after loading from the data file that is stored in the project folder as:<ref>Game.ini の書き替えによって変更可能。</ref>
** ''XP'': Data\<code>Scripts.rxdata</code>
** ''VX'': Data\<code>Scripts.rvdata</code>
** ''VX Ace'': Data\<code>Scripts.rvdata2</code>
== Language versions ==
=== RGSS1 ===
RGSS1 is the first version of RGSS integrated into [[RPG Maker XP|''RPG Maker XP'']].
==== Specifications ====
* Fixed resolution of 640×480 pixels.
* Processing runs at 40fps; [[Rendering (computer graphics)|rendering]] at 20fps (or 40fps with "smooth mode").
* If <code>Graphics.update</code> isn’t called for over 10 seconds, a <code>Hangup</code> exception occurs.
* In debug mode, the variable <code>$DEBUG</code> is set to <code>true</code>, which may affect gameplay behavior, especially with thread handling.
==== Modules ====
* <code>Audio</code>: Handles sound output, including playing [[background music]] (BGM), [[Sound effect|sound effects]] (SE), and more.
* <code>Graphics</code>: Manages screen rendering, frame updates, transitions, and [[visual effects]].
* <code>Input</code>: Processes input from the keyboard and gamepad, allowing detection of key presses and directional input.
* <code>RPG</code>: Contains classes that represent game data such as actors, items, skills, and enemies, which are linked to the database entries in ''RPG Maker''.
* <code>RPG::Cache</code>: Caches bitmap images to improve performance and reduce memory usage during gameplay.
* <code>Zlib</code><ref name="NoDoc2">ツクールに添付されているリファレンスマニュアルなどには記載されていない。</ref>: Provides compression and decompression functionality. Though normally a Ruby library, it’s embedded in RGSS by exception.
==== '''Classes''' ====
* Display & Graphics
** <code>Bitmap</code>: Represents a bitmap image. Used for drawing text, shapes, and sprites.
** <code>Color</code>: Defines RGBA color values. Used for tinting and blending graphics.
** <code>Font</code>: Controls font properties like size, style, and typeface for text rendering.
** <code>Plane</code>: A type of sprite that tiles a repeating pattern across the screen. Commonly used for fog or panorama effects.
** <code>Rect</code>: Represents a rectangle. Used for defining areas within bitmaps or screen regions.
** <code>Sprite</code>: Handles rendering of 2D images that can be moved, rotated, and layered.
** <code>Tone</code>: Controls color tone adjustments such as brightness, contrast, and hue shifts.
** <code>Viewport</code>: Defines a rendering area for sprites. Useful for layering and camera effects.
** <code>Window</code>: Creates UI windows composed of multiple sprites. Used for menus, dialogs, and system messages.
* [[Exception handling (programming)|Exception handling]]
** <code>Hangup</code><ref name="NoDoc2" />: Exception triggered in RGSS1 scripts when <code>Graphics.update</code> hasn’t been called for a prolonged period.
** <code>Reset</code><ref name="NoDoc2" />: Exception triggered when the F12 key is pressed. Cannot be caught with <code>rescue</code>.
** <code>RGSSError</code>: A general exception class for RGSS-specific errors, such as accessing a disposed bitmap.
* Data & Game Systems
** <code>Table</code>: A [[multi-dimensional array]] optimized for storing numerical data. Supports up to three dimensions and is faster than standard arrays.
** <code>Tilemap</code>: Displays map tiles based on data from the map editor. Essential for rendering game environments.
** <code>TilemapAutotiles</code>: Used internally by <code>Tilemap</code> to manage auto-tiling behavior. Not typically accessed directly.
** <code>RPG::Sprite</code>: Extends <code>Sprite</code> with game-specific functionality, such as displaying characters or enemies.
** <code>RPG::Weather</code>: Manages weather effects like rain, snow, and fog.
* OS Access
** <code>Win32API</code><ref name="NoDoc2" />: Allows access to [[Windows API]] functions. Embedded by exception for advanced system-level operations.
=== RGSS2 ===
RGSS2 is the second version of RGSS integrated into ''[[RPG Maker VX]]''.
==== Changes ====
* Default resolution: 544×416 pixels; in-game resizing supported (startup resolution is fixed).
* Frame rate upgraded to 60fps; "smooth mode" removed.
* No exceptions occur if <code>Graphics.update</code> delays.
* Fonts can now load from files inside the game folder.
* The <code>Tilemap</code> class was significantly revamped.
* In debug mode, <code>$TEST = true</code>; <code>$DEBUG</code> is unaffected.
==== Modules ====
* <code>Audio</code>: Handles sound output, including playing background music (BGM), sound effects (SE), and more.
* <code>Graphics</code>: Manages screen rendering, frame updates, transitions, and visual effects.
* <code>Input</code>: Processes input from the keyboard and gamepad, allowing detection of key presses and directional input.
* <code>NKF</code><ref name="NoDoc2" />: Allows manipulation of [[Character encoding|character encodings]], such as [[Shift JIS]] and [[UTF-8]], from within RGSS2 scripts.
* <code>RPG</code>: Contains classes that represent game data such as actors, items, skills, and enemies, which are linked to the database entries in ''RPG Maker''.
* <code>Zlib</code><ref name="NoDoc2" />: Provides compression and decompression functionality. Though normally a Ruby library, it’s embedded in RGSS by exception.
==== '''Classes''' ====
* Display & Graphics
** <code>Bitmap</code>: Represents a bitmap image. Used for drawing text, shapes, and sprites.
** <code>Color</code>: Defines RGBA color values. Used for tinting and blending graphics.
** <code>Font</code>: Controls font properties like size, style, and typeface for text rendering.
** <code>Plane</code>: A type of sprite that tiles a repeating pattern across the screen. Commonly used for fog or panorama effects.
** <code>Rect</code>: Represents a rectangle. Used for defining areas within bitmaps or screen regions.
** <code>Sprite</code>: Handles rendering of 2D images that can be moved, rotated, and layered.
** <code>Tone</code>: Controls color tone adjustments such as brightness, contrast, and hue shifts.
** <code>Viewport</code>: Defines a rendering area for sprites. Useful for layering and camera effects.
** <code>Window</code>: Creates UI windows composed of multiple sprites. Used for menus, dialogs, and system messages.
* Exception handling
** <code>Reset</code><ref name="NoDoc2" />: Exception triggered when the F12 key is pressed. Cannot be caught with <code>rescue</code>.
** <code>RGSSError</code>: A general exception class for RGSS-specific errors, such as accessing a disposed bitmap.
* Data & Game Systems
** <code>Table</code>: A multi-dimensional array optimized for storing numerical data. Supports up to three dimensions and is faster than standard arrays.
** <code>Tilemap</code>: Displays map tiles based on data from the map editor. Essential for rendering game environments.
* OS Access
** <code>Win32API</code><ref name="NoDoc2" />: Allows access to [[Windows API]] functions. Embedded by exception for advanced system-level operations.
=== RGSS3 ===
RGSS3 is the third version of RGSS integrated into [[RPG Maker VX Ace|''RPG Maker VX Ace'']].
==== Changes ====
* Ruby upgraded from 1.8.1 to 1.9.2p0, improving interpreter speed and enhancing string processing.
* Encrypted archive format changed, reducing game startup time.
* Not fully compatible with scripts written for RGSS1 or RGSS2.
== Applications ==
All ''RPG Maker'' games using the ''XP'', ''VX'', ''VX Ace'' engines are fundamentally programmed with RGSS.
Programmers typically modify preset scripts to create systems not possible with event commands alone.
It is possible to build an entirely original game system from scratch using RGSS, bypassing all default scripts. Though RGSS is designed for RPGs, it can also create other [[Video game genre|video game genres]], such as [[Action game|action games]].
Before the introduction of RGSS, it was difficult to freely resize text, customize menus, or create enemies with absurdly high [[hitpoints]] (e.g., 10 [[quadrillion]]). Event commands could handle such cases, but often resulted in complex and inflexible setups. With RGSS, game logic can be rewritten at the script level, streamlining development.
Many websites now host custom RGSS scripts, most of which are designed to be copy-pasted directly into ''RPG Maker'' projects. These scripts empower users to significantly enhance gameplay without writing code from scratch.
== Drawbacks ==
* [[Debugging]] difficulties: Debugging is hard for beginners. Error messages in Ruby can be cryptic, and ''RPG Maker''<nowiki/>'s default error dialogs are minimal.
* Script conflicts: Combining multiple custom scripts may cause functionality issues due to [[method overriding]]. To prevent this, developers use aliases that rename existing methods before redefining them or namespaces isolating code to avoid collisions. Both techniques have pros and cons, so integrating publicly distributed scripts requires careful consideration.
== Game libraries ==
Many Ruby-based game libraries have been created:
* Miyako
* MyGame
* {{Interlanguage link|Star Ruby (game engine)|lt=Star Ruby|ja|Star Ruby}}
== Footnotes ==
<references />
== External links ==
* [https://tkool.jp/products/rpgxp/index RPGツクールXP]
* [https://tkool.jp/products/rpgvx/index RPGツクールVX]
* [https://tkool.jp/products/rpgvxace/index RPGツクールVX Ace]
* [https://www.ruby-lang.org/ja/ Rubyホームページ]
The following language versions are integrated into three ''RPG Maker'' versions:
{| class="wikitable"
|+
!Software version
!RGSS version
!Ruby version'''<ref>[http://www.rubyist.net/~matz/20040717.html#p01 Matzにっき(2014-07-17)] 「RGSSなる名称でRuby 1.8.1(正規表現エンジンは[[鬼車 (ライブラリ)|鬼車]])が組み込まれているそうだ。」(2017年10月29日閲覧)</ref>'''
!Notes
|-
|[[RPG Maker XP|''RPG Maker XP'']]
|RGSS
|1.8.1
|Referred to as RGSS1 in this article.
|-
|''[[RPG Maker VX]]''
|RGSS2
|1.8.1
|
|-
|[[RPG Maker VX Ace|''RPG Maker VX Ace'']]
|RGSS3
|1.9.2p0
|
|}
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 in existence.
== Features ==
* Its syntax adheres closely to [[Ruby syntax|Ruby]] [[Ruby syntax|syntax]], allowing developers with Ruby experience to write scripts with ease.
* It introduces custom game-specific classes and modules. Most Ruby standard libraries are not bundled, and must be obtained separately if needed.
* Games run via the [[executable]] <code>Game.exe</code>, which includes the Ruby interpreter and definitions for built-in classes and modules.
* Scripts are executed after loading from the data file that is stored in the project folder as:<ref>Game.ini の書き替えによって変更可能。</ref>
** ''XP'': Data\<code>Scripts.rxdata</code>
** ''VX'': Data\<code>Scripts.rvdata</code>
** ''VX Ace'': Data\<code>Scripts.rvdata2</code>
== Language versions ==
=== RGSS1 ===
RGSS1 is the first version of RGSS integrated into [[RPG Maker XP|''RPG Maker XP'']].
==== Specifications ====
* Fixed resolution of 640×480 pixels.
* Processing runs at 40fps; [[Rendering (computer graphics)|rendering]] at 20fps (or 40fps with "smooth mode").
* If <code>Graphics.update</code> isn’t called for over 10 seconds, a <code>Hangup</code> exception occurs.
* In debug mode, the variable <code>$DEBUG</code> is set to <code>true</code>, which may affect gameplay behavior, especially with thread handling.
==== Modules ====
* <code>Audio</code>: Handles sound output, including playing [[background music]] (BGM), [[Sound effect|sound effects]] (SE), and more.
* <code>Graphics</code>: Manages screen rendering, frame updates, transitions, and [[visual effects]].
* <code>Input</code>: Processes input from the keyboard and gamepad, allowing detection of key presses and directional input.
* <code>RPG</code>: Contains classes that represent game data such as actors, items, skills, and enemies, which are linked to the database entries in ''RPG Maker''.
* <code>RPG::Cache</code>: Caches bitmap images to improve performance and reduce memory usage during gameplay.
* <code>Zlib</code><ref name="NoDoc2">ツクールに添付されているリファレンスマニュアルなどには記載されていない。</ref>: Provides compression and decompression functionality. Though normally a Ruby library, it’s embedded in RGSS by exception.
==== '''Classes''' ====
* Display & Graphics
** <code>Bitmap</code>: Represents a bitmap image. Used for drawing text, shapes, and sprites.
** <code>Color</code>: Defines RGBA color values. Used for tinting and blending graphics.
** <code>Font</code>: Controls font properties like size, style, and typeface for text rendering.
** <code>Plane</code>: A type of sprite that tiles a repeating pattern across the screen. Commonly used for fog or panorama effects.
** <code>Rect</code>: Represents a rectangle. Used for defining areas within bitmaps or screen regions.
** <code>Sprite</code>: Handles rendering of 2D images that can be moved, rotated, and layered.
** <code>Tone</code>: Controls color tone adjustments such as brightness, contrast, and hue shifts.
** <code>Viewport</code>: Defines a rendering area for sprites. Useful for layering and camera effects.
** <code>Window</code>: Creates UI windows composed of multiple sprites. Used for menus, dialogs, and system messages.
* [[Exception handling (programming)|Exception handling]]
** <code>Hangup</code><ref name="NoDoc2" />: Exception triggered in RGSS1 scripts when <code>Graphics.update</code> hasn’t been called for a prolonged period.
** <code>Reset</code><ref name="NoDoc2" />: Exception triggered when the F12 key is pressed. Cannot be caught with <code>rescue</code>.
** <code>RGSSError</code>: A general exception class for RGSS-specific errors, such as accessing a disposed bitmap.
* Data & Game Systems
** <code>Table</code>: A [[multi-dimensional array]] optimized for storing numerical data. Supports up to three dimensions and is faster than standard arrays.
** <code>Tilemap</code>: Displays map tiles based on data from the map editor. Essential for rendering game environments.
** <code>TilemapAutotiles</code>: Used internally by <code>Tilemap</code> to manage auto-tiling behavior. Not typically accessed directly.
** <code>RPG::Sprite</code>: Extends <code>Sprite</code> with game-specific functionality, such as displaying characters or enemies.
** <code>RPG::Weather</code>: Manages weather effects like rain, snow, and fog.
* OS Access
** <code>Win32API</code><ref name="NoDoc2" />: Allows access to [[Windows API]] functions. Embedded by exception for advanced system-level operations.
=== RGSS2 ===
RGSS2 is the second version of RGSS integrated into ''[[RPG Maker VX]]''.
==== Changes ====
* Default resolution: 544×416 pixels; in-game resizing supported (startup resolution is fixed).
* Frame rate upgraded to 60fps; "smooth mode" removed.
* No exceptions occur if <code>Graphics.update</code> delays.
* Fonts can now load from files inside the game folder.
* The <code>Tilemap</code> class was significantly revamped.
* In debug mode, <code>$TEST = true</code>; <code>$DEBUG</code> is unaffected.
==== Modules ====
* <code>Audio</code>: Handles sound output, including playing background music (BGM), sound effects (SE), and more.
* <code>Graphics</code>: Manages screen rendering, frame updates, transitions, and visual effects.
* <code>Input</code>: Processes input from the keyboard and gamepad, allowing detection of key presses and directional input.
* <code>NKF</code><ref name="NoDoc2" />: Allows manipulation of [[Character encoding|character encodings]], such as [[Shift JIS]] and [[UTF-8]], from within RGSS2 scripts.
* <code>RPG</code>: Contains classes that represent game data such as actors, items, skills, and enemies, which are linked to the database entries in ''RPG Maker''.
* <code>Zlib</code><ref name="NoDoc2" />: Provides compression and decompression functionality. Though normally a Ruby library, it’s embedded in RGSS by exception.
==== '''Classes''' ====
* Display & Graphics
** <code>Bitmap</code>: Represents a bitmap image. Used for drawing text, shapes, and sprites.
** <code>Color</code>: Defines RGBA color values. Used for tinting and blending graphics.
** <code>Font</code>: Controls font properties like size, style, and typeface for text rendering.
** <code>Plane</code>: A type of sprite that tiles a repeating pattern across the screen. Commonly used for fog or panorama effects.
** <code>Rect</code>: Represents a rectangle. Used for defining areas within bitmaps or screen regions.
** <code>Sprite</code>: Handles rendering of 2D images that can be moved, rotated, and layered.
** <code>Tone</code>: Controls color tone adjustments such as brightness, contrast, and hue shifts.
** <code>Viewport</code>: Defines a rendering area for sprites. Useful for layering and camera effects.
** <code>Window</code>: Creates UI windows composed of multiple sprites. Used for menus, dialogs, and system messages.
* Exception handling
** <code>Reset</code><ref name="NoDoc2" />: Exception triggered when the F12 key is pressed. Cannot be caught with <code>rescue</code>.
** <code>RGSSError</code>: A general exception class for RGSS-specific errors, such as accessing a disposed bitmap.
* Data & Game Systems
** <code>Table</code>: A multi-dimensional array optimized for storing numerical data. Supports up to three dimensions and is faster than standard arrays.
** <code>Tilemap</code>: Displays map tiles based on data from the map editor. Essential for rendering game environments.
* OS Access
** <code>Win32API</code><ref name="NoDoc2" />: Allows access to [[Windows API]] functions. Embedded by exception for advanced system-level operations.
=== RGSS3 ===
RGSS3 is the third version of RGSS integrated into [[RPG Maker VX Ace|''RPG Maker VX Ace'']].
==== Changes ====
* Ruby upgraded from 1.8.1 to 1.9.2p0, improving interpreter speed and enhancing string processing.
* Encrypted archive format changed, reducing game startup time.
* Not fully compatible with scripts written for RGSS1 or RGSS2.
== Applications ==
All ''RPG Maker'' games using the ''XP'', ''VX'', ''VX Ace'' engines are fundamentally programmed with RGSS.
Programmers typically modify preset scripts to create systems not possible with event commands alone.
It is possible to build an entirely original game system from scratch using RGSS, bypassing all default scripts. Though RGSS is designed for RPGs, it can also create other [[Video game genre|video game genres]], such as [[Action game|action games]].
Before the introduction of RGSS, it was difficult to freely resize text, customize menus, or create enemies with absurdly high [[hitpoints]] (e.g., 10 [[quadrillion]]). Event commands could handle such cases, but often resulted in complex and inflexible setups. With RGSS, game logic can be rewritten at the script level, streamlining development.
Many websites now host custom RGSS scripts, most of which are designed to be copy-pasted directly into ''RPG Maker'' projects. These scripts empower users to significantly enhance gameplay without writing code from scratch.
== Drawbacks ==
* [[Debugging]] difficulties: Debugging is hard for beginners. Error messages in Ruby can be cryptic, and ''RPG Maker''<nowiki/>'s default error dialogs are minimal.
* Script conflicts: Combining multiple custom scripts may cause functionality issues due to [[method overriding]]. To prevent this, developers use aliases that rename existing methods before redefining them or namespaces isolating code to avoid collisions. Both techniques have pros and cons, so integrating publicly distributed scripts requires careful consideration.
== Game libraries ==
Many Ruby-based game libraries have been created:
* Miyako
* MyGame
* {{Interlanguage link|Star Ruby (game engine)|lt=Star Ruby|ja|Star Ruby}}
== Footnotes ==
<references />
== External links ==
* [https://tkool.jp/products/rpgxp/index RPGツクールXP]
* [https://tkool.jp/products/rpgvx/index RPGツクールVX]
* [https://tkool.jp/products/rpgvxace/index RPGツクールVX Ace]
* [https://www.ruby-lang.org/ja/ Rubyホームページ]