EasyRPG Player 0.5 “Potion”

It took a long time but we finally reached a new milestone 0.5 with codename “Potion” and we promise you: The waiting time was totally worth it. Initially we planned to do a 0.4.2 release in-between, but we were busy adding too many new cool features. Therefore we wanted to integrate them properly before doing another release. If you can’t wait go directly to our download section.

Two of the bigger achievements in this milestone are a completely new audio interface and huge performance improvements. These changes had the biggest impact on the Wii version, for the first time you can experience completely working audio and a constant frame rate (in most situations). EasyRPG Player runs now as homebrew on the Nintendo 3DS and the PlayStation Vita, raising our supported system count to nine! Another long awaited addition is the new user interface for the Android version, which should finally run properly on Android 6.0 and features a beautiful game browser.

Alongside these additional features we fixed tons of interpreter problems, improved the accuracy of both map and battle interpreter, which are now very close to RPG_RT, and implemented many missing battle commands. When your game did not run in 0.4.1: It should run now, otherwise please file a bug ;).

Table of Content

Audio Interface

One of the worst parts of EasyRPG Player was the Audio system. We use a library called SDL2_mixer for this, but it has some serious shortcomings for us: The problem is that we have to support arbitrary audio files, because any game uses different formats (Stereo, Mono, compressed WAV (ADPCM), uncompressed WAV (PCM), MP3, …) with different sample rates (e.g. 8 kHz, 44.1 kHz, 48 kHz) and SDL2_mixer does not support arbitrary resampling of these formats, which usually resulted in noise. The worst was the MP3 playback, most files were not even detected as MP3 because the MP3 format has no magic (common byte sequence) in the header and the heuristic often failed. Furthermore some features like pitch changes (playback speed) were impossible to implement.

We are happy to announce that all audio problems are now completely solved! The solution to all these problems is our new Audio Decoder. We still use SDL2_mixer for the playback, but the whole decoding and resampling is now done by our own code.

The libraries and their purpose:

  • WAV: Using libsndfile (#859) and a built-in WAV decoder for PCM files on platforms with slow file access (embedded systems like PSVita and 3DS, #984)
  • MP3: Using libmpg123. Additionally we added an heuristic to detect the MP3 files which were previously not playing at all for example because they had an empty frame (0-bytes) at the beginning (#818).
  • MIDI: As a built-in MIDI decoder we use FmMidi which synthesizes the audio on-the-fly. This has the advantage that it is very small (we use it now for Emscripten, saves you 16 MB of download) but quite resource heavy (#752). Alternatively we support WildMidi, which is compatible to the files Timidity in SDL2_mixer used before (#923).
  • OGG: Using libogg and libvorbis. OGG is an EasyRPG extension, the only game we know that uses OGG is Oneshot, but this game is so heavily modified that it does not work in our Player at all (#923).
  • MOD: Using xmp or xmp-lite. Tracker files are supported in RPG_RT through Audioremony and very few games (e.g. AE) use them (#967). This is currently only enabled for Linux, Android and the Wii. Other platforms follow later (Windows and MacOS already support MOD through SDL).

All the resampling magic in the background and the pitch (playback speed) is handled by libspeexdsp or libsamplerate (#908).

Additionally we added a caching system for sound effects, this fixes many lags that happened on slow hardware (mainly a problem on Wii, #1016).

The worst system concerning audio was the Wii. It had no working resampling at all, everything played too fast or too slow. But all these changes allowed us, after waiting for three years, to provide a Wii version with correctly working audio!

tl;dr Audio is the smallest of our worries now…

Performance

Another annoyance in EasyRPG Player on slow embedded hardware (especially the Wii) was the rendering performance and the startup time. At the beginning starting Yume Nikki on the Nintendo 3DS took more than 5 minutes (the Wii had similar problems). The reason for this is that our FileFinder did an extra system call to get the filetype for each file it encountered, but this information is actually already provided when iterating the directory. Removing this unnecessary function call improved the startup time by almost infinity% (#846).

The next problem we had to deal with on the old 3DS was that it only reached 25 FPS. Due to many small improvements in the rendering code (e.g. not rendering the background when no transparent tile is on the screen or not using a Blit that respects alpha when the bitmap is opaque), we were able to reach 60 FPS on the TestGame map. These changes gave a ~25% gain on all platforms, which means the Player performs much better everywhere and gives a much smoother experience.

Even worse were Tone changes (coloring the whole screen) and Saturation changes (Greyscale and Oversaturation), these were the biggest performance killers in the whole Player. Besides that oversaturating was never rendered correctly, we improved the performance of all screen effects by at least 50%. And even better: When the fading part of the effect is finished and the colorization stays constant the speed penalty is zero due to an improved caching strategy which only renders the tone effect once per Sprite and Tilemap tile (#855, #1017).

And the last addition is an improved Bitmap caching strategy which keeps loaded graphics longer in the memory, this improves the performance for commonly accessed graphics (#1018).

Map and event interpreter

RPG Maker 2000/2003 has an interesting feature for event movement: When events walk behind each other in a row and an event that is not at the front of the row is blocked in movement it will ask the event in front to make way by preempting it’s update routine. When this was successful the event continues it’s move. This is completely different behavior to all other interpreter situations where it goes from lowest to highest ID and no way to change it (#884). Implementing this fixed the caterpillar system (#703) in Pom Gets Wi-Fi and resolved a hang that happened after “Stop!” message. That Stop situation was another corner case of that corner case: The event asked the other to make way but with another side effect: When the collided event executes a Wait event the wait will go down twice as fast! This quirk is now implemented (#937) and it doesn’t hang anymore. A hang in the intro of Aurora Wing got fixed in the same way. This was related to diagonal movement and the order of movements (#1030). Unfortunately the game hangs a few minutes later after the enemy finished his move and is still unplayable.

The Events “Set Teleport/Escape Place” and “Enable/Disable Teleport/Escape” got implemented. These commands are quite unloved, only a few Japanese people reported them missing (#690). Together with this we fixed another oversight: Items that invoke skills that toggle switches were not working.

When visiting an Inn the screen fades out, the BGM plays exactly once and the screen fades in again. When the Inn music failed to load the “Played once” flag was never set and the game froze (#956).

Classes in RPG Maker 2003 are a really strange feature and their handling is not intuitive at all. We noticed that class modifiers (Curves, Single/Dual Weapon, …) are not applied at all on startup, but only when “Change Class” in executed. This behavior is correctly implemented now, but the “Change Class” command itself still behaves wrong for some cases. We plan to fix this in the next release (#921).

Battle encounters are not triggered anymore when the Player is in the airship (#928).

The amount of snow got heavily reduced, the effect was adjusted and the snowflakes are smaller. This matches now better the amount of snow RPG_RT renders (#901).

In PeuterisGrey The heroine did two steps instead of one when moving. This was a problem in our handling of the remaining steps, these were decreased one frame too late (#872). Furthermore this game simulates deleting of characters in the message box by using instant speed commands “\>”. Instant speed was not correctly handled in all cases. The flickering in the message box is normal and happens in RPG_RT, too (#871).

We are aware of another bug in this game which results in strange screen scrolling, this is not fixed by now.

Multiple issues in Embric of Wulfhammer’s Castle got resolved: The Post-credits scene appeared twice. This was a bug in KeyInput handling when a message box was visible (#963). A paper note in the game was not displayed at all because we ignored the “Wait for Input” option supported by picture commands (#831). The battle animations used for the battlers were not correctly saved in the Player, resulting in a load error when using them in RPG_RT (#602).

Ib had problems with statues in the Yellow space which randomly disappeared and a hang in the disturbing doll room (#946).

Dragon Quest IV: The Legend of Rivast got stuck after displaying the custom menu. This was due to a race condition between events, because our message boxes rendered too fast. The rendering speed is now on-sync with RPG_RT behavior (#989).

The cursor was not moving in Dhux Scar when using the navigation map. The Key input event waits now when a message is visible (#929).

When opening the custom menu system in Calm Falls the normal RPG Maker menu opened instead (#940). Something similar happened in Vampires Dawn, the RPG Maker menu opened after the custom menu got closed.

A popular patch in the German Community is Ineluki’s MP3 patch. This adds MP3 support to very old versions of RPG Maker 2000 by replacing the harmony.dll with a custom version. The patch works through “link-files”, these are text files in the Music folder with name “audiofile.link.wav” and the first line in these files points to the path of the MP3 file. We provide limited support for this now, the linked Audio file (for doesn’t matter, but is only used for MP3) is played now as the BGM. Multiple BGMs and disabling of looping (no loop statement in 2nd line of the link file) are unsupported. This results in working audio in Calm Falls (#939).

The game 葬 (Sou) hanged after entering a new map. This was caused by an auto-starting event that takes 1 frame to complete and Player wasted one frame when restarting this event, which resulted in timing problems (#927).

Leaving of some maps was impossible in Echoes of the Past, they were automatically re-entered. This game uses a parallel event to trigger teleports based on the Player position and after leaving the map the Player continued his movement and triggered the on-touch teleport to the old map again (#903).

Dragonball Z: Legend of Z resulted in a buffer overflow in the Player. For debugging purposes we write the map name and the LMT path in a logfile and the write function uses a predefined buffer which is usually big enough, but this game used such a deep tree that it exceeded the limit and overflowed the buffer. We added a sanity check (#891).

.flow is a RPG Maker 2000 game, but it got converted to a RPG Maker 2003 game. Player detected it incorrectly and the menu was empty. This doesn’t happen in the original game because it still uses a RPG_RT from RPG Maker 2000. We improved our engine detection to handle this corner case correctly (#885).

flow-0.5-fixedAn interpreter hang in (修正版)のび太戦記~導かれし者達~ got fixed (#860).

The extremely long intro cutscene in もえ~伝 crashed because of invalid weather effects (#860).

Bullets stayed in the air and didn’t move in Desolate City (#860).

The picture commands in サ イコ・プラトーン(PsycoPlatoon) behaved incorrectly (#906).

もしもスマブラだったら: This is a really awesome Super Smash Bros. clone. A problem we observed here was that characters couldn’t fall out of the bottom of the arena. This was a problem in our screen code, the scrolling was off by two pixels (#892).

The gun in Doraemon: Nobita’s Resident Evil 2 did not hit enemies more than one tile away. Additionally the gun was always shooting downwards. This was due to a problem with move events that changed the orientation follwed by an event page change (#1019).

Message commands can contain command codes in \N hero names. Player did not interpret them before, which resulted in incorrect message rendering in The Longing Ribbon and other games (#460).

The Longing Ribbon: Fixed in 0.5Vampires Dawn: Skills that toggle switches (e.g. “Fledermausverwandlung”) were not consuming SP (#816).

When entering the bed in the spaceship in Yume Nikki the screen scrolled incorrectly (#801). The same happened at the beginning of Ara Fell when jumping over the first gap.

The bullets in the bullet hell game 特に理由のない暴力がウォーターⅠを襲う where not moving towards the player but got stuck or moved to the right making this game incredible easy (#1023). This was a bug in the handling of switch and variable events that only modify a single switch/variable. These event commands support setting of a range and the Player used the range code for the single case because start equals end in this case, but these games had invalid values for end.

Win’ Wind’ Windy’: The first intro screen was not rendering correctly. A similar bug was in stage 3-6: The Vampire was not moving at all (#1024). This was the same bug as explained above the video.

The game Razas got stuck before the start menu appeared because of incorrect handling of “Erase Event” in Parallel events (#1022).

Battle system and Interpreter

In previous versions the state of the battle system was very basic. The event interpreter was unfinished, states (Blind, Berserk & co.) were not correctly implemented and modifiers (e.g. SP halved, immune to some elemental attacks and others) were unsupported. Most of the battle improvements were tested against Ara Fell, this game should run (almost) error-free now (#897, #905).

For the battle system we used a different interpreter due to different event commands, but in RPG Maker 2003 you can invoke all the map event commands through a common event. Most event commands (Except the ones that make no sense in battle at all) were moved to our shared interpreter mode and run properly in battle now (#788). Another problem in the 2003 version is the strange execution order of event pages compared to RPG Maker 2000 battles where the pages are executed in a total logical order. The event page order got changed to:

  1. The Turn counter is increased (global battle and current actor counter)
  2. Pages with turn-based (doesn’t matter if battle or actor-based) event triggers or battle action triggers run
  3. The Battle action is executed
  4. Pages with other event triggers run

This replicates now the observed behaviour in the original interpreter (#488).

Variable Operations for Battles got added to the interpreter, the conditional branch “Monster is Target” was implemented, the enemy action condition “Party size” was added and the event command “Force Flee” got implemented.

The algorithm used for choosing the enemy actions got fixed. It selects now the candidate with the highest probability and then adds further candidates that are up to 9 less in probability and then picks one of them randomly. Before it used all candidates in the random pick. Furthermore enemy actions can toggle switches now.

The battler animations reflect a new state now immediately, before it was only updated when the battlers had a turn or got hit. Event commands can kill or revive battlers now and the sprites correctly switch to the proper state (#380).

The actor placement in Space Funeral: EARTH BIRTH was wrong because we used an incorrect default value for X and Y position (#851).

SpaceFuneral fixed in 0.5Monsters use now the battle animation with ID 1 when doing normal attacks. Battle animations that targeted the whole group were displayed incorrectly. Unterwegs in Düsterburg uses this when a battle starts to display the actors in the party (#782).

Terrain settings for battles were not correctly applied, resulting in incorrect background images being used (#789).

Heal items that heal or revive give now the correct amount of HP (#568). Automatic healing of states (e.g. X% heal chance when hit or Heals with X% chance after Y turns) is implemented now.

Formula improvements:

  • The Skill formula was wrong and usually resulted in too much damage making battles really easy
  • The Skill formula respects the flag “Ignore Defense” now.
  • Elements of the used weapon or skill are considered now in the damage calculation
  • When an actor wears an item with flag “increased dodge rate” the dodge rate is now 90%, not 70%
  • The handling of critical hit probability was completely wrong. We interpreted it as “X percent of attacks”, not as “1 out of X attacks”. Critical hits are now much more unlikely.
  • The defense command displays now the defending state correctly and the defense state is considered in the damage calculation.

The item modifiers “SP costs halved”, “Preemptive” (Gauge is full on battle start), “Using item costs SP” and “Increased dodge rate” are implemented now.

The gauge is not updated anymore for actors that can’t act (Sleeping).

This short video of Ara Fell is a perfect summary of many obvious improvements in the battle system since 0.5: The background is correct, the animations of the battler are fixed, multi target skills show animations on all targets and the damage calculation is correct.

New Android User Interface

The Android interface got a huge pile of improvements. The old interface used old legacy UI (for Android 2.3.3) everywhere and this caused many incompatibilities especially on Samsung devices. The most frustrating problem was the non-working menu which made Layout editing impossible. Thanks to the Android App Compat library we are able to provide a modern looking interface on all Android versions and solve all usability problems in one go (#919, #925, #982).

The new Android Gamebrowser
The new Android Gamebrowser
The new Android menu
The new Android menu

Another new functionality is the possibility to disable sounds in the application settings (#835).

Emscripten (Player for the Web)

Our latest version of Emscripten does not need PHP on the server anymore. Instead we use a JSON-based index file to resolve file references (#833). Please see the tutorial for setup instructions.

The first game using this new version is Dogengam which is hosted on itch.io. How about presenting your own game on a website, too?

Dogengam offers an exceptional, artistic style.
Dogengam offers an exceptional, artistic style

Timidity got removed and replaced by FmMidi, this reduces the startup time because you only have to download 4 MB now instead of 20.

We fixed a bug in the URL encoding, % and # were not properly encoded (#894).

Ports for PS Vita and Nintendo 3DS

Thanks to Rinnegatamante the Player runs now on PlayStation Vita and Nintendo 3DS (#863, #973). The compatibility is similar to all other versions and they are regularly recompiled in our nightly build section.

A few issues are not fixed yet: The 3Ds version has no working Midi and a few sound effects are broken (loud static noise). The PSVita version has a bit of lag when too many sound effects are played and lacks the sound effect cache.

Please see the dedicated articles for PS Vita and Nintendo 3DS.

PS Vita Video (Direct link):

Nintendo 3DS Video (Direct link). Warning: Don’t use headphones, loud static noise!

Misc

Yume2kki used invalid initial equipment which resulted in having some items after startup which you were not supposed to have. The problem here was that the hero had items of invalid type equipped (e.g. a Sword that was actually Armor). These items are now filtered and we noticed that many games had the same problem (#977). Another problem was that this game tries to save memory by referencing images outside of the expected path, e.g. they access a Title image as Panorama by using “../Title/Title”. Our FileFinder understands such paths now, traversal outside of the game directory is still prohibited (#976).

Nepheshel contained an invalid system graphic in the title scene, this resulted in a libpng error (IDAT: invalid distance too far back) and a termination of the game. We improved all picture related error handling and they fall back gracefully now and only show a warning (#856).

Bitmaps with a depth of less then 8 bit crashed. RPG_RT didn’t support them, see this as an enhancement in our superior RPG_RT replacement (#432).

Mac OS X does not set the working directory when being double clicked from the File browser, we added additional code which adjusts the startup directory. The Player behaves now like in all other operating systems when started this way (#705).

The encoding detection algorithm got improved, it detects now the language of Yume Nikki and Yume2kki correctly but still fails for .flow (#986).

While in TestPlay mode the Debug menu (F9) is now reachable through the menu. Besides editing variables and switches it supports now saving and loading, too. For quicker save access press F11. (#966)

New Debug Menu
New option Debug with access to the debug menu

The Windows RT version is currently broken, we are working on a fix and provide this release later.

The GCW Zero version is unmaintained and there will be no 0.5 release in it’s current state. If you want to help, please contact us.

For developers

Our code is now completely free of Boost dependencies. Any boost-related code got replaced with the C++11 equivalent (#842).

Our audio system got heavily changed and has many new dependencies. Please see the library list under “Audio Interface” for additional information. New libraries: libsndfile, libmpg123, libogg, libwildmidi, libxmp OR libxmp-lite, libspeexdsp OR libsamplerate.

We updated the CMake File, it is now on-par with autoconf again (#952).