Project1
标题:
防止事件过多卡机脚本怎么用在800*600分辨率上面
[打印本页]
作者:
005020671
时间:
2011-6-12 17:50
标题:
防止事件过多卡机脚本怎么用在800*600分辨率上面
#======================================
# ■ Anti Event Lag Script
#======================================
# By: Near Fantastica
# Date: 12.06.05
# Version: 3
#======================================
#======================================
# ■ Game_Map
#======================================
class Game_Map
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
# ● 判断是否刷新事件
#--------------------------------------------------------------------------
def in_range?(event)
if event.trigger == 3 or event.trigger == 4
return true
end
map_x = $game_map.display_x
map_y = $game_map.display_y
real_x = event.real_x
real_y = event.real_y
if real_x > map_x - 160 and real_x < map_x + 30 * 128
if real_y > map_y - 160 and real_y < map_y + 25 * 128
return true
end
end
return false
end
#--------------------------------------------------------------------------
def update
if $game_map.need_refresh
refresh
end
if @scroll_rest > 0
distance = 2 ** @scroll_speed
case @scroll_direction
when 2
scroll_down(distance)
when 4
scroll_left(distance)
when 6
scroll_right(distance)
when 8
scroll_up(distance)
end
@scroll_rest -= distance
end
for event in @events.values
if in_range?(event) or event.trigger == 3 or event.trigger == 4
event.update
end
end
for common_event in @common_events.values
common_event.update
end
@fog_ox -= @fog_sx / 8.0
@fog_oy -= @fog_sy / 8.0
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
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
#--------------------------------------------------------------------------
def in_range?(object)
screne_x = $game_map.display_x
screne_x -= 256
screne_y = $game_map.display_y
screne_y -= 256
screne_width = $game_map.display_x
screne_width += 2816
screne_height = $game_map.display_y
screne_height += 2176
return false if object.real_x <= screne_x - 128
return false if object.real_x >= screne_width + 128
return false if object.real_y <= screne_y - 128
return false if object.real_y >= screne_height + 128
return true
end
#--------------------------------------------------------------------------
def update
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_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
@tilemap.ox = $game_map.display_x / 4
@tilemap.oy = $game_map.display_y / 4
@tilemap.update
@panorama.ox = $game_map.display_x / 8
@panorama.oy = $game_map.display_y / 8
@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
i=0
for sprite in @character_sprites
if sprite.character.is_a?(Game_Event)
if in_range?(sprite.character) or sprite.character.trigger == 3 or sprite.character.trigger == 4
sprite.update
i+=1
end
else
sprite.update
i+=1
end
end
#p i
@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
for sprite in @picture_sprites
sprite.update
end
@timer_sprite.update
@viewport1.tone = $game_screen.tone
@viewport1.ox = $game_screen.shake
@viewport3.color = $game_screen.flash_color
@viewport1.update
@viewport3.update
end
end
复制代码
005020671于2011-6-13 18:41补充以下内容:
没人吗??
005020671于2011-6-14 14:48补充以下内容:
无人问津、、、、 dsu_plus_rewardpost_czw
作者:
eve592370698
时间:
2011-6-23 14:18
本帖最后由 eve592370698 于 2011-6-23 16:12 编辑
我可以告诉您,这个脚本系统无法使用“不是马甲”的那个分辨率扩展脚本,鄙人曾经尝试过,但是放弃了,原因如下:
1.版本不同,这个脚本是专门针对1.02版,而分辨率扩展是1.03版,
2.dll加载项不同,因为800×600分辨率扩展脚本使用的RGSS103J.dll、kernel33.dll和user33.dll必经不同于程序自带的原版RGSS103J.dll以及windows系统自带的kernel32.dll、user32.dll(这两个扩展说真的,XP与vista等操作系统是有一点不同的,虽然都是32位,但windows NT核心版本不同而不同)
3.脚本中的核心名词有变化:原脚本中@viewport1被替换成$viewport1,同时增加了$viewport4、$viewport5和$viewport6,分别对应着超过640×480分辨率的四个象限。
4.最关键的东西,也就是最根本的:分辨率扩展脚本其实是增加了程序的负荷!从第三点不难看出,局部其实是增加了3倍工作量,这就好比说电脑的CPU、内存有限,工作量超过了负荷,就卡一样。但是配置好的电脑呢?这就涉及到虚拟机(也可以叫模拟器),没错,其实game.exe也就是一个虚拟机,这关键就在于有的虚拟机是会限制CPU、内存、显卡等的使用的(特别是限制内存、显存的使用,例如街机、N64模拟器,这是个典型我表达能力有限),这也正是说事件所需要的运转资源达到了瓶颈,游戏超负荷运转一样,不能单纯通过游戏自身的脚本来解决。
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1