The PokéCommunity Forums  

Go Back   The PokéCommunity Forums > Creative Discussions > Game Development > Pokémon Essentials
Sign Up Rules/FAQ Live Battle Blogs Mark Forums Read

Notices

Pokémon Essentials All questions and discussion about Pokémon Essentials, the Pokémon game kit for RPG Maker XP, go in here. Also contains links to the latest downloads and the Essentials Wiki.


Advertise here

Reply
Click here to go to the first staff post in this thread.  
Thread Tools
  #1    
Old May 25th, 2013, 04:15 PM
Dylanrockin's Avatar
Dylanrockin
Mysterious Trainer
 
Join Date: May 2011
Gender: Male
Nature: Timid

Advertise here
I've been experiencing some lag in my game, mostly for the obvious very large maps with a lot of events, mainly Pokemon and Trainers just walking around and lighting effects. So I tried using Zeriabs Anti-Event Lag Script to try and remedy my every few frame lag problem. And I get an error upon using it.

The Script is here along with the link to his thread: http://forums.rpgmakerweb.com/index....nt-lag-system/

Spoiler:
#==============================================================================
# ** Anti Event Lag System
#------------------------------------------------------------------------------
# Zeriab
# Version 1.2b
# 2008-09-12 (Year-Month-Day)
#------------------------------------------------------------------------------
# * Requirements :
#
# If you have the SDK : Version 2.0+, Part I, II
# Does not require the SDK
#------------------------------------------------------------------------------
# * Version History :
#
# Version 0.8 -------------------------------------------------- (2007-09-03)
# - First release
#
# Version 0.81 ------------------------------------------------- (2007-09-05)
# - Overwrote Game_Map's passable? method for faster collision detection
#
# Version 0.9 -------------------------------------------------- (2007-09-12)
# - Support for the Non-SDK patch
# - Support for defining whether an event will always be updated or never
# be updated by defining name patterns.
#
# Version 1.0 -------------------------------------------------- (2007-09-24)
# - Fixed compatibility issue with Blizzard's Caterpillar script
# - Overwrote more methods scanning for events on a specific tile
# - Support for defining whether an event will always be updated or never
# be updated by specifying the event's id and map_id
# - Some structural changes.
# - Integrated the Non-SDK patch into the main script
#
# Version 1.05 ------------------------------------------------- (2007-11-18)
# - Fixed bug where sprites might not be disposed when changing scene.
#
# Version 1.1 -------------------------------------------------- (2008-04-10)
# - Added declaration to which common events to update
#
# Version 1.15 ------------------------------------------------- (2008-06-19)
# - Added automatic detection of which common events to update (optional)
#
# Version 1.2 -------------------------------------------------- (2008-07-04)
# - Fixed a case where an event could be registered twice causing transparent
# events to look less transparent.
#
# Version 1.2b ------------------------------------------------- (2008-09-12)
# - Fixed a stack error problem caused when pressing F12.
#------------------------------------------------------------------------------
# * Description :
#
# This script was designed to reduce lag by changing the data structure of
# the events in the Game_Map class and update the functionality accordingly
# A goal of this script is not to change the normal event behavior, so
# implementing it into a project should not effect previous events. It might
# effect custom scripts.
#------------------------------------------------------------------------------
# * License :
#
# Copyright (C) 2007, 2008 Zeriab
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser Public License for more details.
#
# For the full license see <http://www.gnu.org/licenses/>
# The GNU General Public License: http://www.gnu.org/licenses/gpl.txt
# The GNU Lesser General Public License: http://www.gnu.org/licenses/lgpl.txt
#------------------------------------------------------------------------------
# * Compatibility :
#
# This is SDK compliant. It is written for SDK version 2.3.
# It requires SDK 2.0+ if you are using the SDK
# The Non-SDK patch is integrated so you can run it without the SDK
#
# The following methods has been overwritten:
# * Game_Character.passable?
# * Game_Map.passable?
# * Game_Map.update_events
# * Game_Player.check_event_trigger_here
# * Game_Player.check_event_trigger_there
# * Game_Player.check_event_trigger_touch
# * Spriteset_Map.init_characters
# * Spriteset_Map.update_character_sprites
#
# The following methods have been aliased
# * Game_Event.jump
# * Game_Event.moveto
# * Game_Event.move_down
# * Game_Event.move_left
# * Game_Event.move_right
# * Game_Event.move_up
# * Game_Event.move_lower_left
# * Game_Event.move_lower_right
# * Game_Event.move_upper_left
# * Game_Event.move_upper_right
# * Game_Map.setup
#------------------------------------------------------------------------------
# * Instructions :
#
# Place this script just below the SDK if you are using the SDK.
# Place this script just below the default if using the Non-SDK Patch
#
# default scripts
# (SDK)
# Zeriab's Anti Event Lag System
# (custom scripts)
# main
#
# ~ Game_Map ~
# There are 4 constants you can change at will in the top of the
# Game_Map class: (You don't have to )
#
# ALWAYS_UPDATE ~ The default is false
# -------------------------------
# You can set this to true if you want all events to be update always
# This a slower option, but events behave like they do without the script.
# You will still benifit from the faster collision detection and fewer sprites
# This has higher priority than the event specific features. I.e never_update
#
# BUFFER_SIZE ~ The default is 2
# -------------------------
# You can increase or decrease the buffer size by altering this value.
# The greater this value the greater area around the visible area is updated
# at the price of potential more lag.
# The lower this value the smaller area around the visible area is update
# with the potential of less lag.
# Too low a value may get the sprites to sort of 'freeze' in the outskirts
# of the screen.
# Bigger sprites requires bigger buffer to prevent this.
#
# TILES_VERTICAL ~ The default is 15
# -----------------------------
# Specifies how many tiles there are vertical
# I included the option to change this value if you want to alter
# the size of the game window.
# If you for example want 800x600 I suggest changing this value to 20
#
# TILES_HORIZONTAL ~ The default is 20
# -------------------------------
# Specifies how many tiles there are horizontal
# I included the option to change this value if you want to alter
# the size of the game window.
# If you for example want 800x600 I suggest changing this value to 27
#
# LIMIT_COMMON_EVENTS - The default is true
# -----------------------------
# You can see this to false if you want all common events updated.
# This constant only has an effect during the upstart of the program. Changing
# it during the game will have no effect.
# If it is set to false you can safely ignore the following three constants
#
# SPECIFY_COMMON_EVENTS_MANUALLY - The default is false
# -----------------------------
# Specifies whether you want to enter which common events should be updated
# manually. If this is set to false you can safely ignore
# COMMON_EVENTS_TO_UPDATE while COMMON_EVENT_FILEPATH is of importance.
# Vice-versa is COMMON_EVENTS_TO_UPDATE important and COMMON_EVENT_FILEPATH
# safe to ignore if SPECIFY_COMMON_EVENTS_MANUALLY is set to true.
# If this is set to false which common events to update will be atomatically
# detected.
# As a general rule of thumb: Only change this to true if you have problems
# with the automatic detection or you want to prevent certain common events
# with autorun or parallel process as trigger.
#
# COMMON_EVENTS_TO_UPDATE
# -----------------------------
# This constant is an array of common event ids. Only the common events with
# the ids specified in the array will be updated. The ids are the numbers
# shown in the database with any leading 0s removed. In general only common
# events which have autorun or parallel process needs to be updated.
# It will have no effect if SPECIFY_COMMON_EVENTS_MANUALLY is false
# Let's say we want the common events 005, 009 and 020 to be updated. First we
# will remove the leading 0s and get 5, 9 and 20. Next we will put them in the
# array and get as end result:
#
# COMMON_EVENTS_TO_UPDATE = [5, 9, 20]
#
# If we had put [005, 009, 020] as the array we would have gotten an error
# when starting the game.
# If we now want to update common event 045 we would add 45 to the array:
#
# COMMON_EVENTS_TO_UPDATE = [5, 9, 20, 45]
#
#
# COMMON_EVENT_FILEPATH - The default is 'Data/CommonEvents.rxdata'
# -----------------------------
# Specifies the relative file path (To the directory of where the Game.exe is)
# to where the common events are stored.
# Only change this if you have changed the name or place of the
# CommonEvents.rxdata file.
# It will have no effect if SPECIFY_COMMON_EVENTS_MANUALLY is true
#
#
# ~ Game_Event ~
# Next we come to the Constants in Game_Event. They are given above the
# Game_Map code. They have been split from the other Game_Event code for
# Easier access:
#
# SPECIAL_UPDATE_IDS
# ------------------
# This constant contains a hash where you can specify how specific events
# should be updated. Special update ids has priority over name patterns.
# The keys are all a 2-elements array. [Map_ID, Event_ID]
# The value is either an 'A' for always update or 'N' for never update.
# Here is an example:
#
# SPECIAL_UPDATE_IDS = {[1,1]=>'A',
# [1,2]=>'N'}
#
# Notice the first line [1,1]=>'A'
# It means that the event with id 1 on map 1 will always be updated.
#
# Notice the first line [1,2]=>'N'
# It means that the event with id 2 on map 1 will never be updated.
# Let's say we wanted the event with id 5 on map 3 to always be updated.
# This can be achieved by adding [5,3]=>'A' to the hash:
#
# SPECIAL_UPDATE_IDS = {[1,1]=>'A',
# [1,2]=>'N',
# [5,3]=>'A'}
#
#
# NEVER_UPDATE_NAME_PATTERNS
# --------------------------
# Here you can specify any number of patterns which will be checked when a
# new map is loaded. Any events which matches at least one of the patterns
# given here will never be updated.
# A pattern is assumed to be either a String or a RegExp. In the case of a
# String name.include?(string) is used. Otherwise the =~ operator is used
# Note: The never_update feature has higher priority than the always_update.
# If an event's name matches both a always update pattern and a never_update
# pattern it will never update.
#
# ALWAYS_UPDATE_NAME_PATTERNS
# ---------------------------
# Here you can specify any number of patterns which will be checked when a
# new map is loaded. Any events which matches at least one of the patterns
# given here will always be updated.
# Note: The always_update feature has lower priority than the never_update.
# If an event's name matches both a always update pattern and a never_update
# pattern it will never update.
#==============================================================================

if Module.constants.include?('SDK')
#----------------------------------------------------------------------------
# * SDK Log Script
#----------------------------------------------------------------------------
SDK.log('Anti Event Lag System', 'Zeriab', 1.2, '2008-06-25')
SDK.check_requirements(2.0)
end

#------------------------------------------------------------------------------
# * Begin SDK Enable Test
#------------------------------------------------------------------------------
if !Module.constants.include?('SDK') || SDK.enabled?('Anti Event Lag System')

#==============================================================================
# ** Constants for the anti lag script
#==============================================================================

class Game_Map
ALWAYS_UPDATE = false
BUFFER_SIZE = 2
TILES_VERTICAL = 15
TILES_HORIZONTAL = 20
LIMIT_COMMON_EVENTS = true
SPECIFY_COMMON_EVENTS_MANUALLY = false
# If you want to specify which common events to update
COMMON_EVENTS_TO_UPDATE = []
# If you want the script to automatically read the common events and find
# out which to update. Must be the path to the CommonEvents.rxdata
COMMON_EVENT_FILEPATH = 'Data/CommonEvents.rxdata'
end

class Game_Event
SPECIAL_UPDATE_IDS = {}
NEVER_UPDATE_NAME_PATTERNS = ['[N]'] # [N] in the event name => not updated
ALWAYS_UPDATE_NAME_PATTERNS = ['[A]'] # [A] in the event name => always updated
end

#==============================================================================
# ** Automatic configuration generation
#==============================================================================
class Game_Map
if LIMIT_COMMON_EVENTS && !SPECIFY_COMMON_EVENTS_MANUALLY
# Find the common events which needs to be updated
COMMON_EVENTS_TO_UPDATE = []
# Load the common events
common_events = load_data(COMMON_EVENT_FILEPATH)
# Go through the common events
for common_event in common_events.compact
# Check if there is a need for the common event to update
if common_event.trigger > 0
# C
COMMON_EVENTS_TO_UPDATE << common_event.id
end
end
end
end

#==============================================================================
# ** Game_Map
#==============================================================================

class Game_Map
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_reader :event_map
#--------------------------------------------------------------------------
# * Alias Listings
#--------------------------------------------------------------------------
alias_method :zeriab_antilag_gmmap_setup, :setup
#--------------------------------------------------------------------------
# * Setup
#--------------------------------------------------------------------------
def setup(*args)
# Makes an event map as a hash
@event_map = {}
# Original Setup
zeriab_antilag_gmmap_setup(*args)
# Go through each event
for event in @events.values
# Check how the event should be updated
event.check_update
end
end

#--------------------------------------------------------------------------
# * Update Events ~ Overwritten to only updating visible and special events
#--------------------------------------------------------------------------
def update_events
# Runs through the events
for event in @events.values
# checks if the event is visible or needs to be updated
if ALWAYS_UPDATE || event.need_update?
event.update
end
end
end

# Only overwrite this method if common events should be limited
if LIMIT_COMMON_EVENTS
#--------------------------------------------------------------------------
# * Update Common Events ~ Updates only the necessary common events
#--------------------------------------------------------------------------
def update_common_events
for i in COMMON_EVENTS_TO_UPDATE
@common_events[i].update
end
end
end

#--------------------------------------------------------------------------
# * Called when an event has been moved with it's old x and y coordinate
# Used to update its position in the event_map
#--------------------------------------------------------------------------
def move_event(old_x,old_y,event)
# Checks if the event has moved to a new position.
return if old_x == event.x && old_y == event.y
# Removes the event from its old position
remove_event(old_x, old_y, event)
# Adds the event to its new position
add_event(event.x,event.y,event)
# Gets the spriteset from Scene_Map
spriteset = $scene.instance_eval('@spriteset')
# Checks that it actually is a Spriteset_Map.
if spriteset.is_a?(Spriteset_Map) && spriteset.respond_to?(:update_event)
# Tells the spriteset to update the event to its new position
spriteset.update_event(old_x,old_y,event)
end
end

#--------------------------------------------------------------------------
# * Adds an event to the event_map at the given x and y coordinate
#--------------------------------------------------------------------------
def add_event(x,y,event)
# Checks if there are not any events on the specific tile
if @event_map[[x,y]].nil?
# Sets the position on the map to be an array containing the given
# event. (In case there are placed additional events on this tile)
@event_map[[x,y]] = [event]
else
# Adds the event to the array of events on the specific tile
@event_map[[x,y]] << event
end
end

#--------------------------------------------------------------------------
# * Removes an event from the event_map with the given x and y coordinate
#--------------------------------------------------------------------------
def remove_event(x,y,event)
# Checks if there actually are an event on the given coordinates
return if @event_map[[x,y]].nil?
# Checks whether or not there are more events than the given event on
# with the given coordinates
if @event_map[[x,y]].size > 1
# Deletes the events from the array of events
@event_map[[x,y]].delete(event)
else
# Deletes the key along with the corresponding value from the hashmap
# since there are no other events on the tile.
@event_map.delete([x,y])
end
end

#--------------------------------------------------------------------------
# * Gets min_x, max_x, min_y and max_y including the buffer-size
# Returns min_x, max_x, min_y, max_y (tile-coordinates)
# Returns a Rect if 'true' is given as the argument
#--------------------------------------------------------------------------
def get_tile_area(rect = false)
# Gets the upper left x and y tile-coordinate
x = $game_map.display_x / 128
y = $game_map.display_y / 128
# Computes the min and max coordinates when considering the buffer-size
min_x = x - BUFFER_SIZE
min_y = y - BUFFER_SIZE
max_x = x + TILES_HORIZONTAL + BUFFER_SIZE
max_y = y + TILES_VERTICAL + BUFFER_SIZE
# Makes sure the min and max coordinates are within the map
if min_x < 0
min_x = 0
end
if max_x >= $game_map.width
max_x = $game_map.width - 1
end
if min_y < 0
min_y = 0
end
if max_y >= $game_map.height
max_y = $game_map.height - 1
end
# Checks if the return should be a Rect
if rect
# Returns the result as a Rect
return Rect.new(min_x, min_y, max_x - min_x, max_y - min_y)
else
# Returns the result as the min and max coordinates
return min_x, max_x, min_y, max_y
end
end

#--------------------------------------------------------------------------
# * Checks if the tile with the given x and y coordinate is visible.
# Takes the buffer size into account.
#--------------------------------------------------------------------------
def visible?(x,y)
min_x = $game_map.display_x / 128
min_y = $game_map.display_y / 128
if x >= min_x - BUFFER_SIZE && x <= min_x + BUFFER_SIZE + TILES_HORIZONTAL &&
y >= min_y - BUFFER_SIZE && y <= min_y + BUFFER_SIZE + TILES_VERTICAL
return true
end
return false
end

#--------------------------------------------------------------------------
# * Get Designated Position Event ID
# x : x-coordinate
# y : y-coordinate
#--------------------------------------------------------------------------
def check_event(x, y)
# Retrives the events on the specified tile
events = event_map[[x,y]]
unless events.nil?
# Loop through events on tile
for event in events
if event.x == x and event.y == y
return event.id
end
end
end
end

#--------------------------------------------------------------------------
# * Determine if Passable
# x : x-coordinate
# y : y-coordinate
# d : direction (0,2,4,6,8,10)
# * 0,10 = determine if all directions are impassable
# self_event : Self (If event is determined passable)
#--------------------------------------------------------------------------
def passable?(x, y, d, self_event = nil)
# If coordinates given are outside of the map
unless valid?(x, y)
# impassable
return false
end
# Change direction (0,2,4,6,8,10) to obstacle bit (0,1,2,4,8,0)
bit = (1 << (d / 2 - 1)) & 0x0f
# Retrives the events on the specified tile
events = event_map[[x,y]]
unless events.nil?
# Loop through events on tile
for event in events
# If tiles other than self are consistent with coordinates
if event.tile_id >= 0 and event != self_event and not event.through
# If obstacle bit is set
if @passages[event.tile_id] & bit != 0
# impassable
return false
# If obstacle bit is set in all directions
elsif @passages[event.tile_id] & 0x0f == 0x0f
# impassable
return false
# If priorities other than that are 0
elsif @priorities[event.tile_id] == 0
# passable
return true
end
end
end
end
# Loop searches in order from top of layer
for i in [2, 1, 0]
# Get tile ID
tile_id = data[x, y, i]
# Tile ID acquistion failure
if tile_id == nil
# impassable
return false
# If obstacle bit is set
elsif @passages[tile_id] & bit != 0
# impassable
return false
# If obstacle bit is set in all directions
elsif @passages[tile_id] & 0x0f == 0x0f
# impassable
return false
# If priorities other than that are 0
elsif @priorities[tile_id] == 0
# passable
return true
end
end
# passable
return true
end
end


#==============================================================================
# ** Game_Character
#==============================================================================

class Game_Character
#--------------------------------------------------------------------------
# * Determine if Passable (Overwrite)
# x : x-coordinate
# y : y-coordinate
# d : direction (0,2,4,6,8)
# * 0 = Determines if all directions are impassable (for jumping)
#--------------------------------------------------------------------------
def passable?(x, y, d)
# Get new coordinates
new_x = x + (d == 6 ? 1 : d == 4 ? -1 : 0)
new_y = y + (d == 2 ? 1 : d == 8 ? -1 : 0)
# If coordinates are outside of map
unless $game_map.valid?(new_x, new_y)
# impassable
return false
end
# If through is ON
if @through
# passable
return true
end
# If unable to leave first move tile in designated direction
unless $game_map.passable?(x, y, d, self)
# impassable
return false
end
# If unable to enter move tile in designated direction
unless $game_map.passable?(new_x, new_y, 10 - d)
# impassable
return false
end
# If player coordinates are consistent with move destination
if $game_player.x == new_x and $game_player.y == new_y
# If through is OFF
unless $game_player.through
# If your own graphic is the character
if @character_name != ""
# impassable
return false
end
end
end
# Checks for events on the new position
events = $game_map.event_map[[new_x,new_y]]
if events.nil?
# passable
return true
end
# Loop all events on the tile
for event in events
# If event coordinates are consistent with move destination
if event.x == new_x and event.y == new_y
# If through is OFF
unless event.through
# If self is event
if self != $game_player
# impassable
return false
end
# With self as the player and partner graphic as character
if event.character_name != ""
# impassable
return false
end
end
end
end
# passable
return true
end
end

#==============================================================================
# ** Game_Event
#==============================================================================

class Game_Event
# The method to alias and overwrite
AX = [:jump, :moveto, :move_down, :move_left, :move_right, :move_up,
:move_lower_left, :move_lower_right, :move_upper_left, :move_upper_right]
for method in AX
# Aliases the old method
new_method_as_string = 'zeriab_antilag_gmtev_' + method.to_s
new_method = new_method_as_string.to_sym
next if self.method_defined?(new_method)
alias_method(new_method, method)

# Overwrites the old method
PROG = <<FIN
def #{method}(*args)
old_x = @x
old_y = @y
#{new_method}(*args)
unless old_x == @x && old_y == @y
$game_map.move_event(old_x, old_y, self)
end
end
FIN
# Evaluates the method definition
eval(PROG)
end

#--------------------------------------------------------------------------
# * Always_update property (is false by default) priority under never_update
#--------------------------------------------------------------------------
attr_writer :always_update
def always_update
@always_update = false if @always_update.nil?
return @always_update
end

#--------------------------------------------------------------------------
# * Never_update property (is false by default) priority over always_update
#--------------------------------------------------------------------------
attr_writer :never_update
def never_update
@never_update = false if @never_update.nil?
return @never_update
end

#--------------------------------------------------------------------------
# * Need Update method. Fast checks here.
#--------------------------------------------------------------------------
def need_update?
return false if never_update
return true if always_update
return true if $game_map.visible?(x, y)
return true if @move_type == 3
return @trigger == 3 || @trigger == 4
end

#--------------------------------------------------------------------------
# * Checks how the event should be updated.
#--------------------------------------------------------------------------
def check_update
name = @event.name
# Checks if the event is never to be updated. (For decoration)
for pattern in NEVER_UPDATE_NAME_PATTERNS
if (pattern.is_a?(String) && name.include?(pattern)) ||
!(pattern =~ name).nil?
self.never_update = true
end
end
# Checks if the event is to be always updated.
for pattern in ALWAYS_UPDATE_NAME_PATTERNS
if (pattern.is_a?(String) && name.include?(pattern)) ||
!(pattern =~ name).nil?
self.always_update = true
end
end
# Checks for special update for the particular id (overrules the patterns)
special_update = SPECIAL_UPDATE_IDS[[@map_id,@id]]
unless special_update.nil?
# Checks if it never should be updated
if special_update.downcase == 'n'
self.never_update = true
self.always_update = false
# Checks if it always should be updated
elsif special_update.downcase == 'a'
self.always_update = true
self.never_update = false
end
end
end
end

#==============================================================================
# ** Game_Event
#==============================================================================

class Game_Player
#--------------------------------------------------------------------------
# * Same Position Starting Determinant
#--------------------------------------------------------------------------
def check_event_trigger_here(triggers)
result = false
# If event is running
if $game_system.map_interpreter.running?
return result
end
# Retrives the events on the specified tile
events = $game_map.event_map[[@x,@y]]
unless events.nil?
# Loop through events on tile
for event in events
# If event triggers are consistent
if triggers.include?(event.trigger)
# If starting determinant is same position event (other than jumping)
if not event.jumping? and event.over_trigger?
event.start
result = true
end
end
end
end
return result
end
#--------------------------------------------------------------------------
# * Front Event Starting Determinant
#--------------------------------------------------------------------------
def check_event_trigger_there(triggers)
result = false
# If event is running
if $game_system.map_interpreter.running?
return result
end
# Calculate front event coordinates
new_x = @x + (@direction == 6 ? 1 : @direction == 4 ? -1 : 0)
new_y = @y + (@direction == 2 ? 1 : @direction == 8 ? -1 : 0)
# Retrives the events on the specified tile
events = $game_map.event_map[[new_x,new_y]]
unless events.nil?
# Loop through events on tile
for event in events
# If event triggers are consistent
if triggers.include?(event.trigger)
# If starting determinant is front event (other than jumping)
if not event.jumping? and not event.over_trigger?
event.start
result = true
end
end
end
end
# If fitting event is not found
if result == false
# If front tile is a counter
if $game_map.counter?(new_x, new_y)
# Calculate 1 tile inside coordinates
new_x += (@direction == 6 ? 1 : @direction == 4 ? -1 : 0)
new_y += (@direction == 2 ? 1 : @direction == 8 ? -1 : 0)
# Retrives the events on the specified tile
events = $game_map.event_map[[new_x,new_y]]
unless events.nil?
# Loop through events on tile
for event in events
# If event triggers are consistent
if triggers.include?(event.trigger)
# If starting determinant is front event (other than jumping)
if not event.jumping? and not event.over_trigger?
event.start
result = true
end
end
end
end
end
end
return result
end
#--------------------------------------------------------------------------
# * Touch Event Starting Determinant
#--------------------------------------------------------------------------
def check_event_trigger_touch(x, y)
result = false
# If event is running
if $game_system.map_interpreter.running?
return result
end
# Retrives the events on the specified tile
events = $game_map.event_map[[x,y]]
unless events.nil?
# Loop through events on tile
for event in events
# If event coordinates and triggers are consistent
if [1,2].include?(event.trigger)
# If starting determinant is front event (other than jumping)
if not event.jumping? and not event.over_trigger?
event.start
result = true
end
end
end
end
return result
end
end

#==============================================================================
# ** Spriteset_Map
#------------------------------------------------------------------------------
# Overwrites init_characters and update_character_sprites
#==============================================================================

class Spriteset_Map
#--------------------------------------------------------------------------
# * Initializes Character Sprites (Overwrite)
#--------------------------------------------------------------------------
def init_characters
# Creates the array used for holding the hero sprite.
# Is here for compatibility reasons.
@character_sprites = []
# Refreshes the characters in the spritemap
refresh_characters
# Refreshes the character sprites
refresh_character_sprites
end

#--------------------------------------------------------------------------
# * Refreshes the characters.
#--------------------------------------------------------------------------
def refresh_characters
# Make character sprites
@character_event_sprites = []
@character_spritemap = {}
# Gets the tile area to search for events
min_x, max_x, min_y, max_y = $game_map.get_tile_area
# Goes through all the visible tiles and adds the sprites on those tiles
for x in min_x..max_x
for y in min_y..max_y
add_sprites(x,y)
end
end
end

#--------------------------------------------------------------------------
# * Refreshes the character sprites.
#--------------------------------------------------------------------------
def refresh_character_sprites
# Gets the character sprites
@character_event_sprites = @character_spritemap.values.flatten
#### Note: I do not think character sprites have to be sorted, but here it
#### is if you for some reason need them sorted.
#@character_event_sprites.sort! {|a,b| a.character.id <=> b.character.id}
# Updates the last screen x and y to the current x and y
@last_screen_x = $game_map.display_x / 128
@last_screen_y = $game_map.display_y / 128
# The sprites have just been refresh, no need to do this every frame.
@need_refresh = false
end

#--------------------------------------------------------------------------
# * Updates Character Sprites
#--------------------------------------------------------------------------
def update_character_sprites
# Checks if the player has moved
unless @last_screen_x == $game_map.display_x / 128 &&
@last_screen_y == $game_map.display_y / 128
# Gets the difference in the x and y coordinate
diff_x = @last_screen_x - $game_map.display_x / 128
diff_y = @last_screen_y - $game_map.display_y / 128
# Checks if the player has moved more than one tile. (Supports 8-way)
if diff_x.abs > 1 || diff_y.abs > 1
# The player has moved more than one tile.
# This section could be extended if some of the previous visible area
# still is visible and only update the the the new areas as well as
# the parts of the old area that is now out of side.
# For ease and because this should be a rare situation I have decided
# to simple remove all sprites and start over for the new area.
@character_event_sprites.each {|sprite| sprite.dispose}
# Initialized the sprites for the new area
init_characters
else
# Updates the buffer
update_buffer(diff_x, diff_y)
end
# Refresh the character sprites. (To which should be updated)
refresh_character_sprites
else
# Refreshed the character sprites if it is needed
refresh_character_sprites if @need_refresh
end
# Updates the sprites.
@character_event_sprites.each {|sprite| sprite.update}
# Updates the hero sprite. Is here to increase compatibility with other
# scripts using this array. Most caterpillar scripts for example
@character_sprites.each {|sprite| sprite.update}
end

#--------------------------------------------------------------------------
# * Updates Character Sprites
#--------------------------------------------------------------------------
def update_buffer(diff_x, diff_y)
# Gets the tile area to search for events
min_x, max_x, min_y, max_y = $game_map.get_tile_area
# For change in x-coordinate
if diff_x > 0 # Left
# Removes any sprites outside of the buffer
unless max_x >= $game_map.width - 1
for y in min_y..max_y
dispose_sprites(max_x+1, y)
end
end
# Adds any new sprites comming into the buffer
for y in min_y..max_y
add_sprites(min_x, y) if @character_spritemap[[min_x,y]].nil?
end
elsif diff_x < 0 # Right
# Removes any sprites outside of the buffer
unless min_x <= 0
for y in min_y..max_y
dispose_sprites(min_x-1, y)
end
end
# Adds any new sprites comming into the buffer
for y in min_y..max_y
add_sprites(max_x, y) if @character_spritemap[[max_x,y]].nil?
end
end
# For change in y-coordinates
if diff_y > 0 # Up
# Removes any sprites outside of the buffer
unless max_y >= $game_map.height - 1
for x in min_x..max_x
dispose_sprites(x, max_y+1)
end
end
# Adds any new sprites comming into the buffer
for x in min_x..max_x
add_sprites(x, min_y) if @character_spritemap[[x,min_y]].nil?
end
elsif diff_y < 0 # Down
# Removes any sprites outside of the buffer
unless min_y <= 0
for x in min_x..max_x
dispose_sprites(x, min_y-1)
end
end
# Adds any new sprites comming into the buffer
for x in min_x..max_x
add_sprites(x, max_y) if @character_spritemap[[x,max_y]].nil?
end
end
end

#--------------------------------------------------------------------------
# * Called when an event has moved
#--------------------------------------------------------------------------
def update_event(old_x,old_y,event)
# Finds the sprites on the event's old position
sprites = @character_spritemap[[old_x,old_y]]
# Checks if there are any sprites on the event's old position
unless sprites.nil?
# Goes through the sprites to find which one is attached to the given
# event. Sprite is nil if no sprite on the event's old position is
# attached to the given event.
sprite = nil
for sprite in sprites
break if sprite.character == event
end
end
# If there is not a sprite attached to the event
if sprite.nil?
# Checks if the event has become visible
if $game_map.visible?(event.x, event.y)
# A sprite is create because the event is now visible
sprite = Sprite_Character.new(@viewport1, event)
# The sprite is added at the event's current position
add_sprite(event.x,event.y,sprite)
# We need to refresh the character sprites since we added one.
@need_refresh = true
end
else # A sprite is attached to the event
# Checks if the event is still visible
if $game_map.visible?(event.x, event.y)
# The event is still visible and moved from its old coordinate
# to its new coordinates.
move_event(old_x, old_y, sprite)
else
# The sprite is not visible anymore and thus removed
remove_sprite(old_x,old_y,sprite)
# The sprite is disposed since we don't want to wait for Ruby's
# garbage cleaner to remove the sprite from view. (For big sprites)
sprite.dispose
# We need to refresh the character sprites since we removed one.
@need_refresh = true
end
end
end

##
## Macros
##

#--------------------------------------------------------------------------
# * Creates and adds sprites for all the events with the given x and y
# coordinates to the spritemap.
#--------------------------------------------------------------------------
def add_sprites(x,y)
# Returns if there are no events with the given x and y coordinates
return if $game_map.event_map[[x,y]].nil?
for event in $game_map.event_map[[x,y]]
# Creates a sprite for the event
sprite = Sprite_Character.new(@viewport1, event)
# Adds the sprite to the spritemap
add_sprite(x,y,sprite)
end
end

#--------------------------------------------------------------------------
# * Disposes all the sprites on given x,y tile
#--------------------------------------------------------------------------
def dispose_sprites(x,y)
# Returns if there are no sprites with the given coordinates
return if @character_spritemap[[x,y]].nil?
for sprite in @character_spritemap[[x,y]]
# Removes the sprite from the datastructure
remove_sprite(x,y,sprite)
# Disposes the sprite
sprite.dispose unless sprite.dispose
end
end

#--------------------------------------------------------------------------
# * Moves the sprite from its old coordinates to its new coordinates
#--------------------------------------------------------------------------
def move_event(old_x,old_y,sprite)
# Gets the event attached to the character
event = sprite.character
# Returns if the sprite have not change position
return if old_x == event.x && old_y == event.y
# Removes the sprite from its old location
remove_sprite(old_x, old_y, sprite)
# Adds the sprite to the new location
add_sprite(event.x, event.y, sprite)
end

##
## Low level methods, alters the datastructure directly
##

#--------------------------------------------------------------------------
# * Adds the given sprite to the given x and y coordinate to
# @character_spritemap.
#--------------------------------------------------------------------------
def add_sprite(x,y,sprite)
# Checks if there a not any sprite on the given tile already
if @character_spritemap[[x,y]].nil?
# Adds the sprite to the spriteset as an array containing the sprite
@character_spritemap[[x,y]] = [sprite]
else
# Adds the sprite to the array of sprites with the same x and y
# coordinates.
@character_spritemap[[x,y]] << sprite
end
end

#--------------------------------------------------------------------------
# * Removes the given sprite with the given x and y coordinate from
# @character_spritemap.
#--------------------------------------------------------------------------
def remove_sprite(x,y,sprite)
# Returns if there are no sprites with the given x and y coordinate
return unless !@character_spritemap[[x,y]].nil? &&
@character_spritemap[[x,y]].include?(sprite)
# Checks if there are more sprites with the same coordinates
if @character_spritemap[[x,y]].size > 1
# Removes the sprite from the array of sprites with the given coordinates
@character_spritemap[[x,y]].delete(sprite)
else
# Deletes the key attached to the array since there are no sprites left.
@character_spritemap.delete([x,y])
end
end
end

#------------------------------------------------------------------------------
# * End SDK Enable Test
#------------------------------------------------------------------------------
end

unless Module.constants.include?('SDK')
#============================================================================
# * Compatibility :
#
# This will probably not be compatible with scripts extending or modifying
# the overwritten methods.
#
# The following methods has been overwritten:
# * Game_Map.update
# * Spriteset_Map.initialize
# * Spriteset_Map.update
#============================================================================

#============================================================================
# ** Game_Map
#============================================================================
class Game_Map
#--------------------------------------------------------------------------
# * Update Common Events
#--------------------------------------------------------------------------
def update_common_events
for common_event in @common_events.values
common_event.update
end
end
#------------------------------------------------------------------------
# * Frame Update Overwrite
#------------------------------------------------------------------------
def update
# Refresh map if necessary
if $game_map.need_refresh
refresh
end
# If scrolling
if @scroll_rest > 0
# Change from scroll speed to distance in map coordinates
distance = 2 ** @scroll_speed
# Execute scrolling
case @scroll_direction
when 2 # Down
scroll_down(distance)
when 4 # Left
scroll_left(distance)
when 6 # Right
scroll_right(distance)
when 8 # Up
scroll_up(distance)
end
# Subtract distance scrolled
@scroll_rest -= distance
end
# Update map event
update_events
# Update common event
update_common_events
# Manage fog scrolling
@fog_ox -= @fog_sx / 8.0
@fog_oy -= @fog_sy / 8.0
# Manage change in fog color tone
if @fog_tone_duration >= 1
d = @fog_tone_duration
target = @fog_tone_target
@fog_tone.red = (@fog_tone.red * (d - 1) + target.red) / d
@fog_tone.green = (@fog_tone.green * (d - 1) + target.green) / d
@fog_tone.blue = (@fog_tone.blue * (d - 1) + target.blue) / d
@fog_tone.gray = (@fog_tone.gray * (d - 1) + target.gray) / d
@fog_tone_duration -= 1
end
# Manage change in fog opacity level
if @fog_opacity_duration >= 1
d = @fog_opacity_duration
@fog_opacity = (@fog_opacity * (d - 1) + @fog_opacity_target) / d
@fog_opacity_duration -= 1
end
end
end

#============================================================================
# ** Spriteset_Map
#============================================================================
class Spriteset_Map
#------------------------------------------------------------------------
# * Object Initialization Overwrite
#------------------------------------------------------------------------
def initialize
# Make viewports
@viewport1 = Viewport.new(0, 0, 640, 480)
@viewport2 = Viewport.new(0, 0, 640, 480)
@viewport3 = Viewport.new(0, 0, 640, 480)
@viewport2.z = 200
@viewport3.z = 5000
# Make tilemap
@tilemap = Tilemap.new(@viewport1)
@tilemap.tileset = RPG::Cache.tileset($game_map.tileset_name)
for i in 0..6
autotile_name = $game_map.autotile_names[i]
@tilemap.autotiles[i] = RPG::Cache.autotile(autotile_name)
end
@tilemap.map_data = $game_map.data
@tilemap.priorities = $game_map.priorities
# Make panorama plane
@panorama = Plane.new(@viewport1)
@panorama.z = -1000
# Make fog plane
@fog = Plane.new(@viewport1)
@fog.z = 3000
# Make character sprites
init_characters
# Make hero sprite
@character_sprites.push(Sprite_Character.new(@viewport1, $game_player))
# Make weather
@weather = RPG::Weather.new(@viewport1)
# Make picture sprites
@picture_sprites = []
for i in 1..50
@picture_sprites.push(Sprite_Picture.new(@viewport2,
$game_screen.pictures[i]))
end
# Make timer sprite
@timer_sprite = Sprite_Timer.new
# Frame update
update
end
#--------------------------------------------------------------------------
# * Dispose
#--------------------------------------------------------------------------
def dispose
# Dispose of tilemap
@tilemap.tileset.dispose
for i in 0..6
@tilemap.autotiles[i].dispose
end
@tilemap.dispose
# Dispose of panorama plane
@panorama.dispose
# Dispose of fog plane
@fog.dispose
# Dispose of weather
@weather.dispose
# Dispose of picture sprites
for sprite in @picture_sprites
sprite.dispose
end
# Dispose of character sprites
for sprite in @character_event_sprites
sprite.dispose unless sprite.disposed?
end
# Dispose of timer sprite
@timer_sprite.dispose
# Dispose of viewports
@viewport1.dispose
@viewport2.dispose
@viewport3.dispose
end
#------------------------------------------------------------------------
# * Frame Update Overwrite
#------------------------------------------------------------------------
def update
# If panorama is different from current one
if @panorama_name != $game_map.panorama_name or
@panorama_hue != $game_map.panorama_hue
@panorama_name = $game_map.panorama_name
@panorama_hue = $game_map.panorama_hue
if @panorama.bitmap != nil
@panorama.bitmap.dispose
@panorama.bitmap = nil
end
if @panorama_name != ""
@panorama.bitmap = RPG::Cache.panorama(@panorama_name, @panorama_hue)
end
Graphics.frame_reset
end
# If fog is different than current fog
if @fog_name != $game_map.fog_name or @fog_hue != $game_map.fog_hue
@fog_name = $game_map.fog_name
@fog_hue = $game_map.fog_hue
if @fog.bitmap != nil
@fog.bitmap.dispose
@fog.bitmap = nil
end
if @fog_name != ""
@fog.bitmap = RPG::Cache.fog(@fog_name, @fog_hue)
end
Graphics.frame_reset
end
# Update tilemap
@tilemap.ox = $game_map.display_x / 4
@tilemap.oy = $game_map.display_y / 4
@tilemap.update
# Update panorama plane
@panorama.ox = $game_map.display_x / 8
@panorama.oy = $game_map.display_y / 8
# Update fog plane
@fog.zoom_x = $game_map.fog_zoom / 100.0
@fog.zoom_y = $game_map.fog_zoom / 100.0
@fog.opacity = $game_map.fog_opacity
@fog.blend_type = $game_map.fog_blend_type
@fog.ox = $game_map.display_x / 4 + $game_map.fog_ox
@fog.oy = $game_map.display_y / 4 + $game_map.fog_oy
@fog.tone = $game_map.fog_tone
# Update character sprites
update_character_sprites
# Update weather graphic
@weather.type = $game_screen.weather_type
@weather.max = $game_screen.weather_max
@weather.ox = $game_map.display_x / 4
@weather.oy = $game_map.display_y / 4
@weather.update
# Update picture sprites
for sprite in @picture_sprites
sprite.update
end
# Update timer sprite
@timer_sprite.update
# Set screen color tone and shake position
@viewport1.tone = $game_screen.tone
@viewport1.ox = $game_screen.shake
# Set screen flash color
@viewport3.color = $game_screen.flash_color
# Update viewports
@viewport1.update
@viewport3.update
end
end
end


I was just wondering if this script is if at all compatible with Pokemon Essentials, because having lag all because of the size and amount of events I have on a map is just ridiculous; and my computer is up to date in terms of specs. I would greatly appreciate some input on this if it can be done.
__________________
Visit my YouTube Channel: http://www.youtube.com/user/Pokemonmaster212
My Pokemon Symphonic Horizon RPG Maker XP Game: http://www.pokecommunity.com/showthr...66#post8016366
Reply With Quote
  #2    
Old May 25th, 2013, 05:29 PM
thor348's Avatar
thor348
That's Oak to You
 
Join Date: Nov 2012
Location: Albion
Gender: Male
Nature: Calm
Just posting a personal experience with lag. I found that even with a lot of events and large maps, the game should run smoothly. My PC is crazy powerful but if I have the battery settings set to Power Saving (even when plugged in) it tends to lag. But when it's set to Entertainment mode (doesn't need to be plugged it) it will run smoothly. Just a personal experience.

I don't have the time to read through the script to see if it's compatible but if the battery thing doesn't work, i'll read through it.
Reply With Quote
  #3    
Old May 25th, 2013, 05:34 PM
Dylanrockin's Avatar
Dylanrockin
Mysterious Trainer
 
Join Date: May 2011
Gender: Male
Nature: Timid
Quote:
Originally Posted by thor348 View Post
Just posting a personal experience with lag. I found that even with a lot of events and large maps, the game should run smoothly. My PC is crazy powerful but if I have the battery settings set to Power Saving (even when plugged in) it tends to lag. But when it's set to Entertainment mode (doesn't need to be plugged it) it will run smoothly. Just a personal experience.

I don't have the time to read through the script to see if it's compatible but if the battery thing doesn't work, i'll read through it.
Well the thing is, is that I am using a desktop not a Laptop, so I'm not to sure about that working for me.
__________________
Visit my YouTube Channel: http://www.youtube.com/user/Pokemonmaster212
My Pokemon Symphonic Horizon RPG Maker XP Game: http://www.pokecommunity.com/showthr...66#post8016366
Reply With Quote
  #4    
Old May 25th, 2013, 09:52 PM
thor348's Avatar
thor348
That's Oak to You
 
Join Date: Nov 2012
Location: Albion
Gender: Male
Nature: Calm
You said you get an error, could you post a screen shot?
Reply With Quote
  #5    
Old May 26th, 2013, 05:06 AM
Maruno's Avatar
Maruno
Lead Dev of Pokémon Essentials
 
Join Date: Jan 2008
Location: England
Essentials already has something like this, which prevents off-screen events from updating. Also, Essentials changes so many scripts that anything not designed for it will probably not work and cause errors.
__________________
Reply With Quote
  #6    
Old May 26th, 2013, 06:00 AM
Dylanrockin's Avatar
Dylanrockin
Mysterious Trainer
 
Join Date: May 2011
Gender: Male
Nature: Timid
Quote:
Originally Posted by Maruno View Post
Essentials already has something like this, which prevents off-screen events from updating. Also, Essentials changes so many scripts that anything not designed for it will probably not work and cause errors.
Hmm, well that's good, but is there another way around the lag that is ever present?
__________________
Visit my YouTube Channel: http://www.youtube.com/user/Pokemonmaster212
My Pokemon Symphonic Horizon RPG Maker XP Game: http://www.pokecommunity.com/showthr...66#post8016366
Reply With Quote
  #7    
Old May 26th, 2013, 06:06 AM
Maruno's Avatar
Maruno
Lead Dev of Pokémon Essentials
 
Join Date: Jan 2008
Location: England
You're the first person who's mentioned lag in quite a while. It's hard for me to tackle lag because I don't get it (so I can't tell what needs changing and whether the changes work).
__________________
Reply With Quote
  #8    
Old May 26th, 2013, 06:17 AM
Dylanrockin's Avatar
Dylanrockin
Mysterious Trainer
 
Join Date: May 2011
Gender: Male
Nature: Timid
Quote:
Originally Posted by Maruno View Post
You're the first person who's mentioned lag in quite a while. It's hard for me to tackle lag because I don't get it (so I can't tell what needs changing and whether the changes work).
I like to believe that it has something to do with very large 3x 100x70 maps connected on canvas, with a lot of light sources and animating event Pokemon and Trainers. But as stated above, apparently that's not an issue, I haven't really included any kinds of new scripts to the game, so I'm not sure that's a problem.
__________________
Visit my YouTube Channel: http://www.youtube.com/user/Pokemonmaster212
My Pokemon Symphonic Horizon RPG Maker XP Game: http://www.pokecommunity.com/showthr...66#post8016366
Reply With Quote
  #9    
Old May 26th, 2013, 11:58 AM
thor348's Avatar
thor348
That's Oak to You
 
Join Date: Nov 2012
Location: Albion
Gender: Male
Nature: Calm
I remember when I first started using essentials and I put about 20 different particle effects on a map about 30x23 and it lagged really bad. You could just break your large maps down and set it in the meta to where it doesn't show the area when you move between them. You just need to be careful about the trees because if half a tree is in one and the other half in the other map, the tips of the trees and your character get a little messed up when walking behind them. It will be extra work for the encounters but it's all worth it to not have lag.
Reply With Quote
  #10    
Old May 27th, 2013, 07:12 AM
Dylanrockin's Avatar
Dylanrockin
Mysterious Trainer
 
Join Date: May 2011
Gender: Male
Nature: Timid
Quote:
Originally Posted by thor348 View Post
I remember when I first started using essentials and I put about 20 different particle effects on a map about 30x23 and it lagged really bad. You could just break your large maps down and set it in the meta to where it doesn't show the area when you move between them. You just need to be careful about the trees because if half a tree is in one and the other half in the other map, the tips of the trees and your character get a little messed up when walking behind them. It will be extra work for the encounters but it's all worth it to not have lag.
I would take that into consideration if not for the fact that when I warped to one of the example maps, the lag persisted even there; which is much farther away from my currently large canvas with a lot of light sources.
__________________
Visit my YouTube Channel: http://www.youtube.com/user/Pokemonmaster212
My Pokemon Symphonic Horizon RPG Maker XP Game: http://www.pokecommunity.com/showthr...66#post8016366
Reply With Quote
  #11    
Old May 27th, 2013, 08:38 AM
thor348's Avatar
thor348
That's Oak to You
 
Join Date: Nov 2012
Location: Albion
Gender: Male
Nature: Calm
Would you be able to post a screenshot of the error you get upon start up with the the anti lag script in effect?
Reply With Quote
  #12    
Old May 27th, 2013, 11:06 AM
Dylanrockin's Avatar
Dylanrockin
Mysterious Trainer
 
Join Date: May 2011
Gender: Male
Nature: Timid
Quote:
Originally Posted by thor348 View Post
Would you be able to post a screenshot of the error you get upon start up with the the anti lag script in effect?
Interpreter:276:in `pbExecuteScript'
Interpreter:788:in `command_111'
Interpreter:320:in `execute_command'
Interpreter:193:in `update'
Interpreter:106:in `loop'
Interpreter:198:in `update'
Scene_Map:103:in `update'
Scene_Map:101:in `loop'
Scene_Map:114:in `update'
Scene_Map:68:in `main'
Exception: ArgumentError
Message: wrong number of arguments(1 for 0)
Scene_Map:29:in `initialize'
Scene_Map:29:in `new'
Scene_Map:29:in `createSpritesets'
Scene_Map:28:in `each'
Scene_Map:28:in `createSpritesets'
Scene_Map:63:in `main'
Main:37:in `mainFunctionDebug'
Mainin `mainFunction'
Mainin `pbCriticalCode'
Mainin `mainFunction'
__________________
Visit my YouTube Channel: http://www.youtube.com/user/Pokemonmaster212
My Pokemon Symphonic Horizon RPG Maker XP Game: http://www.pokecommunity.com/showthr...66#post8016366
Reply With Quote
  #13    
Old May 27th, 2013, 04:05 PM
thor348's Avatar
thor348
That's Oak to You
 
Join Date: Nov 2012
Location: Albion
Gender: Male
Nature: Calm
I was just glancing over the anti lag script and I don't see how it could be compatible in some areas. I was doing research on your error and I found a wiki on the essentials website the talks about lag and various things that it could come from and how to fix it:

http://pokemonessentials.wikia.com/w..._bugs/Old_bugs

Look towards the top, the "Game Lag" section.
Reply With Quote
  #14    
Old May 27th, 2013, 05:15 PM
Dylanrockin's Avatar
Dylanrockin
Mysterious Trainer
 
Join Date: May 2011
Gender: Male
Nature: Timid
Quote:
Originally Posted by thor348 View Post
I was just glancing over the anti lag script and I don't see how it could be compatible in some areas. I was doing research on your error and I found a wiki on the essentials website the talks about lag and various things that it could come from and how to fix it:

http://pokemonessentials.wikia.com/w..._bugs/Old_bugs

Look towards the top, the "Game Lag" section.
I see, well I knew that the day/night system had something partly to do with it, but I'm not gonna disable it just to fix the lag. But didn't you tell me that I didn't necessarily need to have my maps connected, and that I could use a transfer point between the maps; rather than having them connected to one huge canvas? Because I do have gates that are meant to transfer the player between the maps.
__________________
Visit my YouTube Channel: http://www.youtube.com/user/Pokemonmaster212
My Pokemon Symphonic Horizon RPG Maker XP Game: http://www.pokecommunity.com/showthr...66#post8016366
Reply With Quote
  #15    
Old May 27th, 2013, 08:24 PM
thor348's Avatar
thor348
That's Oak to You
 
Join Date: Nov 2012
Location: Albion
Gender: Male
Nature: Calm
Quote:
Originally Posted by Dylanrockin View Post
I see, well I knew that the day/night system had something partly to do with it, but I'm not gonna disable it just to fix the lag. But didn't you tell me that I didn't necessarily need to have my maps connected, and that I could use a transfer point between the maps; rather than having them connected to one huge canvas? Because I do have gates that are meant to transfer the player between the maps.
Somewhat yes. You know the Visual Editor in the Editor.exe? How you can set the map connections? You can break the maps down to smaller chunks (ex. 40x25) and have them connected. But when you go into the meta data you can choose whether or not it shows the area when you enter the map boundaries? Keep it to nil or false. This way it acts as a single map rather than a bunch of small ones. If the lag persists, then you could do the gates to transfer.

I have a cave in my game that is about 80x64 and it lagged just a small amount (maybe slower by about 8 fps) until I broke it into 4 different maps. There were about 40 different events and many of those had an auto run function. (timed events)

Ever play Legend of Zelda Link to the Past? Remember how the map transfers would work? I have a Zelda project and I could give you a small quick tutorial on how to do that if nothing else works.
Reply With Quote
  #16    
Old May 27th, 2013, 09:39 PM
Dylanrockin's Avatar
Dylanrockin
Mysterious Trainer
 
Join Date: May 2011
Gender: Male
Nature: Timid
Quote:
Originally Posted by thor348 View Post
Somewhat yes. You know the Visual Editor in the Editor.exe? How you can set the map connections? You can break the maps down to smaller chunks (ex. 40x25) and have them connected. But when you go into the meta data you can choose whether or not it shows the area when you enter the map boundaries? Keep it to nil or false. This way it acts as a single map rather than a bunch of small ones. If the lag persists, then you could do the gates to transfer.

I have a cave in my game that is about 80x64 and it lagged just a small amount (maybe slower by about 8 fps) until I broke it into 4 different maps. There were about 40 different events and many of those had an auto run function. (timed events)

Ever play Legend of Zelda Link to the Past? Remember how the map transfers would work? I have a Zelda project and I could give you a small quick tutorial on how to do that if nothing else works.
I'll try out your first idea and if that doesn't work I would be very interested in your tutorial. Also yes I have played Link to the Past it is glorious.
__________________
Visit my YouTube Channel: http://www.youtube.com/user/Pokemonmaster212
My Pokemon Symphonic Horizon RPG Maker XP Game: http://www.pokecommunity.com/showthr...66#post8016366
Reply With Quote
  #17    
Old May 28th, 2013, 11:43 PM
Pia Carrot's Avatar
Pia Carrot
Gen II Hacker | PHO Enthusiast
 
Join Date: Aug 2010
Age: 19
Gender: Male
Nature: Adamant
Ugh...The headaches of Mint version haunt me again. From my personal experience, having a large world map caused me annoying lag when walking, albeit it was paired with awkward diagonal movement. I'm certain map connections can be a problem, combined with a non-optimized PC.
__________________



Reply With Quote
  #18    
Old May 29th, 2013, 01:51 AM
thor348's Avatar
thor348
That's Oak to You
 
Join Date: Nov 2012
Location: Albion
Gender: Male
Nature: Calm
Quote:
Originally Posted by Evil Arms View Post
Ugh...The headaches of Mint version haunt me again. From my personal experience, having a large world map caused me annoying lag when walking, albeit it was paired with awkward diagonal movement. I'm certain map connections can be a problem, combined with a non-optimized PC.
I ran him through on how to break the large maps into smaller ones. As far as I know, the lag has ceased.
Reply With Quote
  #19    
Old May 29th, 2013, 09:51 AM
Dylanrockin's Avatar
Dylanrockin
Mysterious Trainer
 
Join Date: May 2011
Gender: Male
Nature: Timid
Quote:
Originally Posted by thor348 View Post
I ran him through on how to break the large maps into smaller ones. As far as I know, the lag has ceased.
I did a test with splicing the map into 2 different maps, and the lag isn't as bad with 2, so I will be doing 4 instead.
__________________
Visit my YouTube Channel: http://www.youtube.com/user/Pokemonmaster212
My Pokemon Symphonic Horizon RPG Maker XP Game: http://www.pokecommunity.com/showthr...66#post8016366
Reply With Quote
Reply
Quick Reply

Sponsored Links


Advertise here
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Minimum Characters Per Post: 25



All times are UTC -8. The time now is 07:02 AM.


Style by Nymphadora, artwork by Sa-Dui.
Like our Facebook Page Follow us on Twitter © 2002 - 2014 The PokéCommunity™, pokecommunity.com.
Pokémon characters and images belong to The Pokémon Company International and Nintendo. This website is in no way affiliated with or endorsed by Nintendo, Creatures, GAMEFREAK, The Pokémon Company or The Pokémon Company International. We just love Pokémon.
All forum styles, their images (unless noted otherwise) and site designs are © 2002 - 2014 The PokéCommunity / PokéCommunity.com.
PokéCommunity™ is a trademark of The PokéCommunity. All rights reserved. Sponsor advertisements do not imply our endorsement of that product or service. User generated content remains the property of its creator.