Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Rxdata Versioning Utility

Raku

Member

EDIT: I have upgraded this utility to an RMXP plugin system and uploaded the new code to a Git repository here.

Rxdata Versioning Utility
Version: 1.0.2

By: Raku (rakudayo@gmail.com)

Introduction

Have you ever wanted to work on an RMXP game with a group of friends, but ran into trouble with conflicts when multiple people edit the same rxdata files? If you want to safely and efficiently version the data in your RMXP game, then read on!

I have written a series of Ruby scripts to export all of the RMXP rxdata files (scripts, system data, maps, etc.) into plain-text files which are human-readable and can be easily versioned with a versioning system such as Subversion or Mercurial. I've also written scripts which can read these exported text files and import them back into rxdata files so that RMXP can read them. Now, anytime two people change a map, a script, or any other game data, all of the conflicts can be easily resolved in plain text.

I've been careful to make sure that the RGSS objects are always exported in the same way, so that unnecessary conflicts are avoided. The data files are exported as YAML files and the RGSS scripts are exported as normal Ruby files. This provides other benefits beyond just versioning the data. For example, you could use your favorite text editor outside of RMXP to edit your scripts; just make sure you don't export the scripts before you import your changes. Also, seeing what changed in the YAML files when you do something in RMXP is really helpful in understanding how the game data works!

This is my first script that I've posted here on the forums. Hopefully it's useful! Please give me suggestions or comments if you have any ideas how I could improve this utility.

Features
  • Exports rxdata files (except Scripts.rxdata) to text files in the YAML data format.
  • Exports all scripts contained in Scripts.rxdata to individual Ruby files.
  • Imports YAML files back into rxdata files that RMXP can read.
  • Imports Ruby scripts previously exported back into a Scripts.rxdata file that RMXP can read.
  • Automatic importing/exporting via Game.bat which can import all scripts and run RMXP. When RMXP is closed, all data is exported.
  • Utility behavior is configurable via a config.yaml file.
  • Only exports rxdata files if they need to be exported (i.e. have been modified since RMXP was opened or haven't been exported yet).
  • Only exports scripts if they are not empty (for example, place-holder scripts)
  • Cleanup script (called clean.rb) provided to help identify stale scripts (i.e. scripts which are added in RMXP's script editor, exported, and then later removed from the script editor, but still remain in your scripts directory).

Downloads

A demo project created using the utility and Subversion (Just run Game.bat, instead of Game.rxproj NOTE: SVN metadata not included in the project).

The RMXP Data Exporter/Importer Utility (follow instructions below to use with your project)

Sample Files

A sample YAML file exported from System.rxdata.
YAML:
<div id="{CB}" style="font-family: monospace;"><ol>--- 

root: !ruby/object:RPG::System 

  _: 7829367

  actor_collapse_se: !ruby/object:RPG::AudioFile 

    name: 011-System11

    pitch: 100

    volume: 80

  battle_bgm: !ruby/object:RPG::AudioFile 

    name: 001-Battle01

    pitch: 100

    volume: 100

  battle_end_me: !ruby/object:RPG::AudioFile 

    name: 001-Victory01

    pitch: 100

    volume: 100

  battle_start_se: !ruby/object:RPG::AudioFile 

    name: 009-System09

    pitch: 100

    volume: 80

  battle_transition: 003-Blind03

  battleback_name: 003-Forest01

  battler_hue: 0

  battler_name: 001-Fighter01

  buzzer_se: !ruby/object:RPG::AudioFile 

    name: 004-System04

    pitch: 100

    volume: 80

  cancel_se: !ruby/object:RPG::AudioFile 

    name: 003-System03

    pitch: 100

    volume: 80

  cursor_se: !ruby/object:RPG::AudioFile 

    name: 001-System01

    pitch: 100

    volume: 80

  decision_se: !ruby/object:RPG::AudioFile 

    name: 002-System02

    pitch: 100

    volume: 80

  edit_map_id: 2

  elements: 

  - ""

  - Fire

  - Ice

  - Thunder

  - Water

  - Earth

  - Wind

  - Light

  - Darkness

  - vs Undead

  - vs Snake

  - vs Aquatic

  - vs Beast

  - vs Goblin

  - vs Bird

  - vs Devil

  - vs Angel

  enemy_collapse_se: !ruby/object:RPG::AudioFile 

    name: 012-System12

    pitch: 100

    volume: 80

  equip_se: !ruby/object:RPG::AudioFile 

    name: 005-System05

    pitch: 100

    volume: 80

  escape_se: !ruby/object:RPG::AudioFile 

    name: 010-System10

    pitch: 100

    volume: 80

  gameover_me: !ruby/object:RPG::AudioFile 

    name: 005-Defeat01

    pitch: 100

    volume: 100

  gameover_name: 001-Gameover01

  load_se: !ruby/object:RPG::AudioFile 

    name: 008-System08

    pitch: 100

    volume: 80

  magic_number: 77323823

  party_members: 

  - 1

  - 2

  - 7

  - 8

  save_se: !ruby/object:RPG::AudioFile 

    name: 007-System07

    pitch: 100

    volume: 80

  shop_se: !ruby/object:RPG::AudioFile 

    name: 006-System06

    pitch: 100

    volume: 80

  start_map_id: 1

  start_x: 10

  start_y: 11

  switches: 

  - 

  - ""

  - ""

  - ""

  - ""

  - ""

  - ""

  - ""

  - ""

  - ""

  - ""

  - ""

  - ""

  - ""

  - ""

  - ""

  - ""

  - ""

  - ""

  - ""

  - ""

  - ""

  - ""

  - ""

  - ""

  - ""

  - ""

  - ""

  - ""

  - ""

  - ""

  - ""

  - ""

  - ""

  - ""

  - ""

  - ""

  - ""

  - ""

  - ""

  - ""

  - ""

  - ""

  - ""

  - ""

  - ""

  - ""

  - ""

  - ""

  - ""

  - ""

  test_battlers: 

  - !ruby/object:RPG::System::TestBattler 

    actor_id: 1

    armor1_id: 1

    armor2_id: 5

    armor3_id: 13

    armor4_id: 0

    level: 1

    weapon_id: 1

  - !ruby/object:RPG::System::TestBattler 

    actor_id: 2

    armor1_id: 1

    armor2_id: 5

    armor3_id: 13

    armor4_id: 0

    level: 1

    weapon_id: 5

  - !ruby/object:RPG::System::TestBattler 

    actor_id: 7

    armor1_id: 0

    armor2_id: 9

    armor3_id: 21

    armor4_id: 0

    level: 1

    weapon_id: 25

  - !ruby/object:RPG::System::TestBattler 

    actor_id: 8

    armor1_id: 0

    armor2_id: 9

    armor3_id: 21

    armor4_id: 0

    level: 1

    weapon_id: 29

  test_troop_id: 1

  title_bgm: !ruby/object:RPG::AudioFile 

    name: 062-Slow05

    pitch: 100

    volume: 100

  title_name: 001-Title01

  variables: 

  - 

  - ""

  - ""

  - ""

  - ""

  - ""

  - ""

  - ""

  - ""

  - ""

  - ""

  - ""

  - ""

  - ""

  - ""

  - ""

  - ""

  - ""

  - ""

  - ""

  - ""

  - ""

  - ""

  - ""

  - ""

  - ""

  - ""

  - ""

  - ""

  - ""

  - ""

  - ""

  - ""

  - ""

  - ""

  - ""

  - ""

  - ""

  - ""

  - ""

  - ""

  - ""

  - ""

  - ""

  - ""

  - ""

  - ""

  - ""

  - ""

  - ""

  - ""

  windowskin_name: 001-Blue03b2

  words: !ruby/object:RPG::System::Words 

    agi: AGI

    armor1: Shield

    armor2: Helmet

    armor3: Body Armor

    armor4: Accessory

    atk: ATK

    attack: Attack

    dex: DEX

    equip: Equip

    gold: G

    guard: Defend

    hp: HP

    int: INT

    item: Item

    mdef: MDEF

    pdef: PDEF

    skill: Skill

    sp: SP

    str: STR

    weapon: Weapon

 
A sample export digest. This file is generated by the RGSS script exporter and is a list of all exported scripts. It is used so they can be re-imported into Scripts.rxdata in the original order later. Notice that the third column (exported Ruby file name) for the second entry is EMPTY. No file is actually exported, since that script in RMXP was actually an empty entry.
Code:
91679711    Test_Script                                  Test_Script.rb

85299656    ---------------------------                  EMPTY

75819864    Game_Temp                                    Game_Temp.rb

61166382    Game_System                                  Game_System.rb

65768432    Game_Switches                                Game_Switches.rb

77770996    Game_Variables                               Game_Variables.rb

93212223    Game_SelfSwitches                            Game_SelfSwitches.rb

52755737    Game_Screen                                  Game_Screen.rb

79550171    Game_Picture                                 Game_Picture.rb

52884295    Game_Battler_1                               Game_Battler_1.rb

2845129     Game_Battler_2                               Game_Battler_2.rb

39520892    Game_Battler_3                               Game_Battler_3.rb

65931833    Game_BattleAction                            Game_BattleAction.rb

93706232    Game_Actor                                   Game_Actor.rb

19485474    Game_Enemy                                   Game_Enemy.rb

84307861    Game_Actors                                  Game_Actors.rb

20162964    Game_Party                                   Game_Party.rb

96014404    Game_Troop                                   Game_Troop.rb

45114136    Game_Map                                     Game_Map.rb

37136841    Game_CommonEvent                             Game_CommonEvent.rb

85238647    Game_Character_1                             Game_Character_1.rb

91992187    Game_Character_2                             Game_Character_2.rb

97808837    Game_Character_3                             Game_Character_3.rb

75787353    Game_Event                                   Game_Event.rb

47174434    Game_Player                                  Game_Player.rb

76586914    Sprite_Character                             Sprite_Character.rb

35537720    Sprite_Battler                               Sprite_Battler.rb

18621826    Sprite_Picture                               Sprite_Picture.rb

85012817    Sprite_Timer                                 Sprite_Timer.rb

2353947     Spriteset_Map                                Spriteset_Map.rb

92516995    Spriteset_Battle                             Spriteset_Battle.rb

30856323    Window_Base                                  Window_Base.rb

61843872    Window_Selectable                            Window_Selectable.rb

83996582    Window_Command                               Window_Command.rb

77997554    Window_Help                                  Window_Help.rb

97998046    Window_Gold                                  Window_Gold.rb

10275269    Window_PlayTime                              Window_PlayTime.rb

73623657    Window_Steps                                 Window_Steps.rb

19290161    Window_MenuStatus                            Window_MenuStatus.rb

82366943    Window_Item                                  Window_Item.rb

97657       Window_Skill                                 Window_Skill.rb

97927834    Window_SkillStatus                           Window_SkillStatus.rb

99822998    Window_Target                                Window_Target.rb

73541260    Window_EquipLeft                             Window_EquipLeft.rb

20193482    Window_EquipRight                            Window_EquipRight.rb

67379761    Window_EquipItem                             Window_EquipItem.rb

42657471    Window_Status                                Window_Status.rb

81494140    Window_SaveFile                              Window_SaveFile.rb

75433349    Window_ShopCommand                           Window_ShopCommand.rb

98941040    Window_ShopBuy                               Window_ShopBuy.rb

52413940    Window_ShopSell                              Window_ShopSell.rb

50042725    Window_ShopNumber                            Window_ShopNumber.rb

42938232    Window_ShopStatus                            Window_ShopStatus.rb

77163696    Window_NameEdit                              Window_NameEdit.rb

74963379    Window_NameInput                             Window_NameInput.rb

12512207    Window_InputNumber                           Window_InputNumber.rb

59899902    Window_Message                               Window_Message.rb

63909912    Window_PartyCommand                          Window_PartyCommand.rb

78381347    Window_BattleStatus                          Window_BattleStatus.rb

18789673    Window_BattleResult                          Window_BattleResult.rb

70270804    Window_DebugLeft                             Window_DebugLeft.rb

74315432    Window_DebugRight                            Window_DebugRight.rb

15695525    Arrow_Base                                   Arrow_Base.rb

82011983    Arrow_Enemy                                  Arrow_Enemy.rb

716537      Arrow_Actor                                  Arrow_Actor.rb

76431274    Interpreter_1                                Interpreter_1.rb

94946289    Interpreter_2                                Interpreter_2.rb

21948242    Interpreter_3                                Interpreter_3.rb

55160522    Interpreter_4                                Interpreter_4.rb

77288818    Interpreter_5                                Interpreter_5.rb

2407837     Interpreter_6                                Interpreter_6.rb

32165528    Interpreter_7                                Interpreter_7.rb

48831177    Scene_Title                                  Scene_Title.rb

29223633    Scene_Map                                    Scene_Map.rb

95355584    Scene_Menu                                   Scene_Menu.rb

21041870    Scene_Item                                   Scene_Item.rb

97256469    Scene_Skill                                  Scene_Skill.rb

82235717    Scene_Equip                                  Scene_Equip.rb

95739746    Scene_Status                                 Scene_Status.rb

71942138    Scene_File                                   Scene_File.rb

77130127    Scene_Save                                   Scene_Save.rb

58364868    Scene_Load                                   Scene_Load.rb

79702758    Scene_End                                    Scene_End.rb

4299927     Scene_Battle_1                               Scene_Battle_1.rb

63449097    Scene_Battle_2                               Scene_Battle_2.rb

40844727    Scene_Battle_3                               Scene_Battle_3.rb

33132935    Scene_Battle_4                               Scene_Battle_4.rb

40350342    Scene_Shop                                   Scene_Shop.rb

45690918    Scene_Name                                   Scene_Name.rb

52774048    Scene_Gameover                               Scene_Gameover.rb

44960761    Scene_Debug                                  Scene_Debug.rb

34503174    Main                                         Main.rb

 
A sample config file for the utility.
YAML:
<div id="{CB}" style="font-family: monospace;"><ol>#===============================================================================

# Filename:    config.yaml

#

# Developer:   Raku (rakudayo@gmail.com)

#

# Description: This file contains all configurable parameters for the RMXP 

#    Importer/Exporter Utility.

#===============================================================================

---

#-------------------------------------------------------------------------------

#  Import/Export Directories

#-------------------------------------------------------------------------------

# NOTE: All paths in this file are relative to the directory where the utility

# scripts are located (and hopefully where this file is located).

#-------------------------------------------------------------------------------

 

# Modify this path to specify where your .rxdata files reside

rxdata_dir:   ../Data

 

# Modify this path to specify where you want the game data emitted in YAML

yaml_dir:     ../Data/Yaml

 

# Modify this path to specify where you want the RGSS scripts exported to

scripts_dir:  ../Data/Scripts

 

# Modify this path to specify the RMXP project directory (where Game.rxproj is)

project_dir:  ..

 

#-------------------------------------------------------------------------------

#  Miscellaneous Parameters

#-------------------------------------------------------------------------------

 

# This array specifies all .rxdata files which are to be ignored by the data

# exporter script.  Note that the script exporter doesn't look at this array,

# since it always exports the Scripts.rxdata file.  Add entries to this array

# if you do not wish to version certain .rxdata files.

rxdata_ignore_list:     ["Scripts.rxdata"]

 

# This parameter determines whether the import/export scripts print verbose 

# information such as each filename as it is imported or exported and timing 

# information.  Errors are always printed.

#   Valid values:  [true || false]

verbose: true

 

# This is the value always used for System object's magic_number field.  RMXP

# changes this value whenever System.rxdata is modified, so having a default 

# value prevents unnecessary conflicts when versioning the System.yaml file.

# If, for any reason, this causes problems, you can disable the default magic

# number functionality by setting the value -1.

magic_number: 77323823
The default Game.bat importer/exporter runner.
Code:
<div id="{CB}" style="font-family: monospace;"><ol>@echo off

 

REM #========================================================

REM #               Developed by Raku

REM #========================================================

REM # Use this batch file as you please, just give me some

REM # credit if you do.  Thanks and happy scripting!

REM #========================================================

 

REM #========================================================

REM #  Setup the Paths for the Importer/Exporter

REM #========================================================

 

REM # The path to the ruby scripts which import and export

REM # RPG Maker XP Data

SET SCRIPTS_DIR="Utility"

 

REM #===============================

REM #  Change to Scripts Directory

REM #===============================

 

SET PREV_DIR=%CD%

CD %SCRIPTS_DIR%

 

REM #========================

REM #  RGSS script Importer

REM #========================

 

RUBY script_importer.rb

 

REM #======================

REM #  RMXP Data Importer

REM #======================

 

RUBY data_importer.rb

 

REM #=======================

REM #  Start RPG Maker XP

REM #=======================

 

RUBY start_rmxp.rb

 

REM #======================

REM #  RMXP Data Exporter

REM #======================

 

RUBY data_exporter.rb

 

REM #========================

REM #  RGSS Script Exporter

REM #========================

 

RUBY script_exporter.rb

 

REM #================================

REM #  Return to Original Directory

REM #================================

 

CD %PREV_DIR%
Sample Game.bat output (verbose mode)
Code:
F:\projects\RMXP\TestSvnRepo\RxdataImporterExporterDemo>Game.bat

--------------------------------------------------------------------------------

  RGSS Script Import

--------------------------------------------------------------------------------

Imported Test_Script.rb                     (001/091)

Imported Game_Temp.rb                       (002/091)

Imported Game_System.rb                     (003/091)

Imported Game_Switches.rb                   (004/091)

Imported Game_Variables.rb                  (005/091)

Imported Game_SelfSwitches.rb               (006/091)

Imported Game_Screen.rb                     (007/091)

Imported Game_Picture.rb                    (008/091)

Imported Game_Battler_1.rb                  (009/091)

Imported Game_Battler_2.rb                  (010/091)

Imported Game_Battler_3.rb                  (011/091)

Imported Game_BattleAction.rb               (012/091)

Imported Game_Actor.rb                      (013/091)

Imported Game_Enemy.rb                      (014/091)

Imported Game_Actors.rb                     (015/091)

Imported Game_Party.rb                      (016/091)

Imported Game_Troop.rb                      (017/091)

Imported Game_Map.rb                        (018/091)

Imported Game_CommonEvent.rb                (019/091)

Imported Game_Character_1.rb                (020/091)

Imported Game_Character_2.rb                (021/091)

Imported Game_Character_3.rb                (022/091)

Imported Game_Event.rb                      (023/091)

Imported Game_Player.rb                     (024/091)

Imported Sprite_Character.rb                (025/091)

Imported Sprite_Battler.rb                  (026/091)

Imported Sprite_Picture.rb                  (027/091)

Imported Sprite_Timer.rb                    (028/091)

Imported Spriteset_Map.rb                   (029/091)

Imported Spriteset_Battle.rb                (030/091)

Imported Window_Base.rb                     (031/091)

Imported Window_Selectable.rb               (032/091)

Imported Window_Command.rb                  (033/091)

Imported Window_Help.rb                     (034/091)

Imported Window_Gold.rb                     (035/091)

Imported Window_PlayTime.rb                 (036/091)

Imported Window_Steps.rb                    (037/091)

Imported Window_MenuStatus.rb               (038/091)

Imported Window_Item.rb                     (039/091)

Imported Window_Skill.rb                    (040/091)

Imported Window_SkillStatus.rb              (041/091)

Imported Window_Target.rb                   (042/091)

Imported Window_EquipLeft.rb                (043/091)

Imported Window_EquipRight.rb               (044/091)

Imported Window_EquipItem.rb                (045/091)

Imported Window_Status.rb                   (046/091)

Imported Window_SaveFile.rb                 (047/091)

Imported Window_ShopCommand.rb              (048/091)

Imported Window_ShopBuy.rb                  (049/091)

Imported Window_ShopSell.rb                 (050/091)

Imported Window_ShopNumber.rb               (051/091)

Imported Window_ShopStatus.rb               (052/091)

Imported Window_NameEdit.rb                 (053/091)

Imported Window_NameInput.rb                (054/091)

Imported Window_InputNumber.rb              (055/091)

Imported Window_Message.rb                  (056/091)

Imported Window_PartyCommand.rb             (057/091)

Imported Window_BattleStatus.rb             (058/091)

Imported Window_BattleResult.rb             (059/091)

Imported Window_DebugLeft.rb                (060/091)

Imported Window_DebugRight.rb               (061/091)

Imported Arrow_Base.rb                      (062/091)

Imported Arrow_Enemy.rb                     (063/091)

Imported Arrow_Actor.rb                     (064/091)

Imported Interpreter_1.rb                   (065/091)

Imported Interpreter_2.rb                   (066/091)

Imported Interpreter_3.rb                   (067/091)

Imported Interpreter_4.rb                   (068/091)

Imported Interpreter_5.rb                   (069/091)

Imported Interpreter_6.rb                   (070/091)

Imported Interpreter_7.rb                   (071/091)

Imported Scene_Title.rb                     (072/091)

Imported Scene_Map.rb                       (073/091)

Imported Scene_Menu.rb                      (074/091)

Imported Scene_Item.rb                      (075/091)

Imported Scene_Skill.rb                     (076/091)

Imported Scene_Equip.rb                     (077/091)

Imported Scene_Status.rb                    (078/091)

Imported Scene_File.rb                      (079/091)

Imported Scene_Save.rb                      (080/091)

Imported Scene_Load.rb                      (081/091)

Imported Scene_End.rb                       (082/091)

Imported Scene_Battle_1.rb                  (083/091)

Imported Scene_Battle_2.rb                  (084/091)

Imported Scene_Battle_3.rb                  (085/091)

Imported Scene_Battle_4.rb                  (086/091)

Imported Scene_Shop.rb                      (087/091)

Imported Scene_Name.rb                      (088/091)

Imported Scene_Gameover.rb                  (089/091)

Imported Scene_Debug.rb                     (090/091)

Imported Main.rb                            (091/091)

--------------------------------------------------------------------------------

The total import time:  0.594 seconds.

--------------------------------------------------------------------------------

 

--------------------------------------------------------------------------------

  RMXP Data Import

--------------------------------------------------------------------------------

Imported Actors.yaml                   (001/016)    0.093 seconds

Imported Animations.yaml               (002/016)    0.907 seconds

Imported Armors.yaml                   (003/016)    0.062 seconds

Imported Classes.yaml                  (004/016)    0.016 seconds

Imported CommonEvents.yaml             (005/016)    0.015 seconds

Imported Enemies.yaml                  (006/016)    0.063 seconds

Imported Items.yaml                    (007/016)    0.016 seconds

Imported Map001.yaml                   (008/016)    0.046 seconds

Imported Map002.yaml                   (009/016)    0.032 seconds

Imported MapInfos.yaml                 (010/016)    0.015 seconds

Imported Skills.yaml                   (011/016)    0.078 seconds

Imported States.yaml                   (012/016)    0.016 seconds

Imported System.yaml                   (013/016)    0.016 seconds

Imported Tilesets.yaml                 (014/016)    1.234 seconds

Imported Troops.yaml                   (015/016)    0.047 seconds

Imported Weapons.yaml                  (016/016)    0.016 seconds

--------------------------------------------------------------------------------

The total import time:  2.672 seconds.

Total YAML load time:   1.173 seconds.

Total RXDATA dump time: 1.499 seconds.

--------------------------------------------------------------------------------

 

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

!!!DO NOT CLOSE THIS COMMAND WINDOW!!!

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

 

--------------------------------------------------------------------------------

  RMXP Data Export

--------------------------------------------------------------------------------

Exported Tilesets.rxdata               (001/003)    7.703 seconds

Exported Troops.rxdata                 (002/003)    0.329 seconds

Exported Weapons.rxdata                (003/003)    0.109 seconds

--------------------------------------------------------------------------------

The total export time:  8.141 seconds.

Total RXDATA load time: 0.718 seconds.

Total YAML dump time:   7.423 seconds.

--------------------------------------------------------------------------------

 

--------------------------------------------------------------------------------

  RGSS Script Export

--------------------------------------------------------------------------------

No RGSS scripts need to be exported.

Instructions
Requirements
  • Ruby Interpreter - Get the most recent version here. It is required to run the utility scripts outside of RMXP. You will need a version with the YAML and Zlib modules (the latest version should have these).
  • RPG Maker XP - Obviously! :)
  • Windows XP - Not sure if this utility works on Windows Vista. The only problem I forsee could be the batch file commands. Since I don't have access to a Vista machine, could someone confirm this?
  • (Optional) Versioning System - If you want to keep track of versions of your exported data, you will need a versioning system like SVN, Mercurial, or Github.
Setup
  • Download the RMXP Data Exporter/Importer Utility above.
  • Back up your project (just copy it somewhere for safe-keeping). :)
  • Extract the archive into your RMXP project directory. NOTE: If you already have a Utility directory in the base directory of your RMXP project, you may want to extract to a temporary directory and change the name of the Utility directory to something else. Just make sure to update the SCRIPTS_DIR environment variable set in Game.bat (see above).
  • Optional: Modify any configuration parameters you want, in the config.yaml file, such as output directory paths for the YAML and Ruby files.

Usage
Automated (recommended)
  • Just run Game.bat.
  • Kick back, relax, and let the batch file do everything for you. NOTE: It will ignore importing the first time it is run, since no data has been exported yet. When you close RMXP, all of the data will be exported (as long as you don't close the command window that Game.bat opened). :)

Manual
  • Open a command prompt
  • Change to the scripts directory (default name is Utility).
  • > ruby script_importer.rb
  • > ruby data_importer.rb
  • > ruby logtime.rb (This is to log the time we started RMXP to determine if files were modified)
  • Open RPG Maker XP
  • Close RPG Maker XP
  • > ruby data_exporter.rb
  • > ruby script_exporter.rb

What to Version
  • The exported data YAML files
  • The exported Ruby scripts
  • The script export digest (digest.txt)
  • All RMXP Exporter/Importer Utility scripts (so that everyone sharing your project has them)
  • Game.bat (if you are using it - I highly recommend to use it, since it is easy to forget to import or export)

FAQ
  • Does this utility work for RMVX? No, it needs to be modified to work with RMVX. I only own RMXP, but if anyone wants to modify it, I will post the RMVX version here too. It should be pretty easy to make the modifications (*knock on wood*).
  • What versioning system does this utility work with? Theoretically, all of them. Exported files should be versionable by any versioning system that can version UTF8-encoded text files, which I think is all of them. I've tested this versioning two different RMXP projects with Subversion with no problems.
  • When versioning the exported files, why do I get conflicts when there is no change in the files? Probably this is due to editing the exported file in a text editor or diff program which modified the newlines in the file. Try telling your versioning system to ignore new line differences or always convert them automatically.
  • Why are my changes not exported after I close RMXP? If you ran the Game.bat file, you may want to check that you have not accidentally closed the command window that says, "DO NOT CLOSE THIS COMMAND WINDOW!!!". The export step should automatically execute from the batch script when you close RMXP. If you're manually running the scripts, then just run the export script (see Usage).

Compatibility
NOTE: I'm currently investigating compatibility with SDK. I'll post an update as soon as I know for sure.

This utility should be compatible with any script modifications, since it runs outside of RMXP and treats scripts as data. However, you may experience problems if you have directly modified any of the classes in the RPG module. In general, one should not directly modify these classes, but in case you have, I've included a Ruby file for RGSS modifications (the default location is /Utility/rmxp/rgss_mod.rb). You will need to add your changes to that file so that they can be automatically picked up by the importer/exporter scripts.

Credits and Thanks

Author's Notes

  • This is the final release of the Rxdata Versioning Utility. I have made an RMXP Plugin System which covers the functionality of this utility, plus much more. I'll post it on the forums shortly.
  • THIS UTILITY MODIFIES YOUR PROJECT'S .rxdata FILES! Make sure to back them up before using it.
  • If anyone can help me test this utility out on more RMXP projects, I would really appreciate it!
  • Since I don't have access to a Vista machine, could someone confirm if this utility works on Vista?
  • If you need Ruby implementations of the Table, Color, and Tone classes that can load and dump the .rxdata files that RMXP can read, they are included in the utility in rgss_internal.rb, or you can email me and I'll send them to you. :)

Terms and Conditions

This utility is free for any use, commercial or otherwise.
 

Raku

Member

nowayskill":1wnw6cas said:
Woah!
Cheers! we can now use SVN :)
Yep! :thumb:

I've actually been using the script exporter part with Subversion for many months now working on a game with a team. It's been really helpful in managing conflicts. Now that we can version our data too, it should really help speed things up. Until now, only one person at a time could edit the Maps, Events, Database, etc. Basically, one guy ended up making all changes which was obviously a development bottle-neck!

Now we even correct spelling mistakes and other stuff in the text files! :biggrin:
 
Raku":329furjc said:
nowayskill":329furjc said:
Woah!
Cheers! we can now use SVN :)
Yep! :thumb:

I've actually been using the script exporter part with Subversion for many months now working on a game with a team. It's been really helpful in managing conflicts. Now that we can version our data too, it should really help speed things up. Until now, only one person at a time could edit the Maps, Events, Database, etc. Basically, one guy ended up making all changes which was obviously a development bottle-neck!

Now we even correct spelling mistakes and other stuff in the text files! :biggrin:
If you'll find a way to make a patcher it would be good..
I think you should make it download the Rxdata files from a host using
the berka's RMXP net module which allow you to make that easily
to check what data is not the same as the data in the web
and download it all through YAML
 

Raku

Member

nowayskill":u3ygyo45 said:
If you'll find a way to make a patcher it would be good..
I think you should make it download the Rxdata files from a host using
the berka's RMXP net module which allow you to make that easily
to check what data is not the same as the data in the web
and download it all through YAML
Hmm...sounds interesting, but I'm not sure I completely understand. Currently, the import/export scripts run outside of RMXP. Are you saying that it would be good to have the scripts run in RMXP and import the data by downloading the YAML from a remote host and generate the rxdata files? If so, here are some questions that we'd need to answer:

  • What is gained over traditional code versioning systems like SVN? This importer/exporter is not really meant for deploying patches to players after a game is released (although we could add that if its useful). It is more to enable people to work concurrently while the game is being developed.
  • Is YAML supported in RMXP's version of Ruby? It is quite trimmed down.

Since the importer/exporter scripts in this utility are run before/after RMXP starts, I am tossing around the idea of making a plug-in architecture so that all people would need to do to have something done at startup or shutdown of RMXP would be to implement a plugin class. For example:

Ruby:
class PluginInterface

  def on_startup

    raise NotImplementedError.new

  end

 

  def on_shutdown

    raise NotImplementedError.new

  end

end

 

class DataImporterExporter < PluginInterface

  def initialize

  end

 

  def on_startup

    # Import the rxdata files from text

    puts 'Importing data...'

  end

 

  def on_shutdown

    # Export the rxdata files to text

    puts 'Exporting data...'

  end

end

 

class ScriptImporterExporter < PluginInterface

  def initialize

  end

 

  def on_startup

    # Import the scripts from text

    puts 'Importing scripts...'

  end

 

  def on_shutdown

    # Export the scripts to text

    puts 'Exporting scripts...'

  end

end

 

 

# In the startup script

plugins = []

plugins << ScriptImporterExporter.new

plugins << DataImporterExporter.new

 

# Before starting RMXP

plugins.each do |plugin|

  plugin.on_startup

end

 

# START RMXP...

 

# After exiting RMXP

plugins.each do |plugin|

  plugin.on_shutdown

end

 

# Outputs:

<span style="color:#000080; font-style:italic;">=begin

<span style="color:#000080; font-style:italic;">Importing scripts...

<span style="color:#000080; font-style:italic;">Importing data...

<span style="color:#000080; font-style:italic;">Exporting scripts...

<span style="color:#000080; font-style:italic;">Exporting data...

<span style="color:#000080; font-style:italic;">=end
I wonder what people think about this idea. This way people could easily integrate scripts in the startup and shutdown process for their RMXP project.

I've already been thinking of creating a plugin that can read the dialogue/vocab from the rxdata files and import/export it from/to a separate file for translation purposes. This way people could get all the language out of their RMXP project, translate it in an easy way, then it gets imported back in before RMXP starts. (I know that there are already scripts out there that help in translation, but I don't really like the format they dump the data in).
 

e

Sponsor

Very nice set of utilities! Me and Brewmeister were using a similar solution that exported Scripts.rxdata to single Ruby files so that we could use SVN, but yours is much more developed; I just put something together quickly to be able to code right away.

As for your plugin idea, there'd have to be some sort of prioritization mechanism; certain scripts need to be ran before, or some such. But good endeavor!
 

Raku

Member

∫∆µ":2s6nomfg said:
Very nice set of utilities! Me and Brewmeister were using a similar solution that exported Scripts.rxdata to single Ruby files so that we could use SVN, but yours is much more developed; I just put something together quickly to be able to code right away.

As for your plugin idea, there'd have to be some sort of prioritization mechanism; certain scripts need to be ran before, or some such. But good endeavor!
You're absolutely right! I've been thinking about the same prioritization issue as well. One possible solution could be to specify ordering constraints in a config file using a hash. For example:

Ruby:
module Config

  # The data exporter might need to run before the language exporter 

  # because the language exporter could use the YAML text to extract

  # all language information.  Then the import for the language importer

  # would need to be run to update the data exporter's yaml files with

  # new language texts.

  STARTUP_PRIORITIES = {'LanguageImporterExporter' => 'DataImporterImporter'}

  SHUTDOWN_PRIORITIES = {'DataImporterExporter' => 'LanguageImporterExporter'}  

end

Then we could just sort the array of plugins based on these priorities.

Any other ideas for how priority ordering might be achieved? Perhaps some code mechanism the author of a plugin could include to make sure another plugin has already been run? I'd like to find a clean way so that users don't need to do the above configuration themselves.

By the way, I'm glad you're finding the utility useful! That will help encourage me to post updates! :thumb:
 

e

Sponsor

You could use some sort of weighing system; you give each plugins certain weights, kind of like how Windows handles its process prioritization.

All plug-ins start with a 0 weight; plug-ins with higher priority are given higher weights and so forth (or the other way around). Each weight could be assigned to a particular level of prioritization, so that all plug-ins on a given level are not supposed to interfere with each other.
 
Hi All,

Not to Necro the post, though I guess I am, does anyone have a copy of this program or the code? I did contact a Mod and sent an email to Raku, though I don't have very high hopes for a response since he has not been on since June of 2009. As I told them in the email, if no one is working on this I can give it a shot, but I would rather not reinvent the wheel.

Any help would be appreciated,
Ab
 

Raku

Member

Hi Everyone,

Let me first start off by apologizing for not tending this post for so long. I know how frustrating it must have been for those of you who really wanted this utility. I really, really, whole-heartedly apologize to you. There is no excuse. (If you're interested, I moved to Japan, my laptop harddisk crashed, I got engaged, and I've been learning how to work mad hours at a Japanese company.)

Now for the good news! Luckily, I managed to save a copy of the utility on a friend's SVN repository. So I will be uploading a new link to it within 24 hours!

I'll do my best to contact those of you who wanted the script directly. I am so sorry!!! m(_ _)m

-Raku
 

Raku

Member

Hi all,

I've fixed the links! They now point to the files on Google Docs, so unless Google goes down, you should be able to access them in the forseeable future.

Thanks to those of you who contacted me directly to get this resolved.

Happy Coding/Designing/Creating!
Raku
 

Untra

Sponsor

This... This is one of the most amazing things I've ever seen...
If this could improve the ways databases could be made for independent games. Being able to directly work with the code in a games database.
I tip my hat to you sir. *tips hat*

Say, you know vgvgf is trying to make a rgss shell from just the code? He might be a tad interested in what you have here...
 

Raku

Member

Untra":2begxdao said:
This... This is one of the most amazing things I've ever seen...
Thanks! I'm glad you like it.

Untra":2begxdao said:
If this could improve the ways databases could be made for independent games. Being able to directly work with the code in a games database.
I tip my hat to you sir. *tips hat*
I have considered that, instead of exporting to text files (for versioning), all of the game data could be exported into an external database (for example, mySQL or more simply CouchDB). It seems (without looking deeply into it) that the RGSS scripts in RMXP could be modified to load all the data directly from the database instead of the .rxdata files. But I'm not sure off the top of my head any compelling reasons to do this. If you have any ideas for how this utility could improve game databases, I'm all ears. :)

Thanks for pointing me to vgvgf's ARGSS project page! I'll keep my eye on its development.
 

bogey

Member

Raku, thank you very much, you saved my day. Otherwise I would have started programming this myself. Great work!!! Any chance you will put the code in an SVN or GIT repository from where new versions can be maintained :)?
 

Raku

Member

bogey":39tc2sue said:
Raku, thank you very much, you saved my day. Otherwise I would have started programming this myself. Great work!!! Any chance you will put the code in an SVN or GIT repository from where new versions can be maintained :)?

Hi bogey,

Sorry for not tending this topic. I took your advice and set up a Git repo on Github. It is for the RMXP Plugin System which is an improvement on this utility. In fact it does the same thing, but supports extension for other plugin-like features (for example, patching potentially).

https://github.com/rakudayo/rmxp-plugin-system

It's public, so anyone can fork it and submit their own changes when bugs are discovered, or if anyone wants to submit new plugins.

Regards,
Raku
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top