Map unit: Difference between revisions

no edit summary
imported>Leoetlino
No edit summary
imported>Leoetlino
No edit summary
Line 1: Line 1:
{{Stub|what=Complete the contents section, the link system, mention static vs dynamic (and possibly other things)}}
{{Stub|what=Complete the contents section, the link system (and possibly other things)}}
<onlyinclude>'''Map units''' contain placement data for game maps.</onlyinclude>
<onlyinclude>'''Map units''' contain placement data for game maps (e.g. MainField/A-1). In other words, they are used to configure fixed object spawns on maps for actors such as scenery and enemies for example, in contrast to the [[AutoPlacement]] system, which dynamically spawns actors.</onlyinclude>
 
== Types ==
Two types of map units exist: ''Static'' and ''Dynamic''.
 
'''Static map units''' are loaded during stage generation (see [[GameScene]] for more details). Their name is suffixed with <code>_Static</code>. They can contain both map rails and map objects; furthermore objects can be linked to each other to implement custom game logic using the [[#Link system]].
 
'''Dynamic map units''' are loaded and unloaded on-the-fly. Their name is suffixed with <code>_Dynamic</code>. The dynamic loading capability is only really put to good use for open-world type stages (e.g. MainField and AocField). In such map units, the link system cannot be used and only map objects can be specified.


== Contents ==
== Contents ==
Line 17: Line 24:


== Link system ==
== Link system ==
'''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).
'''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. This is used to implement enemy chests that only unlock after clearing an enemy camp.


LinkTags and other tag objects are lightweight actors that are used to link objects together.
LinkTags and other tag objects are lightweight actors that are used to link objects together.
Line 131: Line 138:


=== Map unit binary ===
=== 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.
In ''Breath of the Wild'', map units are stored in a binary format and given the ''mubin'' (Map Unit Binary) file extension. Map units can be found in the [[Content/Map|Map]] content directory. All map object IDs are replaced with CRC32 hashes as a space optimisation. [[BYML]] is used as the serialisation format.
 
Despite the file extension, Map/%s/Location.mubin and Map/%s/LazyTraverseList.mubin are not actually map units.


=== Source map unit ===
=== Source map unit ===
Anonymous user