设为首页收藏本站同能贴吧 切换语言 繁体中文
开启辅助访问 切换到窄版
扫描二维码关注官方公众号
返回列表
+ 发新帖
查看: 108|回复: 0

[转载发布] RPG Maker VXAce Profiler

[复制链接]
累计送礼:
0 个
累计收礼:
1 个
  • TA的每日心情
    开心
    2026-7-12 04:10
  • 签到天数: 209 天

    连续签到: 2 天

    [LV.7]常住居民III

    9071

    主题

    864

    回帖

    6万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

    VIP
    7
    卡币
    58883
    OK点
    16
    推广点
    0
    同能卷
    50
    积分
    68848

    灌水之王

    发表于 2026-8-1 20:19:54 | 显示全部楼层 |阅读模式
    RPG Maker VXAce Profiler
     ​

    Introduction
    Primarily a scripter's tool. It helps you check out the performance of your game and is a lot more accurate than FPS relative values.
    This script is made with Neonblack  

     
    % time 
    The percent of the time spent inside the procedure itself (not counting children). 
    cumulative seconds 
    The total number of seconds spent in the procedure, including children. 
    self seconds 
    The total number of seconds spent in the procedure itself (not counting children). 
    calls 
    The total number of times the procedure was called. 
    self ms/call 
    The average time taken by the procedure itself on each call, in ms. 
    total ms/call 
    The average time taken by each call to the procedure, including time spent in child functions.
     
    Screenshots




    How to Use
    Put this script below all other scripts but above main. 
    Press CTRL to print to Console the results. 
     
    Warning, it starts the game slow (like 0-4 FPS even) but it's accurate in performance display.
    If graphics.update is skipped it means the game has a major lagspike on normal run. 

                    Code:       
    1. module CP_Profiler  @@stacks = {}  @@maps = {}  @@start = 0    def self.begin    @@stacks = {}    @@maps = {}    @@start = Process.times[0]    set_trace_func proc { |event, file, line, id, binding, klass|    case event    when "c-call", "call"      now = Process.times[0]      stack = (@@stacks[Thread.current] ||= [])      stack.push [now, 0.0]    when "c-return", "return"      now = Process.times[0]      key = "#{klass}##{id}"      stack = (@@stacks[Thread.current] ||= [])      if tick = stack.pop        threadmap = (@@maps[Thread.current] ||= {})        data = (threadmap[key] ||= [0, 0.0, 0.0, key])        data[0] += 1        cost = now - tick[0]        data[1] += cost        data[2] += cost - tick[1]        stack[-1][1] += cost if stack[-1]      end    end    }  end    def self.print    set_trace_func nil    total = Process.times[0]    total = 0.01 if total == 0    totals = {}    @@maps.values.each do |threadmap|      threadmap.each do |key,data|        total_data = (totals[key] ||= [0, 0.0, 0.0, key])        total_data[0] += data[0]        total_data[1] += data[1]        total_data[2] += data[2]      end    end    data = totals.values    data = data.sort_by{ |x| -x[2] }    sum = 0    puts sprintf "     %%   cumulative   self              self     total\n"    puts sprintf "    time   seconds   seconds    calls  ms/call  ms/call  name\n"    for d in data      break if d[2] <= 0.0      sum += d[2]      puts sprintf "%8.2f %8.2f  %8.2f %8d %8.2f %8.2f  %s\n",          d[2]/total*100, sum, d[2], d[0], d[2]*1000/d[0], d[1]*1000/d[0], d[3]    end    msgbox "Results printed to console.\nTracking reset."  endendclass Scene_Base  alias_method :cp_profiler_342341_update, :update  def update(*args)    cp_profiler_342341_update(*args)    if Input.trigger?(:CTRL)      CP_Profiler.print      CP_Profiler.begin    end  endendCP_Profiler.begin
    复制代码




    本贴来自国际rpgmaker官方论坛作者:Archeia处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:https://forums.rpgmakerweb.com/threads/rpg-maker-vxace-profiler.32930/

    本帖子中包含更多资源

    您需要 登录 才可以下载或查看,没有账号?立即注册

    x
    天天去同能,天天有童年!
    回复 送礼论坛版权

    使用道具 举报

    文明发言,和谐互动
    文明发言,和谐互动
    高级模式
    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    简体中文
    繁體中文
    English(英语)
    日本語(日语)
    Deutsch(德语)
    Русский язык(俄语)
    بالعربية(阿拉伯语)
    Türkçe(土耳其语)
    Português(葡萄牙语)
    ภาษาไทย(泰国语)
    한어(朝鲜语/韩语)
    Français(法语)
    关闭

    幸运抽奖

    社区每日抽奖来袭,快来试试你是欧皇还是非酋~

    立即查看

    聊天机器人
    Loading...

    QQ|Archiver|手机版|小黑屋|同能RPG制作大师 ( 沪ICP备12027754号-3 )

    GMT+8, 2026-8-17 13:37 , Processed in 0.069579 second(s), 52 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

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