Map unit: Difference between revisions

From ZeldaMods (Breath of the Wild)
Jump to navigation Jump to search
imported>Leoetlino
imported>Leoetlino
(12 intermediate revisions by 2 users not shown)
Line 16: Line 16:


== Link system ==
== Link system ==
Map objects can be linked to other objects (up to 255 in a single generation group<ref>"一つの生成グループに 255 以上のアクタが指定されています。テストで無ければプログラマに相談"</ref>). These links allow implementing custom logic and callbacks (for example, DeadUp signals the destination object when the source object dies).
'''In static map units only''', map objects can be linked to other objects (up to 255 in a single generation group<ref>"一つの生成グループに 255 以上のアクタが指定されています。テストで無ければプログラマに相談"</ref>). These links allow implementing custom logic and callbacks (for example, DeadUp signals the destination object when the source object dies).
 
LinkTags and other tag objects are lightweight actors that are used to link objects together.
 
Objects that are linked together, either directly or via indirect links, are put into the same generation group and loaded at the same time{{check}}. If the placement system fails to load an actor, the entire generation group is discarded.


===Definitions===
===Definitions===
Line 28: Line 32:
| 6 || -AxisZ || - || マイナスZ軸シグナル
| 6 || -AxisZ || - || マイナスZ軸シグナル
|-
|-
| 24 || AreaCol || - || エリア(センサ)指定
| 24 || AreaCol || Area collision (link target is an Area object) || エリア(センサ)指定
|-
|-
| 1 || AxisX || - || X軸シグナル
| 1 || AxisX || - || X軸シグナル
Line 40: Line 44:
| 38 || BAndSLimitAngYCs || - || Y角速度制限付ボール&ソケットCS
| 38 || BAndSLimitAngYCs || - || Y角速度制限付ボール&ソケットCS
|-
|-
| 0 || BasicSig || - || 基本シグナル
| 0 || BasicSig || Basic signal || 基本シグナル
|-
|-
| 9 || BasicSigOnOnly || - || オンのみ基本シグナル
| 9 || BasicSigOnOnly || Basic signal [only emits ON signals] || オンのみ基本シグナル
|-
|-
| 14 || ChangeAtnSig || - || アテンション変更時シグナル
| 14 || ChangeAtnSig || Signal on Attention change (e.g. picking up a weapon) || アテンション変更時シグナル
|-
|-
| 39 || CogWheelCs || - || 歯車CS
| 39 || CogWheelCs || - || 歯車CS
|-
|-
| 21 || CopyWaitRevival || Use the destination object's revival flag || 配置自動セーブ継承
| 21 || CopyWaitRevival || Activate links when the revival flag of the CopyWaitRevival target is set (e.g. can be used with LinkTagAnd to trigger basic signals when a chest is opened) || 配置自動セーブ継承
|-
|-
| 15 || Create || - || 生成
| 15 || Create || Create a map object. Target objects are not created unless this link is activated. || 生成
|-
|-
| 11 || DeadUp || - || 死んだらオン
| 11 || DeadUp || Signal on death || 死んだらオン
|-
|-
| 16 || Delete || - || 削除
| 16 || Delete || Delete a map object. Target objects are created and stay spawned until this link is activated. Note: the corresponding collision is disabled even for objects that have their collision data extracted to separate Static Compound files. || 削除
|-
|-
| 29 || DemoMember || - || デモ参加
| 29 || DemoMember || - || デモ参加
Line 60: Line 64:
| 32 || FixedCs || - || 固定CS
| 32 || FixedCs || - || 固定CS
|-
|-
| 26 || ForSale || - || 売り物
| 26 || ForSale || Links a shop item to its seller (target is the seller NPC). || 売り物
|-
|-
| 19 || ForbidAttention || - || アテンションタイプ変更
| 19 || ForbidAttention || Prevent attention (i.e. interacting with an object, for example picking up a weapon) || アテンションタイプ変更
|-
|-
| 18 || Freeze || - || 凍結
| 18 || Freeze || Freeze the target object || 凍結
|-
|-
| 7 || GimmickSuccess || - || ネタ成功シグナル
| 7 || GimmickSuccess || Success signal (used for minigames) || ネタ成功シグナル
|-
|-
| 33 || HingeCs || - || ヒンジCS
| 33 || HingeCs || - || ヒンジCS
|-
|-
| 12 || LifeZero || - || ライフ0
| 12 || LifeZero || Emit a LifeZero signal when the life of the source object is 0 || ライフ0
|-
|-
| 34 || LimitHingeCs || - || 制限付ヒンジCS
| 34 || LimitHingeCs || - || 制限付ヒンジCS
Line 78: Line 82:
| 17 || MtxCopyCreate || - || 位置継承生成
| 17 || MtxCopyCreate || - || 位置継承生成
|-
|-
| 22 || OffWaitRevival || - || 配置自動セーブオフ
| 22 || OffWaitRevival || Reset the revival flag of the target object || 配置自動セーブオフ
|-
|-
| 30 || PhysSystemGroup || - || 物理システムグループ
| 30 || PhysSystemGroup || - || 物理システムグループ
|-
|-
| 28 || PlacementLOD || - || 配置LOD
| 28 || PlacementLOD || Replace the source object with the link target object at lower level of details || 配置LOD
|-
|-
| 36 || PulleyCs || - || 滑車CS
| 36 || PulleyCs || - || 滑車CS
Line 88: Line 92:
| 40 || RackAndPinionCs || - || ラック&ピニオンCS
| 40 || RackAndPinionCs || - || ラック&ピニオンCS
|-
|-
| 23 || Recreate || - || 再生成
| 23 || Recreate || Recreates the target object || 再生成
|-
|-
| 41 || Reference || - || 参照
| 41 || Reference || - || 参照
|-
|-
| 10 || Remains || - || 遺物シグナル
| 10 || Remains || Divine Beast signal || 遺物シグナル
|-
|-
| 25 || SensorBind || - || センサバインド
| 25 || SensorBind || - || センサバインド
Line 102: Line 106:
| 31 || StackLink || - || スタック
| 31 || StackLink || - || スタック
|-
|-
| 20 || SyncLink || - || 生成グループ
| 20 || SyncLink || Put the destination object and any object that is linked to it into the same generation group || 生成グループ
|-
|-
| 8 || VelocityControl || - || 速度制御シグナル
| 8 || VelocityControl || Velocity control signal || 速度制御シグナル
|-
|-
|}
|}
=== Link tags ===
LinkTagAnd, LinkTagOr, LinkTagNAnd, LinkTagNOr, LinkTagXOr, LinkTagCount, LinkTagPulse, LinkTagNone are small objects that are used to implement a basic logic system in map units.
AND, OR, NAND, NOR, XOR LinkTags are boolean operators. They can be used to conditionally set or clear GameData flags, or conditionally spawn objects, trigger other objects, etc. A basic signal is emitted when the LinkTag has been triggered by ''all'' of the source links (for LinkTagAnds) or by one of them (for LinkTagOrs), etc.
Count LinkTags are used to increment a GameData flag every time the link tag itself is signalled.
Pulse LinkTags continuously emit a basic signal with a configurable signal duration (PulseLength).
None LinkTags have no effect. They are only used to put different map unit objects into the same placement generation group.
Internally, they are all implemented by the same actor class (<code>LinkTag</code>) since they share most of their core functionality, with only small differences in effects. A single link tag can only handle 0x60 incoming links<ref>0x7100D388C4</ref>. Only incoming links with defType <= 0xe are processed<ref>0x7100D389DC</ref>; other links are ignored.
Parameters are documented in [[AIDef:Action/LinkTagBaseAction#MapUnitInstParams]].


== File formats ==
== File formats ==
Line 114: Line 133:


=== Source map unit ===
=== Source map unit ===
Source map units have muunt<ref>The executable has remnants of functions that can load map units with the following path: <code>Map/Project/%s/Data/%s/%s.muunt</code> (in what appears to be development code)</ref> as their file extension and use strings for map object IDs such as <code>F-5_challenge.muunt/obj760</code> instead of CRC32 hashes of the IDs in map unit binaries.
Source map units have muunt<ref>The executable has remnants of error logging functions that print paths to development map units of the following type: <code>Map/Project/%s/Data/%s/%s.muunt</code></ref> as their file extension and use strings for map object IDs such as <code>F-5_challenge.muunt/obj760</code> instead of CRC32 hashes of the IDs in map unit binaries.
[[Category:Internals]]
[[Category:Internals]]
<references />
<references />
[[Category:File formats]]
[[Category:File formats]]

Revision as of 17:01, 12 October 2019


Contents

LocationPosX

LocationPosZ

LocationSize

Objs

Array of object structures. Must be sorted by HashId[1] because the placement subsystem performs binary searches on the object array in various cases[2].

Rails

Array of rail structures. Can only appear in group 0 maps (Static); this section is completely ignored for non-static map units.

Link system

In static map units only, map objects can be linked to other objects (up to 255 in a single generation group[3]). These links allow implementing custom logic and callbacks (for example, DeadUp signals the destination object when the source object dies).

LinkTags and other tag objects are lightweight actors that are used to link objects together.

Objects that are linked together, either directly or via indirect links, are put into the same generation group and loaded at the same time[check]. If the placement system fails to load an actor, the entire generation group is discarded.

Definitions

ID Name Description Official description
4 -AxisX - マイナスX軸シグナル
5 -AxisY - マイナスY軸シグナル
6 -AxisZ - マイナスZ軸シグナル
24 AreaCol Area collision (link target is an Area object) エリア(センサ)指定
1 AxisX - X軸シグナル
2 AxisY - Y軸シグナル
3 AxisZ - Z軸シグナル
37 BAndSCs - ボール&ソケットCS
38 BAndSLimitAngYCs - Y角速度制限付ボール&ソケットCS
0 BasicSig Basic signal 基本シグナル
9 BasicSigOnOnly Basic signal [only emits ON signals] オンのみ基本シグナル
14 ChangeAtnSig Signal on Attention change (e.g. picking up a weapon) アテンション変更時シグナル
39 CogWheelCs - 歯車CS
21 CopyWaitRevival Activate links when the revival flag of the CopyWaitRevival target is set (e.g. can be used with LinkTagAnd to trigger basic signals when a chest is opened) 配置自動セーブ継承
15 Create Create a map object. Target objects are not created unless this link is activated. 生成
11 DeadUp Signal on death 死んだらオン
16 Delete Delete a map object. Target objects are created and stay spawned until this link is activated. Note: the corresponding collision is disabled even for objects that have their collision data extracted to separate Static Compound files. 削除
29 DemoMember - デモ参加
32 FixedCs - 固定CS
26 ForSale Links a shop item to its seller (target is the seller NPC). 売り物
19 ForbidAttention Prevent attention (i.e. interacting with an object, for example picking up a weapon) アテンションタイプ変更
18 Freeze Freeze the target object 凍結
7 GimmickSuccess Success signal (used for minigames) ネタ成功シグナル
33 HingeCs - ヒンジCS
12 LifeZero Emit a LifeZero signal when the life of the source object is 0 ライフ0
34 LimitHingeCs - 制限付ヒンジCS
27 ModelBind - モデルバインド
17 MtxCopyCreate - 位置継承生成
22 OffWaitRevival Reset the revival flag of the target object 配置自動セーブオフ
30 PhysSystemGroup - 物理システムグループ
28 PlacementLOD Replace the source object with the link target object at lower level of details 配置LOD
36 PulleyCs - 滑車CS
40 RackAndPinionCs - ラック&ピニオンCS
23 Recreate Recreates the target object 再生成
41 Reference - 参照
10 Remains Divine Beast signal 遺物シグナル
25 SensorBind - センサバインド
35 SliderCs - スライダーCS
13 Stable - 安定
31 StackLink - スタック
20 SyncLink Put the destination object and any object that is linked to it into the same generation group 生成グループ
8 VelocityControl Velocity control signal 速度制御シグナル

Link tags

LinkTagAnd, LinkTagOr, LinkTagNAnd, LinkTagNOr, LinkTagXOr, LinkTagCount, LinkTagPulse, LinkTagNone are small objects that are used to implement a basic logic system in map units.

AND, OR, NAND, NOR, XOR LinkTags are boolean operators. They can be used to conditionally set or clear GameData flags, or conditionally spawn objects, trigger other objects, etc. A basic signal is emitted when the LinkTag has been triggered by all of the source links (for LinkTagAnds) or by one of them (for LinkTagOrs), etc.

Count LinkTags are used to increment a GameData flag every time the link tag itself is signalled.

Pulse LinkTags continuously emit a basic signal with a configurable signal duration (PulseLength).

None LinkTags have no effect. They are only used to put different map unit objects into the same placement generation group.

Internally, they are all implemented by the same actor class (LinkTag) since they share most of their core functionality, with only small differences in effects. A single link tag can only handle 0x60 incoming links[4]. Only incoming links with defType <= 0xe are processed[5]; other links are ignored.

Parameters are documented in AIDef:Action/LinkTagBaseAction.

File formats

Map unit binary

In Breath of the Wild, map units are stored in a binary format and given the mubin (Map Unit Binary) file extension. All map object IDs are replaced with CRC32 hashes as a space optimisation. BYML is used as the serialisation format.

Source map unit

Source map units have muunt[6] as their file extension and use strings for map object IDs such as F-5_challenge.muunt/obj760 instead of CRC32 hashes of the IDs in map unit binaries.

  1. Technically, sorting is only required for Dynamic (non-group 0) map units. However, not sorting causes the game to fall back to a slower linear search.
  2. 0x7101256E14
  3. "一つの生成グループに 255 以上のアクタが指定されています。テストで無ければプログラマに相談"
  4. 0x7100D388C4
  5. 0x7100D389DC
  6. The executable has remnants of error logging functions that print paths to development map units of the following type: Map/Project/%s/Data/%s/%s.muunt