WorldMgr/zh: Difference between revisions
imported>Simple (大概翻譯一下) |
imported>Simple (繼續翻譯) |
||
Line 1: | Line 1: | ||
'''World Manager''' (WorldMgr) 是遊戲裡的一個子系統。 | '''World Manager''' (WorldMgr) 是遊戲裡的一個子系統。 | ||
它控制時間、血月、氣候、天氣、霧、風、閃電、雲、山林霸主的出現等等。 | |||
這個子系統很大/複雜,它的功能被切成九個部分。 | 這個子系統很大/複雜,它的功能被切成九個部分。 | ||
譯者注:原文(英文)的寫作方式是盡可能地忠實呈現遊戲原始碼的意圖, | |||
譯者在原文外自行加入了遊玩過程中累積的經驗。 | |||
譯者沒辦法理解的或翻譯之後無法忠於原意的部分保留英文原文。 | |||
Line 17: | Line 21: | ||
! ID !! Description | ! ID !! Description | ||
|- | |- | ||
| 0 || TimeMgr: | | 0 || TimeMgr: 時間、血月、山林霸主 | ||
|- | |- | ||
| 1 || CloudPrMgr: 雲 | | 1 || CloudPrMgr: 雲 | ||
Line 45: | Line 49: | ||
== TimeMgr == | == TimeMgr == | ||
TimeMgr | TimeMgr 管理所有跟時間有關的事情,例如血月何時出現,山林霸主何時出現。 | ||
遊戲內時間(小時跟分鐘)是一個 [0.0, 360.0] 範圍內的浮點數。 | |||
0.0 代表子夜,180.0 代表中午。 | 0.0 代表子夜,180.0 代表中午。 | ||
Line 52: | Line 56: | ||
(init 代表初始化設定) | (init 代表初始化設定) | ||
* | * 遊戲內時間令為 78.75,早上 05:15 的意思)。 | ||
* Time for TotS environment is set to 78.75 (05:15) as well. | * Time for TotS environment is set to 78.75 (05:15) as well. | ||
* | * "Bloody Moon end reserve timer" is set to 0.(這個計時器不是用來倒數血月何時出現的那個,先別管它。) | ||
=== TimeMgr::reset === | === TimeMgr::reset === | ||
This is called whenever a stage is unloaded (essentially every time the loading screen is shown). | This is called whenever a stage is unloaded (essentially every time the loading screen is shown).(意思是只要讀檔就會呼叫這個成員函數。) | ||
* Blood Moon checks are delayed. | * Blood Moon checks are delayed. | ||
* The AnimalMaster_Appearance flag is cleared. | * The AnimalMaster_Appearance flag is cleared.(山林霸主 flag 會被設為 false,意思是不要出現。) | ||
=== TimeMgr::calc === | === TimeMgr::calc === | ||
Line 67: | Line 70: | ||
* (If field 0x14A is set to 99, WM_BloodyDay is set to true. [[AIDef:Action/SetBloodyMoonEnv]] uses this to force a Blood Moon to be scheduled. This feature appears to be unused.)(好像是沒用到的功能。) | * (If field 0x14A is set to 99, WM_BloodyDay is set to true. [[AIDef:Action/SetBloodyMoonEnv]] uses this to force a Blood Moon to be scheduled. This feature appears to be unused.)(好像是沒用到的功能。) | ||
* 如果某兩個過場動畫 [[Demo]]103_0 and Demo997_0 還沒播過的話,時間會被固定在 78.75(早上 05: | * 如果某兩個過場動畫 [[Demo]]103_0 and Demo997_0 還沒播過的話,時間會被固定在 78.75(早上 05:15)。(那兩個過場動畫,前一個應該是林克走出復甦神廟環顧海拉魯,後一個不知道。) | ||
* 如果 [[AIDef:Action/AdvanceTime]] 或是其他什麼東西強制把時間定在某個值的話(在營火旁睡覺之類的),那時間就會更新。 | |||
* 如果 [[AIDef:Action/AdvanceTime]] | * [[#子夜檢查]]。 | ||
* [[# | |||
* '''更新時間''':有幾種更新的模式,大部分的時候是用模式 0。 | |||
{|class="wikitable" | |||
! Mode !! Description | |||
|- | |||
| 0 || 如果 Demo103_0 or Demo997_0 播過的話,而且不是在過場動畫裡的話: | |||
* Add (0.0083333 * elapsed frames) to 遊戲內時間. 所以遊戲裡的一分鐘是現實生活中的一小時。 | |||
* 如果遊戲內時間 >= 360.0, 也就是完整的一天已經過完了,那就減掉 360,然後執行子夜檢查(下面詳述)。 | |||
* If FindDungeon_Activated is false (if the player hasn't received the ''The Isolated Plateau'' quest) and if the current time is >= 165.0 (11:00), the time is forcefully set to 11:00. Effectively, this means that time will not get past 11:00 until the Great Plateau Tower is activated and the Old Man cutscene is triggered. | |||
整句的意思是,遊戲從 5:15 開始跑,如果到 11:00 你還沒啟動初始之塔而且爬下來的話,遊戲時間會固定在 11:00。 | |||
* 血月計時器也會增加。 | |||
|- | |||
| 1, 13, 35 || Freeze time to 04:00 | |||
|- | |||
| 2, 14 || Freeze time to 05:00 | |||
|- | |||
| 3, 16, 36 || Freeze time to 07:00 | |||
|- | |||
| 4, 19, 37 || Freeze time to 10:00 | |||
|- | |||
| 5, 26, 39 || Freeze time to 17:00 | |||
|- | |||
| 6, 28, 40 || Freeze time to 19:00 | |||
|- | |||
| 7, 30, 41 || Freeze time to 21:00 | |||
|- | |||
| 8, 11 || Freeze time to 02:00 | |||
|- | |||
| 9, 42 || Freeze time to 00:00 | |||
|- | |||
| 10 || Freeze time to 01:00 | |||
|- | |||
| 12 || Freeze time to 03:00 | |||
|- | |||
| 15 || Freeze time to 06:00 | |||
|- | |||
| 17 || Freeze time to 08:00 | |||
|- | |||
| 18 || Freeze time to 09:00 | |||
|- | |||
| 20 || Freeze time to 11:00 | |||
|- | |||
| 21 || Freeze time to 12:00 | |||
|- | |||
| 22, 38 || Freeze time to 13:00 | |||
|- | |||
| 23 || Freeze time to 14:00 | |||
|- | |||
| 24 || Freeze time to 15:00 | |||
|- | |||
| 25 || Freeze time to 16:00 | |||
|- | |||
| 27 || Freeze time to 18:00 | |||
|- | |||
| 29 || Freeze time to 20:00 | |||
|- | |||
| 31 || Freeze time to 22:00 | |||
|- | |||
| 32 || Freeze time to 23:00 | |||
|- | |||
| 34 || | |||
* Add (0.0083333 * elapsed frames) to 遊戲內時間. | |||
* 如果遊戲內時間 >= 360.0, 也就是完整的一天已經過完了,那就減掉 360。 | |||
'''附註''': 這個模式跟模式 0 不一樣的地方在於血月計時器不會更新。 | |||
|} | |||
* 更新 [[#日夜標籤]],更新 [[#Time division, IsMorning, IsNoon, etc.]] | |||
* If the "Bloody Moon end reserve timer" is non zero, decrement it. If the new value is zero, the WM_BloodyDay flag is cleared.(這個計時器不是用來倒數血月何時出現的那個,先別管它。) | |||
* 更新 [[#山林霸主]] flags. | |||
=== 子夜檢查 === | |||
下面這些是子夜檢查的內容(就是每次時間從 360.0 變成 0.0 的時候做的事情)。 | |||
增加 WM_NumberOfDays(總共在遊戲裡活了幾個遊戲天)。 | |||
'''如果「血月該出現了」''' (如果 WM_BloodyDay is true): | |||
(可以看到東方有紅色滿月就是這個狀態,雙子驛站的西納巴岡會告訴你內心有股騷動。) | |||
* 如果沒辦法出現血月(下面有列原因),血月計時器會被設在 2880.0。 | |||
* 如果血月可以出現,呼叫 [https://eventviewer.zeldamods.org/viewer.html?data=/d/Demo011_0.json¶ms=1 Demo011_0] (林克林克你要小心) 然後血月計時器歸零。 | |||
'''「好久沒有血月了」''': | |||
* 如果 FirstTouchdown flag is set(出台地了)而且血月計時器 > 2520.0 (遊戲內過了整整七天,營火快轉不算): | |||
** WM_BloodyDay is set to true. 代表下個子夜檢查時就會執行上面的'''「血月該出現了」'''。 | |||
** 血月計時器歸零。 | |||
* Otherwise, the "Bloody end reserve timer" is set to 150. This ensures that the WM_BloodyDay flag is cleared 5 in-game minutes (= 5 seconds in real life) after a Blood Moon occurs. (不確定這句意思,先別管它。) | |||
==== 阻止血月的理由 ==== | |||
下面任何一件事情都會阻止血月。 | |||
請注意:即使血月被阻止,血月計時器也不會歸零,還是會繼續增加。 | |||
* Not on MainField (main overworld)(在神廟裡之類的地方) | |||
* IsInHyruleCastleArea is set(在城堡裡之類的地方)(不過實測食堂會有血月) | |||
* LastBossGanonBeastGenerateFlag is set (fighting Dark Beast Ganon)(不是在打魔獸加儂) | |||
* BloodyMoonProhibition is set | |||
* Wind_Relic_BattleStart is set (Vah Medoh battle)(不是在打瓦‧梅德) | |||
* Electric_Relic_Battle is set (Vah Naboris battle)(不是在打瓦‧娜波力斯) | |||
* Water_Relic_BattleTime is set (Vah Ruta battle)(不是在打瓦‧露塔)(咦?瓦‧魯達尼亞呢?) | |||
* SkyMgr's field_2B4 is set to 15 and field_2B8 >= 1.0(天氣很糟之類的?) | |||
請注意:即使血月被阻止,血月計時器也不會歸零,還是會繼續增加。(待在神廟裡仍然會越來越接近血月。) | |||
這些理由也不能阻止 WM_BloodyDay from being set,也就是說,「好久沒有血月了」還是會進到「血月該出現了」,只是不會真的出現。 | |||
=== 日夜標籤 === | |||
From 00:00 to 06:00 (closed interval) and from 18:00 to 00:00 (closed interval), WM_DaytimeFlag is set to false and WM_NighttimeFlag is true. | |||
In any other case, WM_DaytimeFlag is set to true and WM_NighttimeFlag to false. | |||
=== Time division, IsMorning, IsNoon, etc. === | |||
{|class="wikitable" | |||
! Start !! End !! Division !! Time type (1) !! Time type (2) | |||
|- | |||
| 04:00 || 05:00 || 0 || MorningA || Morning_A1 | |||
|- | |||
| 05:00 || 07:00 || 0 || MorningA || Morning_A2 | |||
|- | |||
| 07:00 || 10:00 || 1 || MorningB || Morning_B | |||
|- | |||
| 10:00 || 13:00 || 2 || NoonA || Noon_A | |||
|- | |||
| 13:00 || 17:00 || 3 || NoonB || Noon_B | |||
|- | |||
| 17:00 || 19:00 || 4 || EveningA || Evening_A | |||
|- | |||
| 19:00 || 21:00 || 5 || EveningB || Evening_B | |||
|- | |||
| 21:00 || 00:00 || 6 || NightA || Night_A | |||
|- | |||
| 00:00 || 04:00 || 7 || NightB || Night_B | |||
|} | |||
Note: all intervals include the start time and exclude the end time. | |||
=== 月相 === | |||
月相取決於你在遊戲裡活了幾天 (WM_NumberOfDays)。 | |||
精確的式子是 <code>(numberOfDays + x + 1) % 8</code><ref>0x71010E8200</ref> | |||
這裡的 x 在下午的時候是 1,上午的時候是 0。 | |||
百分號是模運算(除以八的餘數)。 | |||
也就是說,每過一次中午月相就前進一格。 | |||
如果有什麼東西直接設定月相的話 (例如 [[AIDef:Action/EventSetMoonType]]),那月相就會是設定過的值。 | |||
(不記得有什麼東西可以直接設定月相。) | |||
這個函數 [[AIDef:Query/WhatMoonName]] 會回傳月相。 | |||
雙子驛站的西納巴岡在內心沒有騷動的時候會告訴你今晚的月相。 | |||
請注意:月相跟血月沒有任何關係,血月不一定會在本來應該是滿月的晚上出現。 | |||
[[Category:Internals]] | |||
[[Category:Subsystems (BotW)]] |
Revision as of 00:51, 10 May 2020
World Manager (WorldMgr) 是游戏里的一个子系统。 它控制时间、血月、气候、天气、雾、风、闪电、云、山林霸主的出现等等。
这个子系统很大/复杂,它的功能被切成九个部分。
译者注:原文(英文)的写作方式是尽可能地忠实呈现游戏源代码的意图, 译者在原文外自行加入了游玩过程中累积的经验。 译者没办法理解的或翻译之后无法忠于原意的部分保留英文原文。
WorldMgr
小主管们
小主管 (Sub-managers) 由 WorldMgr::init (0x71010F43C0) 生成, and inserted into a pointer array (@WorldMgr+0x5c0). (注意以下名称不是官方名称。)
ID | Description |
---|---|
0 | TimeMgr: 时间、血月、山林霸主 |
1 | CloudPrMgr: 云 |
2 | ShootingStarMgr: 流星跟异度神剑流星 (in 1.3.3+) |
3 | WeatherMgr: Handles "rain splash" and 气候、天气 |
4 | TempMgr: 温度 [check]. |
5 | ? |
6 | SkyMgr: 天空、雾 [check]。Holds the configuration for all EnvPalettes, EnvAttributes, WeatherInfluences, Remains palettes, Indoor palettes and dungeon fogs. |
7 | DofMgr: Handles depth of field[check]. Holds depth of field related parameters. |
8 | ? |
气候
WorldMgr 本身(而不是小主管)负责处理气候那一类的事情。 气候显然是由玩家所在的位置决定的(在火山很热、在山上很冷), 有趣的是,它是用摄影机所在的位置而不是林克所在的位置来决定气候的。
TimeMgr
TimeMgr 管理所有跟时间有关的事情,例如血月何时出现,山林霸主何时出现。 游戏内时间(小时跟分钟)是一个 [0.0, 360.0] 范围内的浮点数。 0.0 代表子夜,180.0 代表中午。
TimeMgr::init
(init 代表初始化设定)
- 游戏内时间令为 78.75,早上 05:15 的意思)。
- Time for TotS environment is set to 78.75 (05:15) as well.
- "Bloody Moon end reserve timer" is set to 0.(这个计时器不是用来倒数血月何时出现的那个,先别管它。)
TimeMgr::reset
This is called whenever a stage is unloaded (essentially every time the loading screen is shown).(意思是只要读档就会呼叫这个成员函数。)
- Blood Moon checks are delayed.
- The AnimalMaster_Appearance flag is cleared.(山林霸主 flag 会被设为 false,意思是不要出现。)
TimeMgr::calc
这个函数每帧呼叫一次。
- (If field 0x14A is set to 99, WM_BloodyDay is set to true. AIDef:Action/SetBloodyMoonEnv uses this to force a Blood Moon to be scheduled. This feature appears to be unused.)(好像是没用到的功能。)
- 如果某两个过场动画 Demo103_0 and Demo997_0 还没播过的话,时间会被固定在 78.75(早上 05:15)。(那两个过场动画,前一个应该是林克走出复苏神庙环顾海拉鲁,后一个不知道。)
- 如果 AIDef:Action/AdvanceTime 或是其他什么东西强制把时间定在某个值的话(在营火旁睡觉之类的),那时间就会更新。
- #子夜检查。
- 更新时间:有几种更新的模式,大部分的时候是用模式 0。
Mode | Description |
---|---|
0 | 如果 Demo103_0 or Demo997_0 播过的话,而且不是在过场动画里的话:
整句的意思是,游戏从 5:15 开始跑,如果到 11:00 你还没启动初始之塔而且爬下来的话,游戏时间会固定在 11:00。
|
1, 13, 35 | Freeze time to 04:00 |
2, 14 | Freeze time to 05:00 |
3, 16, 36 | Freeze time to 07:00 |
4, 19, 37 | Freeze time to 10:00 |
5, 26, 39 | Freeze time to 17:00 |
6, 28, 40 | Freeze time to 19:00 |
7, 30, 41 | Freeze time to 21:00 |
8, 11 | Freeze time to 02:00 |
9, 42 | Freeze time to 00:00 |
10 | Freeze time to 01:00 |
12 | Freeze time to 03:00 |
15 | Freeze time to 06:00 |
17 | Freeze time to 08:00 |
18 | Freeze time to 09:00 |
20 | Freeze time to 11:00 |
21 | Freeze time to 12:00 |
22, 38 | Freeze time to 13:00 |
23 | Freeze time to 14:00 |
24 | Freeze time to 15:00 |
25 | Freeze time to 16:00 |
27 | Freeze time to 18:00 |
29 | Freeze time to 20:00 |
31 | Freeze time to 22:00 |
32 | Freeze time to 23:00 |
34 |
附注: 这个模式跟模式 0 不一样的地方在于血月计时器不会更新。 |
- 更新 #日夜标签,更新 #Time division, IsMorning, IsNoon, etc.
- If the "Bloody Moon end reserve timer" is non zero, decrement it. If the new value is zero, the WM_BloodyDay flag is cleared.(这个计时器不是用来倒数血月何时出现的那个,先别管它。)
- 更新 #山林霸主 flags.
子夜检查
下面这些是子夜检查的内容(就是每次时间从 360.0 变成 0.0 的时候做的事情)。
增加 WM_NumberOfDays(总共在游戏里活了几个游戏天)。
如果“血月该出现了” (如果 WM_BloodyDay is true): (可以看到东方有红色满月就是这个状态,双子驿站的西纳巴冈会告诉你内心有股骚动。)
- 如果没办法出现血月(下面有列原因),血月计时器会被设在 2880.0。
- 如果血月可以出现,呼叫 Demo011_0 (林克林克你要小心) 然后血月计时器归零。
“好久没有血月了”:
- 如果 FirstTouchdown flag is set(出台地了)而且血月计时器 > 2520.0 (游戏内过了整整七天,营火快转不算):
- WM_BloodyDay is set to true. 代表下个子夜检查时就会执行上面的“血月该出现了”。
- 血月计时器归零。
- Otherwise, the "Bloody end reserve timer" is set to 150. This ensures that the WM_BloodyDay flag is cleared 5 in-game minutes (= 5 seconds in real life) after a Blood Moon occurs. (不确定这句意思,先别管它。)
阻止血月的理由
下面任何一件事情都会阻止血月。 请注意:即使血月被阻止,血月计时器也不会归零,还是会继续增加。
- Not on MainField (main overworld)(在神庙里之类的地方)
- IsInHyruleCastleArea is set(在城堡里之类的地方)(不过实测食堂会有血月)
- LastBossGanonBeastGenerateFlag is set (fighting Dark Beast Ganon)(不是在打魔兽加侬)
- BloodyMoonProhibition is set
- Wind_Relic_BattleStart is set (Vah Medoh battle)(不是在打瓦‧梅德)
- Electric_Relic_Battle is set (Vah Naboris battle)(不是在打瓦‧娜波力斯)
- Water_Relic_BattleTime is set (Vah Ruta battle)(不是在打瓦‧露塔)(咦?瓦‧鲁达尼亚呢?)
- SkyMgr's field_2B4 is set to 15 and field_2B8 >= 1.0(天气很糟之类的?)
请注意:即使血月被阻止,血月计时器也不会归零,还是会继续增加。(待在神庙里仍然会越来越接近血月。) 这些理由也不能阻止 WM_BloodyDay from being set,也就是说,“好久没有血月了”还是会进到“血月该出现了”,只是不会真的出现。
日夜标签
From 00:00 to 06:00 (closed interval) and from 18:00 to 00:00 (closed interval), WM_DaytimeFlag is set to false and WM_NighttimeFlag is true.
In any other case, WM_DaytimeFlag is set to true and WM_NighttimeFlag to false.
Time division, IsMorning, IsNoon, etc.
Start | End | Division | Time type (1) | Time type (2) |
---|---|---|---|---|
04:00 | 05:00 | 0 | MorningA | Morning_A1 |
05:00 | 07:00 | 0 | MorningA | Morning_A2 |
07:00 | 10:00 | 1 | MorningB | Morning_B |
10:00 | 13:00 | 2 | NoonA | Noon_A |
13:00 | 17:00 | 3 | NoonB | Noon_B |
17:00 | 19:00 | 4 | EveningA | Evening_A |
19:00 | 21:00 | 5 | EveningB | Evening_B |
21:00 | 00:00 | 6 | NightA | Night_A |
00:00 | 04:00 | 7 | NightB | Night_B |
Note: all intervals include the start time and exclude the end time.
月相
月相取决于你在游戏里活了几天 (WM_NumberOfDays)。
精确的式子是 (numberOfDays + x + 1) % 8
[1]
这里的 x 在下午的时候是 1,上午的时候是 0。
百分号是模运算(除以八的余数)。
也就是说,每过一次中午月相就前进一格。
如果有什么东西直接设定月相的话 (例如 AIDef:Action/EventSetMoonType),那月相就会是设定过的值。 (不记得有什么东西可以直接设定月相。)
这个函数 AIDef:Query/WhatMoonName 会回传月相。 双子驿站的西纳巴冈在内心没有骚动的时候会告诉你今晚的月相。 请注意:月相跟血月没有任何关系,血月不一定会在本来应该是满月的晚上出现。
- ↑ 0x71010E8200