Wednesday, March 25, 2009

RGSS Player : A View on Its Implementation

[We] shall further elaborate on the implementation of a RGSS Player due to the popular demand. The overwhelming demand leaves me no other choice. Well, when your blog is as popular as mine, you really take a demand from a single individual seriously.

Enterbrain does not provide source code for its RPG Maker VX nor any other products as far as I know. Thus, the legitimate question arises on how one would port RPG Maker VX/XP RTP (Run Time Package) to another platform.

...truth to be told

Because it is important to respect the work of others and avoid legal nightmares, it does mean to completely rewrite the engine from scratch. This can be done using non-intrusive techniques (without reverse engineering per se) such as creating classes according to either RGSS{1, 2} specifications, writing tests to assess both RPG Maker and our own engines and make sure they have exact same behaviour, and so on.

Run Time Package

Run Time Package is mainly composed of a (1) RGSS Player, (2) Ruby Game Scripting System and (3) Ruby. This is packaged in a lovely executable (GAME.EXE) and dynamic link library (e.g. RGSS202E.DLL). Moreover, the RGSS Player has to be able to read the various databases available, scripts and decrypt encrypted archive (GAME.RGSS2A). Finally, SCRIPTS.RVDATA is loaded and executed once the RGSS Player is fully initialized. The graphics, audio, fonts, etc. bundled with RTP are cosmetic (and usually user-content) and does not affect the RGSS Player as long as they are available in a valid format supported by the engine.

? ...did you know

The Script Editor within RPG Maker VX uses partial features from Scintilla (SCINTILLA.DLL or SCILEXER.DLL) and let you edit SCRIPTS.RVDATA. The scripts deal with high level features of the game engine and, contrary to RGSS itself, its source code is fully available to the game designer. Concretely, it means that one can design a game using Enterbrain RPG Maker VX on Windows and would be able to run mostly unchanged on any platform a RGSS player is available.

{Ruby + RGSS}.exe
That's right. In a nutshell, the famous RPG Maker RGSS Player is RGSS classes on top of a Ruby interpreter embedded into executable files.
Consequently, one has to be able to reproduce RGSS classes and deal with low level programming {graphics, audio, decrypting, native GUI, etc.}, as well as being able to embed a Ruby interpreter in an EXE or DLL file.

There are few tools to create executable files with an embedded Ruby interpreter. Each have various limitations that might be problematic, such as, being limited to single or few target platforms, overly outdated, overly limited, still experimental, etc. My best guess is that RPG Maker uses Exerb.

It is really straightforward to implement a RGSS Player in principle but let's not forget that there are around 50 classes per RGSS specification, requires the ability to properly wrap up a Ruby interpreter into an executable file on the desired platform(s), writing hundreds tests, handling low level programming, which are different for each platform, and so forth. Ultimately, Ruby might also not be supported on some desired platforms, such as Nintendo Wii, AFAIK, and hence would require to port Ruby first.

Next time, we could have an overview of the possibilities offered with
an SDK for RPG Maker...

No comments:

Post a Comment