- Joined
- Jan 7, 2019
- Messages
- 4
- Reaction score
- 3
- First Language
- FRENCH
- Primarily Uses
- RMVXA
Hello!
Glad to be here.
I currently work on VX Ace and something is really tearing me down with it.
When I use a script call Graphics.frame_rate = 120, all the game speeds up by 2. And vice-versa when I set it to 30, etc.
I would be glad to know how to make VX Ace less "Framerate dependant". Namely, that the game only gains fluidity when I set Graphics.frame_rate to 120, and feels laggy when I set it to 30.
I also started to think about that and tried to write a lil script that is available here:
https://www.dropbox.com/sh/f440k9tw6pfcyli/AACRP80nB7_4h1abf6jLpllva?dl=0
But during this little script session, I found that some animations, fade effects and such were coded in the built-in modules and classes, so they aren't easy to patch...
Among other, I can list:
- The cursor blink effect in all the Window_Selectable instances. [OK]
- The Message's "Pause" icon animation (the little arrow at the bottom of the window_message) [OK]
- The Scene_Menu fadeIn and fadeOut effects.
- Battle Animations
-Transitions (nah, it's okay. There is an argument "duration" for Graphics.transition)
My "priorities" would be:
- The cursor blink effect [OK]
- The Message's Pause Graphic animation [OK]
- The Battle Animations [ No Idea :/ ]
-(Eventually) the Transitions [ No Idea :/ ] [it's OK]
Does anyone know how to patch those elements of this listing to make them less "framerate dependant", as I started to do in my script for characters' moves and so on?
I'm looking forward to reading your responses,
Regards.
Glad to be here.
I currently work on VX Ace and something is really tearing me down with it.
When I use a script call Graphics.frame_rate = 120, all the game speeds up by 2. And vice-versa when I set it to 30, etc.
I would be glad to know how to make VX Ace less "Framerate dependant". Namely, that the game only gains fluidity when I set Graphics.frame_rate to 120, and feels laggy when I set it to 30.
I also started to think about that and tried to write a lil script that is available here:
https://www.dropbox.com/sh/f440k9tw6pfcyli/AACRP80nB7_4h1abf6jLpllva?dl=0
Code:
module BoubouEngine
module_function
def frame
(Graphics.frame_rate/60.0).round(2)
end
end
# Fix Parallax moves
class Game_Map
def update_parallax
@parallax_x += (@parallax_sx / 64.0) / BoubouEngine::frame if @parallax_loop_x
@parallax_y += (@parallax_sy / 64.0) / BoubouEngine::frame if @parallax_loop_y
end
end
# Fix fade and weather effects
class Game_Screen
def start_fadeout(duration)
@fadeout_duration = duration * BoubouEngine::frame
@fadein_duration = 0
end
def start_fadein(duration)
@fadein_duration = duration * BoubouEngine::frame
@fadeout_duration = 0
end
def start_tone_change(tone, duration)
@tone_target = tone.clone
@tone_duration = duration * BoubouEngine::frame
@tone = @tone_target.clone if @tone_duration == 0
end
def start_shake(power, speed, duration)
@shake_power = power
@shake_speed = speed
@shake_duration = duration * BoubouEngine::frame
end
def change_weather(type, power, duration)
@weather_type = type if type != :none || duration == 0
@weather_power_target = type == :none ? 0.0 : power.to_f
@weather_duration = duration * BoubouEngine::frame
@weather_power = @weather_power_target if duration == 0
end
end
# Fix characters move
class Game_CharacterBase
def distance_per_frame
(2 ** real_move_speed / 256.0) / BoubouEngine::frame
end
def update_animation
update_anime_count
if @anime_count > (18 - real_move_speed * 2) * BoubouEngine::frame
update_anime_pattern
@anime_count = 0
end
end
end
# Fix some Battle animations
class Sprite_Battler
def start_effect(effect_type)
@effect_type = effect_type
case @effect_type
when :appear
@effect_duration = 16 * BoubouEngine::frame
@battler_visible = true
when :disappear
@effect_duration = 32 * BoubouEngine::frame
@battler_visible = false
when :whiten
@effect_duration = 16 * BoubouEngine::frame
@battler_visible = true
when :blink
@effect_duration = 20 * BoubouEngine::frame
@battler_visible = true
when :collapse
@effect_duration = 48 * BoubouEngine::frame
@battler_visible = false
when :boss_collapse
@effect_duration = bitmap.height * BoubouEngine::frame
@battler_visible = false
when :instant_collapse
@effect_duration = 16 * BoubouEngine::frame
@battler_visible = false
end
revert_to_normal
end
end
# Fix some things about Windows
class Window_Base < Window
def update
super
update_tone
update_open if @opening
update_close if @closing
end
def update_open
self.openness += 48 / BoubouEngine::frame
@opening = false if open?
end
def update_close
self.openness -= 48 / BoubouEngine::frame
@closing = false if close?
end
def draw_text_ex(x, y, text)
reset_font_settings
text = convert_escape_characters(text)
pos = {:x => x, :y => y, :new_x => x, :height => calc_line_height(text)}
# ---
if Graphics.frame_rate < 60
g = ( 1 / ( BoubouEngine::frame ) ).to_i
process_character(text.slice!(0, g), text, pos) until text.empty?
else
process_character(text.slice!(0, 1), text, pos) until text.empty?
end
end
def process_character(c, text, pos)
# ---
f ||= 0
p ||= BoubouEngine::frame
if Graphics.frame_rate >= 60
while f < p
Fiber.yield unless SceneManager.scene_is?(Scene_Battle)
f += 1
end
f = 0
end
case c
when "\n" # New line
process_new_line(text, pos)
when "\f" # New page
process_new_page(text, pos)
when "\e" # Control character
process_escape_character(obtain_escape_code(text), text, pos)
else # Normal character
process_normal_character(c, pos)
end
end
end
But during this little script session, I found that some animations, fade effects and such were coded in the built-in modules and classes, so they aren't easy to patch...
Among other, I can list:
- The cursor blink effect in all the Window_Selectable instances. [OK]
- The Message's "Pause" icon animation (the little arrow at the bottom of the window_message) [OK]
- The Scene_Menu fadeIn and fadeOut effects.
- Battle Animations
-
My "priorities" would be:
- The cursor blink effect [OK]
- The Message's Pause Graphic animation [OK]
- The Battle Animations [ No Idea :/ ]
-
Does anyone know how to patch those elements of this listing to make them less "framerate dependant", as I started to do in my script for characters' moves and so on?
I'm looking forward to reading your responses,
Regards.
Last edited:


