设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 3332|回复: 3
打印 上一主题 下一主题

[已经解决] 为什么有时候会很卡?

[复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
17 小时
注册时间
2012-12-1
帖子
13
跳转到指定楼层
1
发表于 2012-12-9 17:17:48 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有帐号?注册会员

x
各位大神,行走的时候很卡,是怎么回事?

点评

1、电脑配置 2、游戏窗口分辨率  发表于 2012-12-9 18:21

Lv5.捕梦者 (暗夜天使)

只有笨蛋才会看到

梦石
1
星屑
20965
在线时间
9334 小时
注册时间
2012-6-19
帖子
7106

开拓者短篇九导演组冠军

2
发表于 2012-12-9 17:57:44 手机端发表。 | 只看该作者
敲一下F2看看标题栏上显示的桢率是否为60FPS,如果不是……

事件过多、电脑配置太差、后台程序开太多……
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
687 小时
注册时间
2012-10-29
帖子
1543
3
发表于 2012-12-9 18:54:43 | 只看该作者
本帖最后由 j433463 于 2012-12-9 18:56 编辑

我有使用两个脚本,觉得行走卡的情况比较减轻,一个是在 6R 这儿看到的防 lag 脚本,
一个是在国外 RGSS3 论坛上看到的 Mithran Picture Bug Fix 脚本,用来清除 Bitmap 的癈弃图片,
不妨试试吧:

防lag脚本 --
  1. #==============================================================================
  2. # ☆ HAR - Anti Lag (Dispose) Animation (v1.0)
  3. # 日期:2012/09/23
  4. #==============================================================================
  5. # -- 作者:    Moghunter
  6. # -- 翻译:    Harinlen
  7. # -- 等级:    系统底层级
  8. # -- 依赖关系:  无
  9. # -- 适用范围:  RPG Maker VX Ace
  10. # -- 不兼容脚本: 暂无
  11. #==============================================================================
  12. # ☆ 声明
  13. # 此脚本非本人所作,请保留作者信息。
  14. #==============================================================================
  15. # ☆ 用途
  16. # 此脚本将删除锁定(滞后)有关的动画。
  17. #
  18. # 在执行过程中的RPG Maker VX ACE需要相当长的时间读取或删除(配置)。 (图像,声音
  19. # 或视频)。最后结果就是你的游戏变得非常卡,这个脚本的能力就是将动画同时播放。简单
  20. # 的说,就是让动画同时播放的能力。
  21. #==============================================================================
  22. # ☆ 用法
  23. # 在Main前面插入一个脚本页,把此代码扔进去即可。
  24. #==============================================================================
  25. # ☆ 注意
  26. # 此脚本不删除锁定时间的动画效果,只是删除了和时间有所联系的动画效果。
  27. # (雾,原文就是此意思。)
  28. #==============================================================================

  29. #===============================================================================
  30. # ■ Game_Temp
  31. #===============================================================================
  32. class Game_Temp
  33.   attr_accessor :animation_garbage

  34.   #--------------------------------------------------------------------------
  35.   # ● Initialize
  36.   #--------------------------------------------------------------------------  
  37.   alias mog_anti_lag_animation_initialize initialize
  38.   def initialize
  39.       @animation_garbage = []
  40.       mog_anti_lag_animation_initialize
  41.   end  

  42. end

  43. #===============================================================================
  44. # ■ Game System
  45. #===============================================================================
  46. class Game_System

  47.   attr_accessor :anti_lag_animation

  48.   #--------------------------------------------------------------------------
  49.   # ● Initialize
  50.   #--------------------------------------------------------------------------   
  51.   alias mog_antilag_animation_initialize initialize
  52.   def initialize
  53.       @anti_lag_animation = true
  54.       mog_antilag_animation_initialize
  55.   end  

  56. end  

  57. #===============================================================================
  58. # ■ SceneManager
  59. #===============================================================================
  60. class << SceneManager

  61.   #--------------------------------------------------------------------------
  62.   # ● Call
  63.   #--------------------------------------------------------------------------  
  64.   alias mog_anti_lag_animation_call call
  65.   def call(scene_class)
  66.       mog_anti_lag_animation_call(scene_class)
  67.       dispose_animation_garbage
  68.   end  

  69.   #--------------------------------------------------------------------------
  70.   # ● Goto
  71.   #--------------------------------------------------------------------------   
  72.   alias mog_anti_lag_animation_goto goto
  73.   def goto(scene_class)
  74.       mog_anti_lag_animation_goto(scene_class)
  75.       dispose_animation_garbage
  76.   end

  77.   #--------------------------------------------------------------------------
  78.   # ● Dispose Animation Garbage
  79.   #--------------------------------------------------------------------------  
  80.   def dispose_animation_garbage
  81.       return if $game_temp.animation_garbage == nil
  82.       for animation in $game_temp.animation_garbage
  83.           animation.dispose
  84.       end  
  85.       $game_temp.animation_garbage = nil
  86.   end  

  87. end

  88. #==============================================================================
  89. # ■ Game Map
  90. #==============================================================================
  91. class Game_Map

  92.   #--------------------------------------------------------------------------
  93.   # ● Setup
  94.   #--------------------------------------------------------------------------   
  95.   alias mog_anti_lag_animation_setup setup
  96.   def setup(map_id)
  97.       SceneManager.dispose_animation_garbage
  98.       mog_anti_lag_animation_setup(map_id)
  99.   end

  100. end

  101. #==============================================================================
  102. # ■ Scene Base
  103. #==============================================================================
  104. class Scene_Base

  105.   #--------------------------------------------------------------------------
  106.   # ● Terminate
  107.   #--------------------------------------------------------------------------      
  108.   alias mog_anti_lag_animation_terminate terminate
  109.   def terminate
  110.       mog_anti_lag_animation_terminate
  111.       SceneManager.dispose_animation_garbage
  112.   end

  113. end

  114. #==============================================================================
  115. # ■ Sprite Base
  116. #==============================================================================
  117. class Sprite_Base < Sprite  

  118.   #--------------------------------------------------------------------------
  119.   # ● Dispose Animation
  120.   #--------------------------------------------------------------------------
  121.   alias mog_anti_lag_animation_dispose_animation dispose_animation
  122.   def dispose_animation
  123.       if $game_system.anti_lag_animation  
  124.          execute_animation_garbage  
  125.          return
  126.       end  
  127.       mog_anti_lag_animation_dispose_animation
  128.   end

  129.   #--------------------------------------------------------------------------
  130.   # ● Execute Animation Garbage
  131.   #--------------------------------------------------------------------------  
  132.   def execute_animation_garbage  
  133.       $game_temp.animation_garbage = [] if $game_temp.animation_garbage == nil
  134.       if @ani_bitmap1
  135.          @@_reference_count[@ani_bitmap1] -= 1
  136.         if @@_reference_count[@ani_bitmap1] == 0
  137.             $game_temp.animation_garbage.push(@ani_bitmap1)
  138.          end
  139.       end
  140.       if @ani_bitmap2
  141.          @@_reference_count[@ani_bitmap2] -= 1
  142.          if @@_reference_count[@ani_bitmap2] == 0
  143.             $game_temp.animation_garbage.push(@ani_bitmap2)
  144.         end
  145.      end
  146.      if @ani_sprites
  147.         @ani_sprites.each {|sprite| sprite.dispose }
  148.         @ani_sprites = nil
  149.         @animation = nil
  150.      end
  151.      @ani_bitmap1 = nil
  152.      @ani_bitmap2 = nil
  153.   end   

  154. end

  155. $rgss3_mog_anti_lag_animation = true
复制代码
Mithran Picture Bug Fix --


  1. #==============================================================================
  2. # ▼ Mithran Picture Bug Fix
  3. # -- Created: 3/12/2012
  4. #==============================================================================
  5. # The problem is caused when a picture is erased it holds an assoicated "picture"
  6. # object in memory as long as you stay on the same scene. Every time that picture
  7. # object comes up, it creates a NEW blank bitmap, every frame, basically if you
  8. # want it to lag, create a lot of blank pictures when they get garbage collected,
  9. # it lags.

  10. # Each erased picture creates a single 32x32 blank bitmap to associate
  11. # itself with, every frame, same with any picture shown as (none). Since the lag
  12. # is caused by garbage collection, which is basically uncontrollabe with Ruby.
  13. #
  14. # The reason why it constantly creates new blank pictures is because the base
  15. # scripts check for the picture name. And if it's "" (aka no picture name),
  16. # it keeps creating. When a picture is erased, it sets to ""
  17. #
  18. # This script fixes that.
  19. #==============================================================================

  20. class Sprite_Picture
  21.   def update_bitmap
  22.     if @picture.name != @pic_name
  23.       self.bitmap = Cache.picture(@picture.name)
  24.     end
  25.     @pic_name = @picture.name
  26.   end
  27.   
  28. end


  29. class Spriteset_Map
  30.   
  31.   def update_pictures
  32.     $game_map.screen.pictures.each do |pic|
  33.       @picture_sprites[pic.number] ||= Sprite_Picture.new(@viewport2, pic)
  34.       @picture_sprites[pic.number].update
  35.       if pic.name == ""
  36.         $game_map.screen.pictures.remove(pic.number)
  37.         @picture_sprites[pic.number].dispose
  38.         @picture_sprites[pic.number] = nil
  39.       end
  40.     end
  41.   end

  42. end

  43. class Game_Pictures
  44.   
  45.   def remove(index)
  46.     @data[index] = nil
  47.   end
  48.   
  49. end

复制代码

评分

参与人数 1梦石 +1 收起 理由
迷糊的安安 + 1 认可答案 附赠66RPG提供的精美好人卡一张^^.

查看全部评分

修改劇本中,仔細審查原來的劇情大綱,覺得有點不太滿意,嘗試編寫不同主角不同主線的劇情,希望能寫得出來。
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
144
在线时间
628 小时
注册时间
2012-6-9
帖子
1321
4
发表于 2012-12-9 21:07:13 | 只看该作者
2L解决了
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-4-29 07:12

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表