Running RPG Maker 2000/2003 games in Wine (on GNU/Linux)

While we develop our Player, we often need to run games in the original engine. Under Windows, this is usually no problem, but under other operating systems only wine or a virtual machine can be used.

When using wine, fonts may look bad:

This seems to happen, because the font gets anti-aliased (a blurry outline is added) and then is rendered opaque. The solution is to not use wine’s font rendering.

To disable Render extension and fallback to native (i.e. fontconfig):

$ wine reg add "HKEY_CURRENT_USER\Software\Wine\AppDefaults\RPG_RT.exe\X11 Driver" /v "ClientSideWithRender" /t REG_SZ /d "N"

Create a fonts-noaa.conf file with the following contents, which overrides only the anti-aliasing setting:

<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
 <!-- load default settings -->
 <include>/etc/fonts/fonts.conf</include>
 <!-- disable anti-aliasing -->
 <match target="font">
  <edit mode="assign" name="rgba">
   <const>none</const>
  </edit>
 </match>
</fontconfig>

Then launch RPG_RT with the font configuration overridden:

$ FONTCONFIG_FILE=/path/to/fonts-noaa.conf wine /path/to/RPG_RT.exe NormalPlay ShowTitle Window

Now it should look like this:

To make this easier I created a launcher script which does this automatically. You can find this script and the fontconfig configuration in this gist.

In case of music problems, which happened for me with MP3, the native libraries (libmpg123 via gstreamer) can be disabled and the original Windows decoder can be used.

To disable gstreamer for RPG_RT:

$ wine reg add "HKEY_CURRENT_USER\Software\Wine\AppDefaults\RPG_RT.exe\DllOverrides" /v "winegstreamer" /t REG_SZ /d ""

Then quartz and devenum are needed for media playback:

$ winetricks quartz
$ winetricks devenum

This post is based on a blog post by our friend kakurasan. Thanks!

EasyRPG Player 0.5.3 “Stimulant”

We continue our one release per quarter-cycle and release “Stimulant”. Besides initial RPG Maker 2003 1.12 support this is a pure bugfix release.

Unfortunately most of the issues cannot be illustrated this time, expect a less visual blog post than usual :(.

Regressions fixed

Listed here are bugs that were introduced between 0.5.1 and 0.5.2 and have been fixed in 0.5.3.

  • The Player crashes when attempting to use a healing item outside of the battle (#1221).
  • The last-minute “battle encounters based on terrain tag” patch in 0.5.2 contained a bug for the default case: When the terrain tag array is shorter than the current terrain ID, it defaults to true instead of false. This broke battle encounters in Vampires Dawn completely (#1218).
  • A change in the logic whether characters or tiles are drawn for events resulted in a rendering error in Yume 2kki: It uses event tiles with no name. They were rendered as black boxes but must be rendered transparently instead (#1228).
  • The \N[X] actor name function didn’t work correctly anymore (#1229).
  • We reworked the name input scene to match the RPG_RT behaviour and only show two pages per language, e.g. Hiragana and Katakana for Japanese and Latin alphabet and ExFont for Western Europe. Unfortunately this broke a riddle in Ib, because the English translation by vgperson was auto-detected as Japanese and this made it impossible to input the solution (#1272).
  • Battlers are affected by screen shake again (#1280).

A few hours before release another regression was noticed which was introduced in 0.5.2 when placeholder support for the official RPG Maker 2000 English version was implemented: The actor name is shown by default in “critical hit” messages which causes grammatical errors. Because this is only a cosmetic bug and we are already in code freeze we decided to delay a fix to the next release.

RPG Maker 2003 1.12

A few weeks ago a new version of RPG Maker 2003 was released which heavily extends ShowPicture with new functionality like spritesheets and pictures in battle.

EasyRPG Player already implements most of the new picture features except pictures in battle and affected by Tone, shake or flash (#1273).

Additionally “This Event” can be used in Common events now. We support this now for all versions of the engine except for “Erase Event” because this event command results in a no-op instead of an error. We had to keep it disabled for old engine versions because this breaks games otherwise (#1265).

A look in the future

In an attempt to make the Player more stable, all RPG Maker data will be sanitized to detect out of bounds access and invalid data. The main motivation for this is to catch new game bugs more easily but as a side-effect it will also make the Player more exploit-safe.

EasyRPG Player will come to two additional platforms: iOS and ChromeOS through a Chrome App. The Chrome app is mostly finished and the iOS app still lacks some parts of the GUI, especially the layout editor. We will announce when any of the apps is ready but do not expect the iOS app to be submitted to the App Store because the yearly fee is expensive and Apple will very likely reject us.

A virtual filesystem is under development, this allows e.g. running games from ZIP archives or games that are embedded in the Android APK. Together with the optional dependency PhysFS, more archive formats like 7zip will be supported, too. But due to solid compression (full decompression of one file requires decompression of additional files) RAR and 7zip will usually be too slow.

Fixes

A visual error in El Heredero del Rey was caused by handling the character orientation after a page change incorrectly: When both pages contain the same default direction the current direction of the actor is not altered (#1226).

Correct character shown in EHR

Battle2 animations (the large ones) were handled incorrectly. The original logic looked for a normal battle animation and afterwards for a large one but there is a field in the database which indicates if the large battle animation is to be used. This fixes a visual error after defeating the knife-monkeys in El Heredero del Rey and simplifies the code (#1234).

The elevator in HOME was not working. A workaround was to smash the enter button but the proper fix was to disable action events when an autostart event is pending (#1109).

Key Input handling had two bugs (#1217):

  • When “Wait for input” was active the variable that contains the time until the input happened was not reset to 0 at the beginning.
  • When key input was non-blocking the time variable was still reset to 0 instead of ignoring it.

The Violated Heroine became stuck when walking through the East Gate. This was caused by another timing issue: An event with a lower ID than the last running event started in the same frame instead of the next one (#1132).

Aurora Wing: did not continue after the first enemy turn.  Intro has a skippable hang and first battle gets stuck after enemy turn. The game checks if a variable contains 999,999 which is the maximum variable value in RPG Maker 2000. Unfortunately, our Player defaulted to the RPG Maker 2003 maximum 9,999,999. Resulting in the variable being higher than the game expected (#1002).

In the dungeon crawler 題名のない竜退治 the interpreter got stuck after collecting an item. This was caused by an “Erase Event” call in a map event that was called by a parallel process. The interpreter continues now correctly after this case (#1243).

Celestial Silfade Story (シルフェイド幻想譚) froze sometimes after using an attack command in the custom battle system. This was caused by a misalignment of the screen which was off by 2 pixels (#1064).

Additionally, this game uses timers to show the current time of the day. The rendering was off by one frame resulting in heavy flickering (#1245).

When the Teleport or Escape skills target an area instead of a map the area is replaced with the map it belongs to. This fixes the game DQ2悪霊の勇者・製品版ver1.50 (#1253).

We found a game that abuses an implementation detail in the event comment “Set Vehicle Position”: When the party is not in a vehicle the vehicle ID of the party is -1. When -1 is used as the vehicle to move the party is moved around instead (#1257). Furthermore an intended behaviour was not implemented: When the party is in a vehicle the party is moved to together with the vehicle.

The interpreter was not refreshed when a move route altered a switch. This fixes a cutscene in Desolate City (#1232).

Misc

The hero name input scene supports now Simplified Chinese (#1239) and Russian (#1278). Additionally, the name input scene code was modified in order to always show the Latin alphabet and ExFont pages (#1284).

Chinese name input
Russian name input

Sound effects stop now when the Player returns to the title screen (#1147).

The background for battles started with the “Start Battle” event command were wrong when a random encounter happened before. This was caused by an incomplete variable reset when the former battle ended (#1224).

All RPG Maker 2003 backgrounds filled the log with “Image size out of bounds” messages because the check used RPG Maker 2000 background sizes which are smaller (#1223).

When switching back to Window mode under Linux the Window sometimes stayed fullscreen with the window rendered in a corner. This was fixed for the F4 and F5 case, but using your window manager to go to fullscreen and back still may not work as expected (#383).

Android

When the screen was rotated while the Player was running in the background the viewport was partly offscreen after returning. This was fixed by updating to the latest version of SDL2 (#1185).

Deprecation of the Windows RT port

To make the Windows maintenance easier, we are going to switch to the vcpkg tool for compiling our dependencies after this release. This tool does not support ARM Desktop Apps which were required for the unsuccessful Windows RT. Therefore this will be the last version of EasyRPG Player that runs on the Windows RT platform.

UWP for ARM is supported by vcpkg, so if we ever release a Windows Store version of the Player, it will run on ARM, too.

liblcf

The new RPG Maker 2003 1.12 picture chunks were added to liblcf (#213).

The system graphic stretch setting (tiled or stretched) was not correctly restored from savegames created by RPG_RT (#214).

A bug in liblcf was fixed which resulted in corrupted LDB files (Stream read error). The error was quite trivial: We wrote one zero-byte too much at the end of the file… Now lcf2xml can finally be used to modify databases properly (#209).

The input/output API uses now C++ iostreams instead of filenames. This makes the library suitable for the planned Player VFS and will fix unicode related problems under Windows (#206).

The liblcf code generator uses now Jinja2. This will make extending liblcf easier (#202).

EasyRPG Player 0.5.2 “Miracle Candy”

Only three months after the last release we have another update for you before we take a development break for the summer.

This time with a fix for a critical bug that snuck in right before 0.5.1 and corrupted savegames of non-English games. This was especially bad in Yume Nikki because it completely broke the Save and the Player was stuck at the loading screen of the game.

Map

Hero graphics are always reset now when they were changed by a move route command and a teleport happens. Before the reset only occurred when the teleport was to a new map. (#1111)

The birds in a quite cruel minigame in Deep 8 play now the dead animation properly. This was a bug in our interpreter: The movement pattern of the new event page was not applied under all conditions. (#1112)

We handled timers incorrectly. Some games had code that checked e.g. for “Timer >= 1s” followed by “Timer <= 0s”. By looking at it both cases should be false for the time between 0.99s and 0.01s but RPG_RT rounds up the timer checks to the next second and EasyRPG does the same now. (#1165)

The timer functions of “Control Variable” wrote the frame count into the variable, not the seconds. This broke the intro of The Sacred Tears: TRUE. (#1166)

A regression introduced in 0.5.2 which broke horizontal parallax scrolling was fixed. (#1148)

The algorithm of movement type “cycle” matches now closer the RPG_RT behaviour:

  • When the character is ready to move, he will first try moving forward (or in the default direction if we are facing the wrong way: Right for Left-Right, Down for Up-Down)
  • If that failed for 20 frames, keep trying to move forward, but if it fails, now try moving the opposite way too.
  • If that fails for 40 more frames, try going forward and if it fails, now move (do not just try to move) in the opposite way, and reset.

As you can see in the video of Deep 8 below, Chloe walks now in the correct direction. Since it is a looping map, she passes by multiple times in the incorrect version which looks funny. (#1167)

Additionally the video illustrates the new font we support (mentioned further below).

Tile 0 is now always drawn, before our code assumed that this tile is always transparent. (#1169)

Tile ID 0 is rendered now. No mice anymore ;)

Pan screen commands that go out of bounds are ignored now. Before the Player calculated the offset which went out of bounds, e.g. when the camera is at the right map border and the screen is panned by 3 right and 3 left nothing happens, but in reality the screen must scroll 3 tiles to the left as RPG_RT does. This fixes the incorrect camera in the Razas intro. (#1169)

Correct screen panning in Razas

The hero jumps now in the correct direction after touching a “!”-switch in Super Mario RPG – The Seven Sages. Jumping did not respect the turn commands before. (#1171)

The collision check based on the tile id in Schmetterlinkskuh-Flugsimulator-Simulation 2k did not work, because the tile id command did not handle looping maps correctly. (#1176)

Our message box code crashed when a hero name (indirectly) referenced itself with a message command, e.g. Hero 1 with name \N[1] would endlessly substitute the first hero name with itself. (#1145)

Battle

The English release of RPG Maker 2000, v1.61 is detected now and the message substitution by placeholders and automatic linebreak feature was implemented. (#588)

Text substitution is supported now in the RPG2k v1.61 battle system.

The well hidden “Appear Randomly” option in the troop context menu of RPG Maker 2003 was implemented. (#987)

The battle against the nurse in 7thjojo was not winnable, because the battle ended when all party members were removed. This was introduced to fix The Huntress of the Hollow in the last version but the behaviour was wrong: Only RPG Maker 2003 ends the event execution immediately when the enemy party is defeated. For the ally party case and RPG Maker 2000 the victory/lose check happens after the event execution finishes. (#1180)

Battle encounters respect now the current tile – sea monsters will not appear on land anymore.

The “Change Enemy HP” command did not end the RPG2k battle when the last monster died when the event was executed at the beginning of a new battle turn. (#1191)

Conditions for enemies in RPG2k battle which prevent them from attacking are respected now (#1204).

Internationalization

In RPG Maker it is possible to choose between two different fonts: In the unofficial translation by Don they are called RMG2000 and RM2000 and in the Japanese version they are MS Gothic and MS Mincho. (#352)
For non-CJK (Chinese, Japanese and Korean) languages a new font as a replacement for RM2000 was added: ttyp0. The look and feel is similar to Don’s RM2000 font.
The RMG2000 uses a font similar to Shinonome (which is the font we already used before).
For CJK-games not much changes, our already built-in Shinonome Gothic and Mincho are used but with the following changes compared to RMG2000:

  • ` (grave accent) is an opening quote
  • ' (straight apostrophe) is a closing quote
  • " (straight double quote) is a closing double quote
  • Cyrillic and Greek characters are double-width
  • ellipsis … is in the middle of the line
Illustrated are the old font and the new font. Both fonts are supported and they depend on the font setting of the game.
Illustrated are the old font and the new font. Both fonts are supported and they depend on the font setting of the game.
Support for additional scripts: Greek and Armenian. Though we are not aware of any games with these languages :(

The “Enter Hero Name” scene does not show Hiragana and Katakana anymore when playing a non-Japanese game. This caused a lot of confusion for years. We plan to add custom pages with glyphs related to the current language later. (#364)

The Korean RTP was added to our built-in RTP table. This means when you have the Japanese RTP installed it is possible to play Korean RTP games, too. (#452)

The Japanese name input scene shows now ヴ instead of を or ヲ which are very uncommon in Japanese names. (#1193)

Audio

The Opus audio codec is now supported for both music and sound. This is especially useful for the web player because it reduces the filesize a lot. (#1159)

Misc

The output system, consisting of the on-screen console and the log file writer was improved: (#1199)

  • The message overlay can now collect all messages since startup and shows them when the graphic system is ready (e.g. the DSP firmware missing message on the 3DS), before they were only written to the logfile and usually not noticed by the user.
  • For file-log and on-screen similar messages increment now a counter which is appended to the line. For the file-log a message is always written twice: The 1st time it happens and a 2nd time how often it was duplicated (this is to ensure that something is logged in case of crashes)
  • The console does now automatic line breaking with the code written for the RPG Maker 2000 v1.61 battle system which requires this feature, too.
  • Path components outside of the game path are stripped now (see screenshot, look at the filenames reported). When the path is outside the game path it does nothing, so RTP paths are not touched.
The new on-screen console automatically inserts linebreaks now.

The “–load-game-id” command line argument ignored the “–save-path” option. This remained mostly unnoticed because the save path matches usually the project path except for the web player where it resulted in “File not found” errors. (#1174)

The Z index values which are used to define the rendering order of everything on the screen were refactored and all magic numbers are gone. This makes the code more maintainable and actually fixed a bug which resulted in heavy flickering because the rendering order of Pictures and battle animations was below the Screen effects. (#1062, #1195)

Android

The fast forward button was not rendered on all platforms, because some default fonts did not include it. (#1124)

The text is now properly centered in our on-screen buttons and hopefully does not overflow over the border anymore. (#1146)

The fast forward mode can be switched from “hold” to “tap” and the multiplier can be configured. (#1146)

Web Player

The file system used by the web player can be replaced through Module.EASYRPG_FS. This is useful to implement a server-backed savegame system and was implemented upon request of rmarchiv.de where you can see it in action. (#1173)

Using “Fast forward” in the web player skipped map loading and resulted in “Map not found” errors. (#1174)

Arrow keys do not scroll the browser window anymore. The F-buttons are filtered, too (not supported by all browsers). (#1188)

OSX

The project path was not correctly set when EasyRPG Player was executed from the command line. (#1175)

3DS

The Nintendo 3DS version does not crash anymore when the DSP firmware is missing and displays a visual warning instead. (#1142)

Similar to the Wii port the RTP is now searched in “/data/rtp/”.

The touchscreen reported the incorrect button since the beginning and nobody noticed it :(. A nice outline was added which highlights the currently pressed button.

PSVita

An unnecessary thread scheduling was removed in the rendering thread. However, this probably has no noticeable performance impact. (#1158)