Game Performance
#14
Oh, then, I guess the problem is the number of events and also the script

Let's see how light event working

Code:
if $game_system.activate_light
       # Update the light of the event
       update_light_event
       # Update the light of the player
       update_light_player
     end
   else
     # Draw an empty night when the switch is on
     @light.bitmap.fill_rect(@light.bitmap.rect, Color.new(0,0,0,0))
   end
   # Increase the frame count for the animation
   @frame += 1
 
see the code above, the light system will refresh every frames to call "update_light_event"


now let see what in "update_light_event"



Code:
def update_light_event
   # Display the ligth when one or more light were created
   if $game_map.light_event != {}
     # Cycle through the light list
     $game_map.light_event.each { |i, light|


see, it call a loop to refresh every events that has "light_event" comment

let's imagine if you have 10 light-events in map, for each 1 frame, the system will load 10 events and refresh these events. The more light-events, the more refresh-works system must do each frame
To solve this "too-much-refresh" problem, I think you should increase the time to check update from "for each 1 frame" to "for each 4 frames" or more, or integrates a custom anti-lag code into this script by yourself.
Reply }


Messages In This Thread
Game Performance - by Mel - 11-03-2016, 12:10 PM
RE: Game Performance - by BeJeremiah - 11-04-2016, 01:24 AM
RE: Game Performance - by Mel - 11-05-2016, 12:41 AM
RE: Game Performance - by Mel - 11-17-2016, 01:17 AM
RE: Game Performance - by DerVVulfman - 11-17-2016, 04:16 AM
RE: Game Performance - by finalholylight - 11-17-2016, 05:33 AM
RE: Game Performance - by Mel - 11-17-2016, 01:12 PM
RE: Game Performance - by finalholylight - 11-17-2016, 03:50 PM
RE: Game Performance - by Mel - 11-17-2016, 05:25 PM
RE: Game Performance - by DerVVulfman - 11-17-2016, 08:46 PM
RE: Game Performance - by Mel - 11-17-2016, 10:32 PM
RE: Game Performance - by DerVVulfman - 11-20-2016, 04:56 PM
RE: Game Performance - by Mel - 11-21-2016, 09:22 PM
RE: Game Performance - by finalholylight - 11-22-2016, 04:44 AM
RE: Game Performance - by Mel - 11-22-2016, 05:11 PM
RE: Game Performance - by DerVVulfman - 11-22-2016, 09:17 PM
RE: Game Performance - by Mel - 11-22-2016, 10:42 PM
RE: Game Performance - by DerVVulfman - 11-23-2016, 04:41 AM
RE: Game Performance - by Mel - 11-23-2016, 04:50 PM
RE: Game Performance - by DerVVulfman - 11-23-2016, 06:18 PM
RE: Game Performance - by Mel - 11-23-2016, 06:41 PM
RE: Game Performance - by finalholylight - 11-24-2016, 03:42 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
   Game Variables List for Copy/Paste JayRay 4 7,000 01-15-2015, 06:18 AM
Last Post: JayRay
   [RMXP]Game Over and Atoa Battle Status mishaps firestalker 8 10,932 08-07-2014, 01:59 AM
Last Post: firestalker
  Changing Window Styles in Game JackMonty 8 11,008 03-22-2013, 11:54 PM
Last Post: JackMonty
   Game help n2t4a6 11 14,700 04-21-2010, 06:42 AM
Last Post: n2t4a6
   Animated story on New Game... KDawg08 3 6,407 03-31-2010, 03:52 AM
Last Post: KDawg08



Users browsing this thread: 4 Guest(s)