Edit

How to get custom sounds in Unity Games?


TA-30 Compass retextured to show a tired emoji instead of a bsod on a screen inside its canopy

Have you ever wanted custom sounds in Nuclear Option, like the F-14 missile warning sound to play when a SARH is flying at you, instead of the default annoying beep? Let me show you how.

Part 1: Download all needed parts


You will need these programs:

  • Unity 2022.3.12f1 Download it here
    • You’ll need unity to create your own resource files, which you can then use to replace the current sounds in your unity game.
  • UABEAvalonia Download it here
    • You’ll need UABEA to edit asset files of nuclear option, or any other unity game. This allows you to link a given asset to a different resource.

To install Unity, follow the download link, then simply press “Unity Editor Windows”, or whatever operating system you are using. After downloading, unity will install Unity Hub, which will require you to create an account, and then download the actual unity editor. After all this is done, Unity is installed.

To install UABEA, follow the download link, scroll a bit down, and click on a file that says uabea-windows.zip or anything similar. You will need a program like 7-zip or WinRAR to extract this zip. Make a new folder on your desktop, name it however you want, and then drag all the files from inside the zip into the folder.

Part 2: Scope out your files using UABEA


Open Nuclear Option’s game files

Open Steam. Click “Library” on the toolbar, and then search for nuclear option (or any other unity game) on the left panel. Right click it, and press “Browse Local Files”. When a file explorer window opens, open the folder 📂NuclearOption_data. Then, right-click the address bar at the top of file explorer, and click “Copy address as text”.

    tutorial pic showing how to open local game files in Steam

Start UABEA and open the asset file

  1. Go into the folder with the extracted UABEA files from the previous part. Double-click the file named UABEAvalonia.exe, which should have a white and pink icon.
  2. Click on “File”, and open. Now, click on the empty part of the address bar, and paste in the path which you copied in the previous step, then press enter.
  3. Search for a 📁resources.assets file. Double click it.

A new window should be opened, which lists all the resources in the game.

    tutorial showing how to open an assets file in UABE

Look for files of interest.

  1. Click on the “Type” column, which will sort all the files by type. This will help you find AudioClips;
  2. Now, find them by names! You need to do some guessing, for example, missile warning is of course going to be called missileWarning, but some names might be less intuitive.If you wanna quickly preview the assets, you can use AssetRipper, which allows you to view them live and export them. (you can only view, not modify assets with AssetRipper)
  3. Check if they’re the files you’re intending to replace, and note their names.

Part 3: Make your replacement assets in Unity


  1. Open Unity Hub. Go into Projects and press “New Project”. Make sure to select 3D (Core). Name it whatever, and select a unity cloud organization. Feel free to uncheck Connect to Unity Cloud, so your game isn’t backed up to the cloud.
    tutorial showing how to create a new project in Unity Once your editor opens, you will see several panels. Take note of the Project/Assets panel at the bottom.
  2. Drag your audio files into the bottom file panel. Make sure to name them exactly as they are named in the asset files, so you can overwrite them.
  3. From the bottom panel, drag the files to your scene.
    tutorial showing how to import audio files into unity and drag them onto the scene
  4. After this is done, save and compile your game. Go into File > Build Settings, Select Windows as the target platform, and press “Build”. A folder picker window will open, create a new folder and name it anything you want, like builds, and select that folder.

The game and its assets will now build into that folder.

Part 4: Create dumps


Look in the folder you just created, and compiled into. There should be a gameName_data folder. Open it. Your files of interest are 📂sharedassets0.assets, and 📂shareassets0.resource. The .assets file stores the references to resources, the .resource file stores the actual resources (audio files).

  1. Using UABEA, open the 📂sharedassets0.assets file. Find the resources you want to export, and on the right side, press “Export Dump”. You can choose whether to export the dump as .json or as .txt
    tutorial showing how to export dumps of assets in UABEA
  2. Since there is already a sharedassets0.resource file in Nuclear Option’s data, rename it to anything you want, like ResourcePack.resource or just like mash your keyboard.
  3. Open the dumps in a text editor. You will need to edit the m_Source field to have the name of your .resource file, which you just renamed in the last step.
    tutorial showing how to modify an exported UABEA dump to point to the correct resource file

Part 5: Modify Nuclear Option’s asset files.


Now you’ll need to modify Nuclear Option’s 📂resources.assets file, so the resources point to your custom resources, in your custom .resource file.

  1. Drag your custom .resource file into 📂NuclearOption_data
  2. Create a backup of your resources.assets file. Copy and paste it to make a copy, in case you mess stuff up (you will).tutorial showing how to copy my custom resource file and how to create a backup of the asset file
  3. Open the 📂resources.assets file in UABEA again. Find the assets you need to replace. Press on it, press “Import Dump”, choose whether you are importing .json or .txt, and import.Make sure you have edited the asset names and asset source before importing them into UABEA, as using “Edit Data” in the program likes to mess up the assets.
  4. Save the assets file by doing File > Save.


And there you have it! A custom sound inside of Nuclear Option!