<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>unity &#8211; Saki&#039;s Romhacking Shenanigans</title>
	<atom:link href="https://sakimotor.github.io/tag/unity/feed/" rel="self" type="application/rss+xml" />
	<link>https://sakimotor.github.io</link>
	<description>It is what it is!</description>
	<lastBuildDate>Mon, 30 Jan 2023 18:44:31 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.2.2</generator>
	<item>
		<title>Modding The Silver Case (Part 2): Extracting &#038; Repacking</title>
		<link>https://sakimotor.github.io/2023/01/28/modding-the-silver-case-part-2-extracting-repacking/</link>
					<comments>https://sakimotor.github.io/2023/01/28/modding-the-silver-case-part-2-extracting-repacking/#disqus_thread</comments>
		
		<dc:creator><![CDATA[sakicore]]></dc:creator>
		<pubDate>Sat, 28 Jan 2023 01:28:01 +0000</pubDate>
				<category><![CDATA[Modding]]></category>
		<category><![CDATA[Repacking]]></category>
		<category><![CDATA[archive]]></category>
		<category><![CDATA[ps4]]></category>
		<category><![CDATA[psarc]]></category>
		<category><![CDATA[unity]]></category>
		<guid isPermaLink="false">https://sakimotor.github.io/?p=40</guid>

					<description><![CDATA[In this post, I will explain how to work with the (not so) niche and proprietary .PSARC archive format, as well as the (even less) niche and proprietary Unity .assets archive format.]]></description>
										<content:encoded><![CDATA[
<p>Our <a href="https://sakimotor.github.io/2023/01/26/modding-the-silver-case-ps4-part-1-dumping-reinstalling/" data-type="post" data-id="23">previous </a>post explained how to prepare a game for modding. Today, it&#8217;s about time we do the actual modding part!</p>



<p></p>



<p>The game was made with <strong>Unity</strong>. As such, its mostly comprised of .assets files, just like the PC version, with one particularity: the heaviest (and most important) assets have been compressed within a <strong>.psarc</strong> archive, a proprietary format used by Sony games since the <em>PS3 </em>era.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full is-resized"><img decoding="async" src="https://sakimotor.github.io/wp-content/uploads/2023/01/EqA99JfXIAAxS2p.png" alt="" class="wp-image-45" width="686" height="373"/></figure></div>

<div class="wp-block-image">
<figure class="aligncenter size-full is-resized"><img decoding="async" src="https://sakimotor.github.io/wp-content/uploads/2023/01/EqA-SheXUAQCh0x.png" alt="" class="wp-image-46" width="688" height="433"/><figcaption class="wp-element-caption"><em>General folder layout. The &#8220;Media&#8221; folder contains some .assets files, as well as a &#8220;StreamingAssets&#8221; folder which contains the game&#8217;s videos as .MP4s</em>.</figcaption></figure></div>


<p></p>



<p>In 2020, I used a tool named <strong><a href="https://github.com/IcySon55/Kuriimu/releases" data-type="URL" data-id="https://github.com/IcySon55/Kuriimu/releases">Karameru</a> </strong>to extract the .<em>psarc</em> archives. This time I used <a href="http://richwhitehouse.com/index.php?content=inc_projects.php&amp;showproject=91"><strong>Noesis</strong></a>, a tool widely-used to preview 3D models from different formats, but also for extracting some types of archives, which <em>.psarc</em> is part of.</p>



<figure class="wp-block-image size-full"><img decoding="async" width="1428" height="632" src="https://sakimotor.github.io/wp-content/uploads/2023/01/Noesis64_yrB110L5Mw.png" alt="" class="wp-image-48"/><figcaption class="wp-element-caption"><em>Right-clicking on the archive and selecting &#8220;Export&#8221; allows us to extract it wherever we want.</em></figcaption></figure>



<p></p>



<p>Once the archive is extracted, we can treat its contents like a usual <em>Unity </em>game folder. Unfortunately, this means more extracting and repacking but it won&#8217;t be a problem, as this time we have the whole Unity modding community behind our back!</p>



<p> My favorite tool for extracting <em>Unity .assets</em> files is <a href="https://github.com/Perfare/AssetStudio" data-type="URL" data-id="https://github.com/Perfare/AssetStudio"><strong>AssetStudio</strong></a>, a software that has been faithful to me since 2019, when I first used it on the <em>PC </em>version of the game. It&#8217;s very easy of use for previewing and extracting the contents within the archives, but it unfortunately does not support reimporting/repacking.</p>



<figure class="wp-block-image size-full"><img decoding="async" width="1920" height="1040" src="https://sakimotor.github.io/wp-content/uploads/2023/01/image.png" alt="" class="wp-image-51"/><figcaption class="wp-element-caption"><em>When we use the &#8220;Load folder&#8221; option on our extracted archive, we can see all the TextAsset (JSON messages) and Texture2D (image textures) we need to replace. We can extract them by using the &#8220;Export&#8221; option</em>.</figcaption></figure>



<p></p>



<p>Once the files we want are extracted, we can edit them to our leisure. I won&#8217;t elaborate much on this part, but one thing I can say is that <em>AssetStudio </em>does its best to convert the assets into commonly-used formats: <em>.txt/.json</em> files for the <em>TextAsset </em>files, <em>.png</em> files for the <em>Texture2D</em> ones,  <em>.wav </em>for the <em>AudioClip</em>&#8230; Surely, we won&#8217;t have much research works to find software able to work with these file formats!</p>



<p>Anyway, after editing the extracted filed to our will, we will reimport them with a russian tool called <strong><a href="https://www.dropbox.com/s/j0dyaqogc7w2gbn/UnityEX_Advanced.rar" data-type="URL" data-id="https://www.dropbox.com/s/j0dyaqogc7w2gbn/UnityEX_Advanced.rar">UnityEX</a> </strong>(<a href="https://disk.yandex.ru/d/C7Vzo44UDXiq-w" data-type="URL" data-id="https://disk.yandex.ru/d/C7Vzo44UDXiq-w">YandexDisk</a> mirror). Just like <em>AssetStudio</em>, it&#8217;s a tool I got familiar with in 2019, when I worked with the <em>PC </em>version. It has been helpful enough for me to donate to its developer in order to get all the features of the program, such as the <em>Unity </em>2020-2021 support (more on that on the official forum <a href="https://forum.zoneofgames.ru/topic/36240-unityex/" data-type="URL" data-id="https://forum.zoneofgames.ru/topic/36240-unityex/">thread</a>), but we can work with the freeware version as well, since the game has been compiled with <em>Unity</em>&#8216;s 2016-2017 SDK!</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img decoding="async" width="883" height="761" src="https://sakimotor.github.io/wp-content/uploads/2023/01/image-2.png" alt="" class="wp-image-53"/><figcaption class="wp-element-caption"><em>UnityEX in action on the game&#8217;s &#8220;resources.assets&#8221; archive.</em></figcaption></figure></div>


<p>Unlike <em>AssetStudio</em>, <em>UnityEX</em> only opens one file at a time, which doesn&#8217;t matter since all the content we need is stored within the <em>resources.assets</em> file. When we open an archive within UnityEX, we can extract the files by right-clicking them, then by pressing &#8220;Extract with convert or Raw&#8221;: this will convert a file to a more common extension if it&#8217;s known (like <em>AssetStudio</em> does), or leave it as-is. </p>


<div class="wp-block-image">
<figure class="aligncenter size-full is-resized"><img decoding="async" src="https://sakimotor.github.io/wp-content/uploads/2023/01/image-1.png" alt="" class="wp-image-52" width="665" height="695"/><figcaption class="wp-element-caption"><em>The extracted files go to a new folder named &#8220;<em>Unity_Assets_Files</em>&#8220;, which will contain another folder bearing the same name as our <em>.assets</em> file, in this case <em>resources</em>.</em></figcaption></figure></div>


<p>By hitting the &#8220;<em>Import all files&#8221;</em> button in <em>UnityEX</em>, the program will look all the files from the folder mentioned above, compare the filenames to the ones within the opened <em>.assets </em>archive, then replace each matching occurence. Any <em>.png</em> file is automatically converted into a <em>.tex Texture2D</em> file, then reinserted in the archive. If the program finds a filename that doesn&#8217;t correspond to anything in the archive, it will give a warning and askip if we want to continue anyway. </p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img decoding="async" width="883" height="761" src="https://sakimotor.github.io/wp-content/uploads/2023/01/image-3.png" alt="" class="wp-image-54"/><figcaption class="wp-element-caption"><em>You might not see the difference, but the green bar being halfway through is a sign of the importing process being in progress.</em></figcaption></figure></div>


<p>Now that the <em>resources.assets</em> has been edited, it&#8217;s time to do the whole process&#8230; Backwards! First, we need to  repack the folder containing the extracted <em>.assets</em> files back to a .psarc file. This time, instead of <em>Karameru</em>,  I used <a href="https://www.ghisler.com/">Total Commander</a>, a freeware file manager which had the benefit of supporting <em>.psarc </em>repacking thanks to a third-party <a href="http://totalcmd.net/plugring/PSARC.html">plugin</a> by <em>BEKETATA</em>.</p>



<figure class="wp-block-image size-full"><img decoding="async" width="569" height="410" src="https://sakimotor.github.io/wp-content/uploads/2023/01/TOTALCMD64_5EmDLZpBdO.png" alt="" class="wp-image-55"/><figcaption class="wp-element-caption"><em>Right-clicking on the folder, then clicking &#8220;File &gt; Pack&#8230;&#8221; does the trick.</em></figcaption></figure>



<p></p>



<p>And&#8230; that&#8217;s it! Now, we have our modded <em>archive.psarc</em> file, ready to get inserted back into the game. As there are multiple ways of doing that, which both take a fair amount of time and dedication, I will document them in a final post, one that will get more focused on the <em>PS4</em>-side manipulation than the <em>PC</em> one.</p>



<figure class="wp-block-image size-full"><img decoding="async" width="603" height="66" src="https://sakimotor.github.io/wp-content/uploads/2023/01/explorer_SMSLQwpTbO.png" alt="" class="wp-image-56"/><figcaption class="wp-element-caption"><em>Our custom videos folder, as well as our modded archive, are ready to go. The archive_og.psarc file is a mere emergency backup.</em></figcaption></figure>
]]></content:encoded>
					
					<wfw:commentRss>https://sakimotor.github.io/2023/01/28/modding-the-silver-case-part-2-extracting-repacking/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
