The RPG Maker Resource Kit

Other Game Creation => Program Troubleshooting => Topic started by: qewlkid9 on February 04, 2007, 04:49:45 PM

Title: Avoid Lag? [not resolved]
Post by: qewlkid9 on February 04, 2007, 04:49:45 PM
Im using an ABS script and it lags like hell T_T. this completly ruins my game. how can i avoid lag? i lag on every map, even when im not fighting, and even when there isnt anything to battle!
Title: Re: Avoid Lag?
Post by: :) on February 04, 2007, 04:51:09 PM
anti lag script?


http://www.hbgames.org/forums/showthread.php?t=11639
Title: Re: Avoid Lag?
Post by: qewlkid9 on February 04, 2007, 05:08:25 PM
Quote from: Dr_Squidward on February 04, 2007, 04:51:09 PM
anti lag script?


http://www.hbgames.org/forums/showthread.php?t=11639

wow! tyvm!!!!
Title: Re: Avoid Lag?
Post by: :) on February 04, 2007, 05:09:05 PM
yea np, now add [RESOLVED] to topic title so people know you got helped.
Title: Re: Avoid Lag? [resolved]
Post by: qewlkid9 on February 04, 2007, 05:18:45 PM
>_< oh where do i add this? main script? make a new script and put it above main?
Title: Re: Avoid Lag? [resolved]
Post by: Blizzard on February 04, 2007, 05:29:56 PM
I don't think I am lying if I say, just use this one, it's better for you. Put it into a new one above main and problem solved.

#==============================================================================
# Blizz-ABS Event Anti-Lag (ABSEAL) by Blizzard
# Version: 1.0
# Date: 25.10.2006
#
#
# Compatibility:
#
# 99% compatible with SDK, not tested altough. 99% chance of compatibility with
# anything.
#
#
# Advantages compared to other Anti-Lag Systems:
#
# - much more compatible
# - faster and better processing
# - about 5 times less code
# - built-in option to disable in specific maps
# - configurable strength
#
#
# Introduction:
#
# This script will decrease the lag caused by too many events in maps by only
# updating the events visible on the screen and a little bit beyond.
# "Auto-Start" and "Parallel process" events are NOT affected by this script.
#
#
# Configuration:
#
# Put in "DISABLE_ANTI_LAG_IDS" any map IDs where the ABSEAL should be
# disabled. Change FACTOR to how many "tile squares" it should update beyond
# the screen. 2 is default, values under 1 will be corrected. Floating point
# numbers will be corrected.
#
#==============================================================================

#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# START Configuration
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

DISABLE_ANTI_LAG_IDS = []
FACTOR = 2

#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# END Configuration
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

#==============================================================================
# Game_Event
#==============================================================================

class Game_Event
 
  alias upd_player_blizzabs_later update
  def update
    upd_player_blizzabs_later if self.update?
  end
 
  def update?
    return true if DISABLE_ANTI_LAG_IDS.include?($game_map.map_id)
    return true if self.trigger == 3 or self.trigger == 4
    factor = FACTOR < 1 ? 1 : FACTOR.to_i
    return false if self.real_x <= $game_map.display_x - factor * 128
    return false if self.real_y <= $game_map.display_y - factor * 128
    return false if self.real_x >= $game_map.display_x + 2560 + factor * 128
    return false if self.real_y >= $game_map.display_y + 1920 + factor * 128
    return true
  end
 
end

#==============================================================================
# Sprite_Character
#==============================================================================

class Sprite_Character

  alias upd_player_blizzabs_later update
  def update
    if @character.is_a?(Game_Event)
      upd_player_blizzabs_later if @character.update?
    else
      upd_player_blizzabs_later
    end
  end

end



I am wondering why do people on hbgames.org always have to complicate such simple stuff. Do they want to appear like "YEAH, THIS IS SO HARD TO MAKE THAT IT IS EVEN HARD TO PUT INTO YOUR GAME! AND I CAN MAKE SOMETHING LIKE THIS! OBEY ME, I AM YOUR GOD!", or what?! I mean it has so much TOTALLY unneccesary code. And how can he say "it's faster" when it has more stuff to process?! Ridiculious.
I mean, look at my code, the instructions are as long as the code itself.  :-\
Title: Re: Avoid Lag? [not resolved]
Post by: :) on February 04, 2007, 05:40:43 PM
XD

thanks blizzy
Title: Re: Avoid Lag? [resolved]
Post by: qewlkid9 on February 04, 2007, 05:43:07 PM
Quote from: Dr_eadful on February 04, 2007, 05:29:56 PM
I don't think I am lying if I say, just use this one, it's better for you. Put it into a new one above main and problem solved.

#==============================================================================
# Blizz-ABS Event Anti-Lag (ABSEAL) by Blizzard
# Version: 1.0
# Date: 25.10.2006
#
#
# Compatibility:
#
# 99% compatible with SDK, not tested altough. 99% chance of compatibility with
# anything.
#
#
# Advantages compared to other Anti-Lag Systems:
#
# - much more compatible
# - faster and better processing
# - about 5 times less code
# - built-in option to disable in specific maps
# - configurable strength
#
#
# Introduction:
#
# This script will decrease the lag caused by too many events in maps by only
# updating the events visible on the screen and a little bit beyond.
# "Auto-Start" and "Parallel process" events are NOT affected by this script.
#
#
# Configuration:
#
# Put in "DISABLE_ANTI_LAG_IDS" any map IDs where the ABSEAL should be
# disabled. Change FACTOR to how many "tile squares" it should update beyond
# the screen. 2 is default, values under 1 will be corrected. Floating point
# numbers will be corrected.
#
#==============================================================================

#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# START Configuration
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

DISABLE_ANTI_LAG_IDS = []
FACTOR = 2

#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# END Configuration
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

#==============================================================================
# Game_Event
#==============================================================================

class Game_Event
 
  alias upd_player_blizzabs_later update
  def update
    upd_player_blizzabs_later if self.update?
  end
 
  def update?
    return true if DISABLE_ANTI_LAG_IDS.include?($game_map.map_id)
    return true if self.trigger == 3 or self.trigger == 4
    factor = FACTOR < 1 ? 1 : FACTOR.to_i
    return false if self.real_x <= $game_map.display_x - factor * 128
    return false if self.real_y <= $game_map.display_y - factor * 128
    return false if self.real_x >= $game_map.display_x + 2560 + factor * 128
    return false if self.real_y >= $game_map.display_y + 1920 + factor * 128
    return true
  end
 
end

#==============================================================================
# Sprite_Character
#==============================================================================

class Sprite_Character

  alias upd_player_blizzabs_later update
  def update
    if @character.is_a?(Game_Event)
      upd_player_blizzabs_later if @character.update?
    else
      upd_player_blizzabs_later
    end
  end

end



I am wondering why do people on hbgames.org always have to complicate such simple stuff. Do they want to appear like "YEAH, THIS IS SO HARD TO MAKE THAT IT IS EVEN HARD TO PUT INTO YOUR GAME! AND I CAN MAKE SOMETHING LIKE THIS! OBEY ME, I AM YOUR GOD!", or what?! I mean it has so much TOTALLY unneccesary code. And how can he say "it's faster" when it has more stuff to process?! Ridiculious.
I mean, look at my code, the instructions are as long as the code itself.  :-\
i did as u said and when i tried to test my game, the window would come up, but then immediatly crash.
Title: Re: Avoid Lag? [not resolved]
Post by: Blizzard on February 04, 2007, 05:44:53 PM
What's the error message? Post it.

EDIT:

OMG! I just found a script that makes movie stripes appear! xD And on top of that, IT NEEDS A PICTURE! xD

You can make it easily without a picture if you are using a script, or just use a picture with the "Show picture" event command. ::)

But the most ridiculious script I have ever seen is the "1 HP for dead heroes after the battle".
Title: Re: Avoid Lag? [not resolved]
Post by: qewlkid9 on February 04, 2007, 05:50:41 PM
the first time, there was no error message, it just crashed. i got it working eventually, but it still lagged! my character lagged, the text lagged, the events lagged. they would be fine until i got close to them then it would lag. sometimes it would be fine until i fought the monster in the map. then when i was done fighting the lag would go away. LAG!!!

edit: should i post my game so you can test it?
Title: Re: Avoid Lag? [not resolved]
Post by: Blizzard on February 04, 2007, 06:09:32 PM
How does it work with the other Anti-Lag script? If it still lags, post a demo with the scripts you use, I'll fix it.
Title: Re: Avoid Lag? [not resolved]
Post by: qewlkid9 on February 05, 2007, 12:22:15 AM
Quote from: Dr_eadful on February 04, 2007, 06:09:32 PM
How does it work with the other Anti-Lag script? If it still lags, post a demo with the scripts you use, I'll fix it.
i didnt know how to use the other one >_< ill just post my game
Title: Re: Avoid Lag? [not resolved]
Post by: qewlkid9 on February 05, 2007, 12:56:26 AM
http://files.filefront.com/The_Four_Legendszip/;6685862;;/fileinfo.html

please add the antilag script and make it work T_T
Title: Re: Avoid Lag? [not resolved]
Post by: :) on February 05, 2007, 03:38:03 AM
I havent click it, but maybe he needs sdk?
Title: Re: Avoid Lag? [not resolved]
Post by: &&&&&&&&&&&&& on February 05, 2007, 04:35:00 AM
It doesn't lagg on my computer... maybe your comp can't handle it...
Title: Re: Avoid Lag? [not resolved]
Post by: Chiakumu on February 05, 2007, 11:12:24 AM
How large are your maps, how big is your processor, and how much ram do you have? This information might help us but since it doesn't lag on Dr_Eden's personal computer, maybe it you might need some more ram?
Title: Re: Avoid Lag? [not resolved]
Post by: qewlkid9 on February 05, 2007, 02:49:36 PM
1.GHz, 1 gb of ram it says

my computer is new..im positive its not the computer.
Title: Re: Avoid Lag? [not resolved]
Post by: Blizzard on February 05, 2007, 04:09:42 PM
Quote from: qewlkid9 on February 05, 2007, 02:49:36 PM
1.GHz

It IS your computer. RMXP has a minimum requirement of 0.8GHz I think and a recommened of 1.5GHz.

And I can't download the game, because Filefront is a bitch. Try http://www.savefile.com
Title: Re: Avoid Lag? [not resolved]
Post by: qewlkid9 on February 05, 2007, 05:11:50 PM
Quote from: qewlkid9 on February 05, 2007, 02:49:36 PM
1.GHz, 1 gb of ram it says

my computer is new..im positive its not the computer.
well i didnt thinnk that the numbers after the 1 mattered...it says 1.99. ill upload it on that site thanks

edit: http://www.savefile.com/files/468547
Title: Re: Avoid Lag? [not resolved]
Post by: Blizzard on February 06, 2007, 01:29:01 PM
I checked it through and it works fine with me. But I noticed a lag that occurs every second and foudn the reason for it. It's the HUD. It gets refreshed every second which is a waste of CPU time. Add this code to the end of your ABS to remove that lagging:

class Window_Mapstats < Window_Base
 
  def refresh
    self.contents.clear
    actor = $game_party.actors[$ABS.active_actor]
    draw_actor_graphic(actor, 10, 45) # draws the actor graphic
    draw_actor_name(actor, 30, -5) #draws the actors name
    draw_actor_level(actor, 30, 15) #draws the actor level
    draw_actor_hp_text(actor, 110, -5) #draws the actors hp
    draw_actor_hp_bar(actor, 260, 5)  #draws the actors hp bar
    draw_actor_sp_text(actor,110, 15) #draws the actors sp
    draw_actor_sp_bar(actor, 260, 27) #draws the actors sp bar
    draw_dash_bar(375, 27) #draws the dash level bar
    @char_name = actor.character_name
    @name = actor.name
    @level = actor.level
    @hp = actor.hp
    @sp = actor.sp
    @dash = $ABS.dash_level
    self.contents.draw_text(377, -5, 120, 32, "Dash")
  end
 
  def update
    refresh if test_stats
  end
   
  def test_stats
    actor = $game_party.actors[$ABS.active_actor]
    return (@char_name != actor.character_name or @name != actor.name or
        @level != actor.level or @hp != actor.hp or @sp != actor.sp or
        @dash != $ABS.dash_level)
  end
 
end


You could also just replace the methods I rewrote with the actual ones you are using. Other than that, your best chance is an Anti-Lag. It didn't lag with me after I used this instead of the original one.
Title: Re: Avoid Lag? [not resolved]
Post by: qewlkid9 on February 06, 2007, 03:50:53 PM
Quote from: Dr_eadful on February 06, 2007, 01:29:01 PM
I checked it through and it works fine with me. But I noticed a lag that occurs every second and foudn the reason for it. It's the HUD. It gets refreshed every second which is a waste of CPU time. Add this code to the end of your ABS to remove that lagging:

class Window_Mapstats < Window_Base
 
  def refresh
    self.contents.clear
    actor = $game_party.actors[$ABS.active_actor]
    draw_actor_graphic(actor, 10, 45) # draws the actor graphic
    draw_actor_name(actor, 30, -5) #draws the actors name
    draw_actor_level(actor, 30, 15) #draws the actor level
    draw_actor_hp_text(actor, 110, -5) #draws the actors hp
    draw_actor_hp_bar(actor, 260, 5)  #draws the actors hp bar
    draw_actor_sp_text(actor,110, 15) #draws the actors sp
    draw_actor_sp_bar(actor, 260, 27) #draws the actors sp bar
    draw_dash_bar(375, 27) #draws the dash level bar
    @char_name = actor.character_name
    @name = actor.name
    @level = actor.level
    @hp = actor.hp
    @sp = actor.sp
    @dash = $ABS.dash_level
    self.contents.draw_text(377, -5, 120, 32, "Dash")
  end
 
  def update
    refresh if test_stats
  end
   
  def test_stats
    actor = $game_party.actors[$ABS.active_actor]
    return (@char_name != actor.character_name or @name != actor.name or
        @level != actor.level or @hp != actor.hp or @sp != actor.sp or
        @dash != $ABS.dash_level)
  end
 
end


You could also just replace the methods I rewrote with the actual ones you are using. Other than that, your best chance is an Anti-Lag. It didn't lag with me after I used this instead of the original one.
that worked! tyvm!