RPG Maker Forums

Hi,

this is a minor bug I noticed in the standard scripts supplied with RPG Maker VX Ace.

Basically, when you transfer from one map to another one, the screen fades from the current map to black, changes the map, then fades from black to the new map. However, for the very first frame of the fade in (which isn't completely black anymore), the old map is still visible. Usually as the transition happens very quickly, this goes unnoticed, but if the game takes a bit to load (eg. the new map data), it becomes very apparent. You can put

Graphics.frame_rate = 10above your rgss_main function to see it clearly.

The bug lies in the "perform_transfer" method of Scene_Map:

  def perform_transfer    pre_transfer    $game_player.perform_transfer    post_transfer  end"pre_transfer" fades the screen to complete black. "$game_player.perform_transfer" sets up the new map data and stores it in a global location ($game_map). However, it does not yet apply the actual map data to the on screen Tilemap instance(!), because that's handled by Spriteset_Map. Next, "post_transfer" calls "fadein(fadein_speed)", which calls "fade_loop(duration)":

  def fade_loop(duration)    duration.times do |i|      yield 255 * (i + 1) / duration      update_for_fade    end  end(yield here is basically "Graphics.brightness="). As you can see, it first steps the brightness level, starting with 255 * 1 / duration (a tad brighter than pure black), and then updates the screen with "update_for_fade":

  def update_for_fade    update_basic    $game_map.update(false)    @spriteset.update  end"update_basic" at some point calls "Grahpics.update". But wait, the new map data hasn't been applied yet, right? So here at this point, the screen is redrawn with the old map data. Only two lines further down, "@spriteset.update" is actually called, which checks for new map data in $game_map and applies it to its internal Tilemap. So that's how we end up with one wrong frame.

Fixing this is absolutely trivial; we just have to make sure the new map data is applied before the fade in:

  def perform_transfer    pre_transfer    $game_player.perform_transfer    @spriteset.update # <-- new map data applied to Tilemap    post_transfer  endI'm posting this here in the hopes that a Degica / Enterbrain dev might see and fix it for a future update to VX Ace. It might not stand out as much on the standard RGSS3 Player.exe, but since I am developing an open source reimplementation of said player where I only lazily process new data (ie. new map data set for a Tilemap is only actually processed on the next "Graphics.update" call), this becomes very visible, especially on the first map transfer after starting the game (afterwards, not so much).

I tried searching the forums for "map transfer bug", but couldn't find anything, so I'm hoping this hasn't been reported before.

Thanks.

Latest Threads

Latest Profile Posts

Don't forget, aspiring writers: Personality isn't what your characters do, it is WHY they do it.
Hello! I would like to know if there are any pluggings or any way to customize how battles look?
I was thinking that when you start the battle for it to appear the eyes of your characters and opponents sorta like Ace Attorney.
Sadly I don't know how that would be possible so I would be needing help! If you can help me in any way I would really apreciate it!
The biggest debate we need to complete on which is better, Waffles or Pancakes?
rux
How is it going? :D
Day 9 of giveaways! 8 prizes today :D

Forum statistics

Threads
106,051
Messages
1,018,549
Members
137,836
Latest member
T62352536256t362
Top