Object respawning/zh: Difference between revisions

From ZeldaMods (Breath of the Wild)
Jump to navigation Jump to search
(Created page with "== 血月重生機制 (RevivalBloodyMoon) ==")
(Created page with "血月 blood moon 是大部分武器跟敵人重生的關鍵。每次血月出現後,所有跟血月有關的 revival flags 都會被重設為預設值。")
Line 51: Line 51:
== 血月重生機制 (RevivalBloodyMoon) ==
== 血月重生機制 (RevivalBloodyMoon) ==


This policy is used for most weapons and enemies. Every time a [[blood moon]] occurs, all associated revival flags are reset to their initial value.
血月 [[blood moon]] 是大部分武器跟敵人重生的關鍵。每次血月出現後,所有跟血月有關的 revival flags 都會被重設為預設值。


Revival flags for objects under this policy have their [[ResetType]] set to 1.
Revival flags for objects under this policy have their [[ResetType]] set to 1.

Revision as of 23:47, 28 May 2020

Other languages:


曠野之息裡的材料、武器、跟敵人會在一段時間後重生。這個機制是為了防止遊戲世界變得「太空曠」。確切的重生規則取決於每種東西的特性。

GameData 裡用來追蹤每個東西應該如何重生的 flag 叫做 "revival flags"(復活標籤)。這些 revival flags 無時無刻都存在遊戲的記憶體裡,即使是相應的物件可能並不存在。

商品

商店裡賣的東西會在子夜時更新(商店會補貨),但是必須滿足下面這些條件:

  • 每件商品都會對應到一塊區域,玩家在補貨的當下不能處在個範圍內。
  • 箭類的物品只有在玩家持有少於 50 [1] 個時才會補貨。

[1.3.1+] 檢查玩家持有多少箭的函數會檢查玩家「真正的」口袋。所謂「假的」口袋則是指玩家在劍之考驗之類的特殊任務裡,物品欄會被暫時清空。換句話說,故意進入這些特殊任務不再會讓 GameDataMgr 誤以為玩家箭很少,進而補貨。

商品的 Revival flags 裡,GameDataMgr 這一項被設成 3。(意思是凡是設成 3 的物品都會根據上面講的商店的邏輯補貨。)

重生用地圖網格

上面提到的商品和另一類隨機生成的物件(下面會詳述)使用的地圖網格和正常的地圖網格有一點點不同。這裡用到的地圖網格有 10 columns (從 0 到 9)和 8 rows(從 0 到 7)。

假設一件商品(或一個隨機重生的物件)位在第 itemCol 個 column 跟第 itemRow 個 row 裡,那麼玩家「不在指定區域內」的意思是

  • itemCol < playerCol1
  • 或 itemCol > playerCol2
  • 或 itemRow < playerRow1
  • 或 itemRow > playerRow2

玩家的位置(playerCol1、playerCol2、playerRow1、playerRow2)是這樣計算的:

int col = std::clamp(((signed int)x + 5000) / 1000, 0, 9);
int row = std::clamp(((signed int)z + 4000) / 1000, 0, 7);
if ( (col + 0.5) * 1000.0 + -5000.0 >= x ) {
  *col1 = col - 1;
  *col2 = col;
} else {
  *col1 = col;
  *col2 = col + 1;
}
if ( (row + 0.5) * 1000.0 + -4000.0 >= z ) {
  *row1 = row - 1;
  *row2 = row;
} else {
  *row1 = row;
  *row2 = row + 1;
}

This grid is shown on the object map. It is also possible to show the no-revival area for an object by right clicking on it.

血月重生機制 (RevivalBloodyMoon)

血月 blood moon 是大部分武器跟敵人重生的關鍵。每次血月出現後,所有跟血月有關的 revival flags 都會被重設為預設值。

Revival flags for objects under this policy have their GameDataMgr set to 1.

Actors under the RevivalBloodyMoon policy

No automatic revival (RevivalNone)

Objects under the RevivalNone policy will not be automatically revived.

Actors under the RevivalNone policy

No drop revival (RevivalNoneForDrop)

Drops for objects under the RevivalNoneForDrop policy will not be revived. This is used for broken Guardians.

Actors under the RevivalNoneForDrop policy

No revival for use flag (RevivalNoneForUsed)

The use status for objects under the RevivalNoneForUsed policy will not be reset. This is notably used for terminals.

Actors under the RevivalNoneForUsed policy

Random revival (RevivalRandom)

Objects under the RevivalRandom policy will be revived at random times independently of blood moons. This is used for most materials (fruits, rocks, etc.)

Revival flags for objects under this policy have their GameDataMgr set to 0 and the position of the object on the main map is stored in the upper 7 bits of the initial flag value.

Actors under the RevivalRandom policy

RevivalRandom and RevivalRandomForDrop logic

Every 60 seconds[2], RadarMgr determines where the player is on the revival grid.

If the player is on AocField (Trial of the Sword):

  • Special flags (with the reset data set to 127) are skipped.
  • Any other revival flag has a 1% chance of being reset.

Otherwise:

  • If the player is on MainField, special flags have a 1% chance of being reset.
  • If the player is not on MainField, non-special flags also have a 1% chance of being reset.
  • In any other case, flags have a 1% chance of being reset, but only if the player is not in the same map area as the object that is to be revived.

Random drop revival (RevivalRandomForDrop)

Drops of objects under the RevivalRandom policy will be revived at random times independently of blood moons. This is used for wooden boxes and other things that contain materials (fruits, etc.)

Revival flags for objects under this policy have their GameDataMgr set to 0 and the position of the object on the main map is stored in the upper 7 bits of the initial flag value.

Actors under the RevivalRandomForDrop policy

Revival whenever the Lord of the Mountain appears (RevivalUnderGodTime)

Objects under the RevivalUnderGodTime policy will be revived whenever the Lord of the Mountain appears (more precisely, when the AnimalMaster_Appearance flag is set by WorldMgr).

Revival flags for objects under this policy have their GameDataMgr set to 4.

Actors under the RevivalUnderGodTime policy
  1. This is configured by ActorInfo.product.sbyml (itemSaleRevivalCount property) .
  2. Time spent in menus and cutscenes does not count