逗游網(wǎng):值得大家信賴的游戲下載站!
發(fā)布時間:2014-12-09 10:18 來源:互聯(lián)網(wǎng) 作者:aronchack 編輯:小貓
第三章 第1節(jié)-減少跳出(2)
收起個性化設置:
參數(shù)名稱 |
默認值 |
CK官網(wǎng)說明 |
譯文 |
補充說明 |
fUpdateBudgetMS | 1.2 | This setting controls how much time the main Papyrus update loop gets. This loop mainly controls function dispatch. If a lot of function calls are being made and a lot of scripts are running, increasing this value may improve script performance at the cost of reduced game framerate. However most of the time the VM won't take this entire time slice and increasing the value will have no effect. | 此設置控制主要PAPYRUS更新循環(huán)時間。這個循環(huán)主要控制功能的調(diào)度。如果有很多的函數(shù)調(diào)用和腳本運行,增加這個值可能會提高腳本性能,代價是游戲幀率降低。然而,大多數(shù)的時間VM將不會調(diào)用整個時間段,增加這個值,將不會有任何影響。 | Debug循環(huán)時間,只對存在于整個循環(huán)的部分代碼段生效!建議增大。 |
fExtraTaskletBudgetMD | 1.2 | This setting controls how much time taken out of another game thread is taken up by running script tasklets (the code that runs the raw script byte code). This time is on top of the time that the tasklets normally get in their own thread, but because that thread is shared they may end up being starved if other systems are highly stressed. If the game is not stressed, this time will not be used. Increasing this value may improve script performance in high-stress situations at the expense of framerate. | 此設置"腳本控制子任務"(這里指腳本源碼的編譯運行進程)調(diào)取另一個游戲線程所花費的時間。此時間優(yōu)先于所有腳本獲得線程的時間。但由于所用線程被共享,所以當其他部分系統(tǒng)資源吃緊時,這些腳本可能會被終止。如果游戲不吃資源,這段時間則不會被調(diào)用。增加此數(shù)值可以提高系統(tǒng)在資源極度吃緊情況下腳本運行的表現(xiàn),但代價是游戲幀率會降低。 | 指上圖中的最終編譯線程調(diào)用游戲其它線程。建議增大提高腳本的編譯容錯率。以少量幀數(shù)來換取游戲穩(wěn)定是值得的! |
fPostLoadUpdateTimeMS | 500.0 (on PC), 2000.0 (on Xenon and PS3) |
This
setting controls how much time is added onto the load screen to do additional
script processing in case the cell being loaded into needs to set itself up.
Adjusting the time will adjust your visible load screen time. Adjust this
setting if a cell with very complicated scripting is not getting quite set up in
time by the time the player loads. This also may depend on the story manager
since quests may not start until the load screen finishes if they are started up
right before the player hits a load door. If the quest initial stage has a lot
of scripting then it may need the extra time to run before the load screen is
pulled down. Default: 500.0 (on PC), 2000.0 (on Xenon and PS3) |
這項設置控制在進入載入畫面時所要額外增加的時間,用以幫助處理額外的腳本,尤其是正在加載的單元需要獨立建立此腳本的時候。這項時間的調(diào)整將會影響可視載入畫面的總時間。如果一個單元內(nèi)的腳本過于復雜,以致當玩家載入時不能及時建立,那么這項設置最好進行調(diào)整。這項內(nèi)容的變化還同時取決于游戲事件控制器,因為如果玩家在剛好開啟一道載入門時開啟任務,那么該任務在載入畫面結(jié)束之后才可能開始,而且在載入畫面完全結(jié)束前,這些任務不會在后臺展開。所以如果該任務的初始階段有大量腳本要運行,那么載入畫面在結(jié)束前會需要一些更多的時間來做處理。 默認值:500.0(電腦),2000.0(XBOX和PS3) |
建議增大,這樣在游戲中進入一個含有大量的腳本代碼的房間和地牢時,能足夠的時間進行編譯!減少因為編譯未完成就進行游戲而導致的跳出! |
iMinMemoryPageSize | 128 | This is the smallest amount of memory the VM will allocate for a single stack page, in bytes. Smaller values will waste less memory on small stacks, but larger values will reduce the number of allocations for stacks with many small frames (which improves performance). | 這是VM分配到單一分頁文件的最小內(nèi)存量,單位是bytes.這是設置最小內(nèi)存量。在小型棧區(qū)的時候,"較小的值會浪費更少的內(nèi)存,但較大的值將減少擁有許多小頁面的棧區(qū)的分配數(shù)量(從而提高性能)。 | 單一棧區(qū)的最小內(nèi)存用量,這里默認是128b,建議適當增大。以適合進行大量計算的腳本代碼的變量存儲! |
iMaxMemoryPageSize | 512 | This is the largest amount of memory the VM will allocate for a single stack page, in bytes. Smaller values may force the VM to allocate more pages for large stack frames. Larger values may cause the memory allocator to allocate differently, decreasing performance for large stack frames. | 這是VM分配到單一分頁文件的最大內(nèi)存量,單位是字節(jié)。較小的值,可能會迫使VM分配更多的頁面給大的分頁文件,較大的值可能會導致內(nèi)存分配器分配不同的,低效的頁面給較大的分頁文件。 | 這個值進行合適的設置,并不是越高越好,過大的值會起到反效果!原因在官方說明中已經(jīng)進行解釋。單一棧區(qū)的最大內(nèi)存用量。 |
iMaxAllocatedMemoryBytes | 76800(76kb) | This is the maximum amount of memory the VM will allocate in total for stack frames. If an allocation would push memory usage over this limit, the VM will instead wait for more memory to be freed. Increasing this value may improve performance in high-stress situations with lots of scripts running, but will use more memory. Note that it is possible to exceed this value temporarily while loading a save game due to slightly different allocation ordering. | 這是VM分配的總的分頁文件的最大的內(nèi)存量。如果一個已分配的頁面將促使內(nèi)存使用量超過此限制,VM將等待更多的內(nèi)存被釋放。增加該值可以提高運行很多腳本的高壓力的情況下的性能,但是會使用更多的內(nèi)存。值得注意的是,由于加載游戲存檔時的分配順序略有不同,可能會暫時替代這個值。 | 所有腳本編譯時棧區(qū)的最大內(nèi)存用量總和!建議增大,以減少在高壓力下,因為等待內(nèi)存釋放而需要的時間! |
bEnableLogging | 0 |
This
setting turns logging on and off. If off, no logging will occur, even traces,
and so it will override the bEnableTrace value. The in-game log display will
still work, but nothing will be written to disk. Turning this off may improve
performance due to less disk activity. Default: 0 |
此設置打開或者關閉游戲日志。如果關閉,將不會有日志記錄,而且它的值將影響到bEnableTrace的設置。但是游戲中的日記記錄功能還是會繼續(xù)運行,只是不會記錄到硬盤。關閉這個功能將提高游戲性能,由于磁盤活動減少。 默認值:0 |
游戲日志文件LOG的開關。 |
bEnableTrace | 0 | This setting turns on and off the script trace commands. System error and warning messages will still be logged to disk. If bEnableLogging is false, this setting is ignored as nothing will be written to disk anyway. Trace commands will NOT be visible in the in-game log display if this setting is off. Turning this off may improve performance due to less disk activity. | 此設置打開和關閉腳本跟蹤命令。系統(tǒng)錯誤和警告消息仍然會被記錄到磁盤上。如果bEnableLogging是關閉的,這個設置將被忽略,因為反正什么都不會被寫入到磁盤。在游戲運行中,如果這個設置是關閉的,跟蹤記錄在游戲日志中是無法顯示。關閉這個選項可能會提高性能,因為磁盤活動減少。 | 日志文件中是否使用腳本在編譯和運行的實時跟蹤。Trace是程序員常用的調(diào)試手段。使用此命令的前提是bEnableLogging必須為1。 |
bLoadDebugInformation | 0 | This setting enables or disables the loading of additional debug information - essentially line number information. If this setting is off, error messages cannot generate line number data. Turning this on will allow line numbers to be available in error traces at the cost of increased memory usage. | 此設置啟用或禁用加載額外的調(diào)試信息 - 基本上是行號信息。如果此設置為關閉,錯誤消息無法產(chǎn)生行號數(shù)據(jù)。開啟這一功能將允許在錯誤信息中使用行號信息,代價是增加內(nèi)存用量。 | 是否在日志的錯誤信息中記錄出錯的腳本代碼的行號。使用此設置會加大內(nèi)存負擔,但是便于在日志文件中找到出錯的腳本代碼! |
bEnableProfiling | 0 | This setting enables or disables the script profiler. If off, none of the script profiling commands will be available. Turn this setting on to allow profiling information to be collected and logged. If on, script performance will degrade slightly. | 此設置為啟用或禁用腳本分析器。如果關閉,腳本分析命令將不可用。啟用此設置將允許分析信息的被收集和記錄。如果啟用此設置,腳本的性能會略有降低。 | 啟用腳本分析 |
uTraceStatusOfQuest | 0 | This setting sets a quest to track for script changes by form ID (converted to decimal). The quest that this setting specifies will spit out a Papyrus stack trace to the log every time a Papyrus script tries to change something with it like starting, stopping, setting a stage, or showing an objective. | 設置一個任務來跟蹤哪個FORMID(轉(zhuǎn)換為十進制)產(chǎn)生腳本變化。這設置中指出的任務會分出一個Papyrus stack去記錄下每次Pupyrus腳本試圖改變的某些東西時的變化,如啟動,停止,設置一個場景,或顯示一個目標。 開發(fā)人員使用較多。 | 一般人基本不會使用到這個,這里不詳述。 |
那么,我們來根據(jù)官方給出的參數(shù)解釋,我們來點評一下之前那個錯誤的設置:
[Papyrus]
iMinMemoryPageSize=100000
錯誤1.這個設置必須為2的N次方,便于編譯器尋址,100000是2的多少次方?
錯誤2.這個值設置太大,會導致每個棧區(qū)的空閑空間多,反而會增加尋址時間,之前那幾個反例中有個同學提到無限讀盤,就是這個原因。
iMaxMemoryPageSize=5000000
錯誤1.官方說明中已經(jīng)明確指出,這個值設置太大,會導致VM分配出來的棧區(qū)是低效的。估計這個“N網(wǎng)大神”沒分清楚棧區(qū)和內(nèi)存的區(qū)別!
錯誤2.一個棧區(qū)你就分配500000b/1024/1024=4.76Mb的容量去存那最多1Kb不到的數(shù)據(jù)?你內(nèi)存多吃飽撐的?
iMaxAllocatedMemoryBytes=1800000000
錯誤:增大此項,無可厚非,但是這也太大了,會導致棧區(qū)不能被及時回收,造成數(shù)據(jù)冗余,內(nèi)存溢出!
1800000000/1024/1024=1716.61Mb=1.7G???內(nèi)存全用來跑腳本啦?游戲的顯示模塊,交互模塊昨辦?
還記不記得我在上面說過的32位程序最多能調(diào)用多大內(nèi)存?
在上面的例子中,有一個同學說是引用了N網(wǎng)的設置,我在這很明確的說,那貨絕對不是程序員出身,放這種設置出來害人,N網(wǎng)有大神,也有2B!
引申閱讀:什么是堆棧?
有興趣的同學可以看看:點擊進入
現(xiàn)在我們來進行正確的設置:
打開我的文檔My GamesSkyrim目錄下的Skyrim.ini
在[Papyrus]下進行如下修改(沒有這些字段的直接添加!)
默認設置,調(diào)亂了的同學直接復制下面這段,或者直接刪除 | 推薦設置 | 說明 |
[Papyrus] fUpdateBudgetMS=1.2 fExtraTaskletBudgetMS=1.2 fPostLoadUpdateTimeMS=500.0 iMinMemoryPageSize=128 iMaxMemoryPageSize=512 iMaxAllocatedMemoryBytes=76800 bEnableLogging=0 bEnableTrace=0 bLoadDebugInformation=0 bEnableProfiling=0 |
[Papyrus] fUpdateBudgetMS=800(我用2.4) fExtraTaskletBudgetMS=800(我用2.4) fPostLoadUpdateTimeMS=2000 iMinMemoryPageSize=256 iMaxMemoryPageSize=512 iMaxAllocatedMemoryBytes=2457600 bEnableLogging=0 bEnableTrace=0 bLoadDebugInformation=0 bEnableProfiling=0 |
[Papyrus] fUpdateBudgetMS此項可根據(jù)實際情況更改 fExtraTaskletBudgetMS此項可根據(jù)實際情況更改 fPostLoadUpdateTimeMS建議使用XBOX的設置 iMinMemoryPageSize適當增大為256Bytes,以適應多變量腳本 iMaxMemoryPageSize保持不變,以免編譯進程中存在太多的低效棧區(qū)! iMaxAllocatedMemoryBytes2400Kb足矣,以免內(nèi)存回收不及時,再次吐槽那個1.7G的設置! bEnableLogging在不需要打開日志文件時為0 bEnableTrace為0 bLoadDebugInformation為0 bLoadDebugInformation為0 bEnableProfiling為0 |
這里再說一個誤區(qū),是剛才有個同學在回復中問的:
問所謂的內(nèi)存清理MOD有沒有作用?
他給了我一個網(wǎng)址,說是從這下的:點擊進入
N網(wǎng)原址:點擊進入
讓我們用工具拆開這個MOD來看看代碼:
這個回復在843樓,大家可以去看看!
這個什么All_you_need_Skyrim_performance_mod不要再用了,就是一個坑爹貨。
清理內(nèi)存,我給大家支兩招:
1.在控制臺使用PCB命令。
2.在我的文檔My GamesSkyrimSkyrimPrefs.ini中的[BackgroundLoad]字段添加以下參數(shù)
[BackgroundLoad]
bSelectivePurgeUnusedOnFastTravel=1
改這個有點用
快速旅行時清理不用的內(nèi)存。
這樣設置,能在腳本編譯和運行時稍微增大資源支持。保持游戲穩(wěn)定。當然,本身就有錯誤的腳本不在此例,這個我會在后面講到。
總結(jié),合理的設置能優(yōu)化游戲運行,減少CTD,反之,則會起到反效果。
對于一些盲目相信N網(wǎng)的人,我只能保留意見。