Help:Creating mods: Difference between revisions

From ZeldaMods (Breath of the Wild)
Jump to navigation Jump to search
imported>BravelyPeculiar
mNo edit summary
(Fix some weird things from my last edit.)
 
(5 intermediate revisions by 5 users not shown)
Line 3: Line 3:
== What can currently be modded? ==
== What can currently be modded? ==


* Textures (can't increase resolution)
* Textures
* Models (can't increase poly count on Switch)
* Models
* Actor parameters, including enemies, weapons and armors
* Actor parameters, including enemies, weapons, and armors
* Adding new actors
* Adding new actors
* Overworld and dungeon map files (but collision editing is mostly not doable yet)
* Overworld and dungeon map files
* Event flows, and as a direct consequence: cutscenes, NPC interactions, quests, minigames, etc.
* Animations and various animation parameter files
* Rigid body collisions
* Text / dialogue
* Text / dialogue
* Event flows, and as a direct consequence: cutscenes, NPC interactions, quests and minigames
* UI elements (HUD, title screen, logos, etc.)
* Music and audio (cannot add new tracks, only edit/replace existing)
* Effects and shaders (limited)


== Getting set up ==
== Getting set up ==
Line 24: Line 29:
}}
}}


== Rules ==
== About BNPs ==
 
Modding has come a long way, and creating them has never been easier with BCML and the BNP (BOTW Nano Patch) format.
 
BNPs are a crucial part of modding Breath of the Wild, as they allow for small package distribution and accurate merging when used with BCML.
 
For more information on BNPs, check out [https://github.com/Torphedo/BOTW-ModdingGuide/blob/main/BCML-development.md this detailed guide] by Torphedo.
 
=== Creating BNPs ===
BNPs can be made using the BCML BNP Creator in the Dev Tools tab.
 
The BNP Creator requires two fields to create a BNP, a name, and a mod folder.
 
<br>
 
==== Name ====
The name can be anything you choose, usually something that tells people what the mod is.<br>
Example: "Invisible Majora's Mask" implies that it makes Majora's mask invisible, which it does.
 
<br>
 
==== Mod Folder ====
The mod folder is the <i>contents</i> of the mod. This folder requires at least one of the following folders (case sensitive):
<ul>
<li><u>content</u>: Holds general content such as game models, effects, sounds, etc. (WiiU)</li>
<li><u>aoc</u>: Has similar files as <u>content</u>, but this folder overwrites the DLC files instead of the base-game/update ones.</li>
<li><u>01007EF00011E000/romfs</u>: This is the Switch equivalent of content.</li>
<li><u>01007EF00011F001/romfs</u>: This is the Switch equivalent of aoc.</li>
<li><u>patches</u>: Is used to load code patches with BCML. More info on code patches is available on [https://github.com/Torphedo/BOTW-ModdingGuide/blob/main/Code-BNPs.md Torphs GitHub].</li>
</ul>
 
<br>
 
The mod folder can also contain these other files/folders (case sensitive):
<ul>
<li><u>logs</u>: Contains BCML log files; these should not be edited and are only for BCML to read/write.</li>
<li><u>options</u>: Can be used to add sub-mods as selectable options to your final mod.</li>
<li><u>info.json</u>: Holds the mods meta-data; BCML will create this automatically when you make a BNP.</li>
</ul>
 
<br>
 
Here's an example mod structure that edits the Bear model, Master Sword effects, and the map section A-2.<br>
In this case, we would point BCML to the <code style="background: #E6E4E4; border-radius: 5px;">Mod Folder</code> folder.
 
<br>
 
===== WiiU/Cemu =====
Mod Folder/
├── content/
│  ├── Model/
│  │  └── Animal_Bear.sbfres
│  └── Effect/
│      └── Weapon_Sword_070.seselist
├── aoc/
│  └── 0010/
│      └── Map/
│          └── MainField/
│              └── A-2/
│                  └── A-2_Dynamic.smubin
└── info.json
 
<br>
 
===== Switch/Yuzu =====
Mod Folder/
├── 01007EF00011E000/
│  └── romfs/
│      ├── Model/
│      │  └── Animal_Bear.sbfres
│      └── Effect/
│          └── Weapon_Sword_070.seselist
├── 01007EF00011F001/
│  └── romfs/
│      └── Map/
│          └── MainField/
│              └── A-2/
│                  └── A-2_Dynamic.smubin
└── info.json
 
If you're unsure where a file should go in your mod folder, look at where it is in the game files, use the reletive path to find out where it should go in your mod.
 
For example, the WiiU game file <code style="background: #E6E4E4; border-radius: 5px;">UpdateDump/content/Model/Animal_Bear.sbfres</code> would go in <code style="background: #E6E4E4; border-radius: 5px;>ModFolder/content/Model/Animal_Bear.sbfres</code>; when this mod is loaded, Animal_Bear.sbfres will be overwritten by the file in your mod.
 
<br>
 
==== Other/Misc ====
Everything else in the BNP Creator is pretty straightforward, but just in case you don't understand something, here's a brief on each optional field.<br>
 
<ul>
<li>Image | A direct HTTP link to an image file or a path relative to the root of your mod folder. For example, image.png will try to load a file named image.png in your Mod Folder.</li>
<li>URL | An HTTP link to your mod page.</li>
<li>Version | The current version of your mod.</li>
<li>Description | An extended description of your mod. (Markdown text is supported)</li>
<li>Dependencies | A list of mods required for this mod.</li>
<li>Options | A list of options in the mod.</li>
</ul>
 
<br>
 
==== Create It ====
Once you have filled out all the fields you need for your mod, click the Create BNP button in the bottom right.
 
You will get prompted to save a BNP file; save it where you like. But be careful not to store it in the Mod Folder beside content, aoc, etc. It will get added to the BNP the next time you build it.
 
<br>
 
== Modding Rules ==


=== The RSTB file ===
=== The RSTB file ===
<b style="color: #D11448"><u>Note</u>: Manual RSTB editing is not required when using BCML</b><br>
The file [[ResourceSizeTable.product.rsizetable]] (referred to as the RSTB file) contains a list of size limits for almost every file in the game (calculated from the non-Yaz0-compressed file sizes). If you edit a file to make its filesize bigger, you'll need to edit this file to prevent errors. For details, see [[Help:Updating the RSTB]].
The file [[ResourceSizeTable.product.rsizetable]] (referred to as the RSTB file) contains a list of size limits for almost every file in the game (calculated from the non-Yaz0-compressed file sizes). If you edit a file to make its filesize bigger, you'll need to edit this file to prevent errors. For details, see [[Help:Updating the RSTB]].


=== File names and caching ===
=== File names and caching ===
The game assumes that any 2 files with the exact same filename also have the exact same contents. If you don't follow this rule when editing files, the game might load the wrong version of the file, leading to errors. The same rule applies to texture names - all unique textures should have unique names, even if they're located in different files.
The game assumes that any files with the same filename also have the same contents. If you don't follow this rule when editing files, the game might load the wrong version of the file, leading to errors. The same rule applies to texture names - all unique textures should have unique names, even if they're located in different files.


=== File extensions for compressed resources ===
=== File extensions for compressed resources ===
In most cases, file extensions that start with ".s" are used for [[Yaz0]]-compressed files. Ensure that any file with such extensions is compressed. Some tools (for example {{ltool|BotW Unpacker}}, {{ltool|byml-v2}} or {{ltool|sarc}}) will automatically compress files when needed.


Example: .bactorpack -> .sbactorpack (after compression)
In most cases, file extensions that start with <code style="background: #E6E4E4; border-radius: 5px;">.s</code> are expected to be [[Yaz0]]-compressed files. Ensure that any file with such extensions is compressed. Most tools will automatically compress files when needed.
 
Example: <code style="background: #E6E4E4; border-radius: 5px;">.bactorpack</code> -> <code style="background: #E6E4E4; border-radius: 5px;">.sbactorpack</code> (after compression)
 
=== Edit priority ===
If a file exists in your <u>update dump</u>, edit that copy of it.<br>
If it doesn't exist there, edit the one in your <u>DLC dump</u>.<br>
If it doesn't exist in either the update files or the DLC files, edit the one from the base <u>game dump</u>.

Latest revision as of 00:16, 22 August 2022

Welcome, modders! This page contains useful information for anybody who wants to create mods. If you just want to use other people's mods, see Help:Using mods.

What can currently be modded?

  • Textures
  • Models
  • Actor parameters, including enemies, weapons, and armors
  • Adding new actors
  • Overworld and dungeon map files
  • Event flows, and as a direct consequence: cutscenes, NPC interactions, quests, minigames, etc.
  • Animations and various animation parameter files
  • Rigid body collisions
  • Text / dialogue
  • UI elements (HUD, title screen, logos, etc.)
  • Music and audio (cannot add new tracks, only edit/replace existing)
  • Effects and shaders (limited)

Getting set up


About BNPs

Modding has come a long way, and creating them has never been easier with BCML and the BNP (BOTW Nano Patch) format.

BNPs are a crucial part of modding Breath of the Wild, as they allow for small package distribution and accurate merging when used with BCML.

For more information on BNPs, check out this detailed guide by Torphedo.

Creating BNPs

BNPs can be made using the BCML BNP Creator in the Dev Tools tab.

The BNP Creator requires two fields to create a BNP, a name, and a mod folder.


Name

The name can be anything you choose, usually something that tells people what the mod is.
Example: "Invisible Majora's Mask" implies that it makes Majora's mask invisible, which it does.


Mod Folder

The mod folder is the contents of the mod. This folder requires at least one of the following folders (case sensitive):

  • content: Holds general content such as game models, effects, sounds, etc. (WiiU)
  • aoc: Has similar files as content, but this folder overwrites the DLC files instead of the base-game/update ones.
  • 01007EF00011E000/romfs: This is the Switch equivalent of content.
  • 01007EF00011F001/romfs: This is the Switch equivalent of aoc.
  • patches: Is used to load code patches with BCML. More info on code patches is available on Torphs GitHub.


The mod folder can also contain these other files/folders (case sensitive):

  • logs: Contains BCML log files; these should not be edited and are only for BCML to read/write.
  • options: Can be used to add sub-mods as selectable options to your final mod.
  • info.json: Holds the mods meta-data; BCML will create this automatically when you make a BNP.


Here's an example mod structure that edits the Bear model, Master Sword effects, and the map section A-2.
In this case, we would point BCML to the Mod Folder folder.


WiiU/Cemu
Mod Folder/
├── content/
│   ├── Model/
│   │   └── Animal_Bear.sbfres
│   └── Effect/
│       └── Weapon_Sword_070.seselist
├── aoc/
│   └── 0010/
│       └── Map/
│           └── MainField/
│               └── A-2/
│                   └── A-2_Dynamic.smubin
└── info.json


Switch/Yuzu
Mod Folder/
├── 01007EF00011E000/
│   └── romfs/
│       ├── Model/
│       │   └── Animal_Bear.sbfres
│       └── Effect/
│           └── Weapon_Sword_070.seselist
├── 01007EF00011F001/
│   └── romfs/
│       └── Map/
│           └── MainField/
│               └── A-2/
│                   └── A-2_Dynamic.smubin
└── info.json

If you're unsure where a file should go in your mod folder, look at where it is in the game files, use the reletive path to find out where it should go in your mod.

For example, the WiiU game file UpdateDump/content/Model/Animal_Bear.sbfres would go in ModFolder/content/Model/Animal_Bear.sbfres; when this mod is loaded, Animal_Bear.sbfres will be overwritten by the file in your mod.


Other/Misc

Everything else in the BNP Creator is pretty straightforward, but just in case you don't understand something, here's a brief on each optional field.

  • Image | A direct HTTP link to an image file or a path relative to the root of your mod folder. For example, image.png will try to load a file named image.png in your Mod Folder.
  • URL | An HTTP link to your mod page.
  • Version | The current version of your mod.
  • Description | An extended description of your mod. (Markdown text is supported)
  • Dependencies | A list of mods required for this mod.
  • Options | A list of options in the mod.


Create It

Once you have filled out all the fields you need for your mod, click the Create BNP button in the bottom right.

You will get prompted to save a BNP file; save it where you like. But be careful not to store it in the Mod Folder beside content, aoc, etc. It will get added to the BNP the next time you build it.


Modding Rules

The RSTB file

Note: Manual RSTB editing is not required when using BCML
The file ResourceSizeTable.product.rsizetable (referred to as the RSTB file) contains a list of size limits for almost every file in the game (calculated from the non-Yaz0-compressed file sizes). If you edit a file to make its filesize bigger, you'll need to edit this file to prevent errors. For details, see Help:Updating the RSTB.

File names and caching

The game assumes that any files with the same filename also have the same contents. If you don't follow this rule when editing files, the game might load the wrong version of the file, leading to errors. The same rule applies to texture names - all unique textures should have unique names, even if they're located in different files.

File extensions for compressed resources

In most cases, file extensions that start with .s are expected to be Yaz0-compressed files. Ensure that any file with such extensions is compressed. Most tools will automatically compress files when needed.

Example: .bactorpack -> .sbactorpack (after compression)

Edit priority

If a file exists in your update dump, edit that copy of it.
If it doesn't exist there, edit the one in your DLC dump.
If it doesn't exist in either the update files or the DLC files, edit the one from the base game dump.