Skip to content

WindViewer, Archives, and You

LordNed edited this page Jan 15, 2014 · 2 revisions

[Note: This is a tentative spec/work plan. This is mostly me getting the ideas written down as a form of validating them and is not how it actually behaves at the moment.]

Nintendo's framework supports the .rarc/.arc file format and it is used across many of their games. It is very similar in functionality to a *.zip file. These files can support compression (via yaz0 compression) or uncompressed. The game can load both without issues.

Because these Archives function in a manner similar to *.zip files, the first thing WindViewer does upon opening an archive is extract it to your Working Directory (By default: My Documents\WindViewer...?). It re-creates the folder structure found inside an archive and places the individual files inside their respective folders. Example Folder Structure:

MiniHyo
-Room0
--bdl
---model.bdl
---model3.bdl  
--btk
---model.btk
--dzb
---room.dzb
--dzr
---room.dzr

Once WindViewer has extracted the contents from the *.arc, the archive is no longer kept in WindViewer's memory. Instead, it is replaced by meta-data that describes the data and holds references to it. This is the ZData structure which represents the "MiniHyo" level of data (as described above). Within it, it holds a reference to each file (model.bdl, model.btk, room.dzb, room.dzr, etc.). Each file is loaded from disk and is stored in the ZData structure.

Once the file is in the ZData structure we can now add/remove/modify the data to our hearts content. When the current working project is saved (File->Save) we read the list of loaded ZData's and write them out to disk (inside the working directory). It is only upon File->Export that we take a loaded ZData and export out a brand new *.arc that has been created from scratch which can be placed in the Game's Data and played!