Audio Import Settings – Cheat Sheet

1 Introduction

This document is intended to be a quick reference sheet when working on audio within a mobile project. Different platforms will have different requirements, though some things (like general practices) stay the same across platforms. This document assumes the project is a mobile project.

2 The File

  • File type: Native (WAV) for SFX, .ogg (Ogg Vorbis) for music
  • Sample Rate: 22050Hz
  • Stereo/Mono: Mono as often as possible.

    Some files need to be in stereo (and that’s okay!) but phone speakers aren’t very good, and using stereo on most sound files will be a waste of resources. Use the qualities of the Audio Source within unity if you need to create panning effects etc.

3 Import Settings

Bad import settings are a huge killer for a project’s performance. Don’t underestimate audio’s impact on your game’s performance.

3.1 Load In Background / Preload Audio Data

Load in background is an asynchronous loading method which allows you to load sound files into the scene outside of the main loop. This can help if you’re loading tons of audio clips at the same time.

Preload audio data loads the audio data before the first Awake call in your scene.  You can’t unload this file if you preload it.

Use these when it fits the frequency you use the sound, how many sound clips you’re loading, etc etc. If in doubt, just leave both without the tick.

3.2 Music

audio1

  • Load Type: Streaming or Compressed in memory.

    Streaming requires very little memory, but requires a little more CPU power and uses disk I/O throughout. NOTE: ONLY USE STREAMING FOR ONE AUDIO FILE IN THE SCENE, OR PERFORMANCE DROPS WILL HAPPEN!

    Compressed in memory replaces the need for using disk I/O, but has a memory cost. Reduce the Sound Quality to around 70% if you use this option.
  • Compression Format: Vorbis.

3.3 Small SFX

Around 1 – 3 seconds long SFX.

3.3.1 Played Frequently

audio2

If the SFX is played frequently, use the following import settings:

  • Load Type: Decompress on load
  • Compression Format: PCM or ADPCM. PCM requires no decompression and is therefore faster, ADCPM requires decompression.

3.3.2 Played Infrequently

audio3

If the SFX is played infrequently, use the following import settings:

  • Load Type: Compressed in memory
  • Compression Format: ADPCM. ADPCM is about 3.5 times smaller than PCM, and requires less CPU power to decompress.

3.4 Medium SFX

Around 3 – 8 seconds long SFX.

3.4.1 Played Frequently

audio3

If the SFX is played frequently, use the following import settings:

  • Load Type: Compressed in memory
  • Compression Format: ADPCM. ADPCM is about 3.5 times smaller than PCM, and requires less CPU power to decompress.

3.4.2 Played Infrequently

audio4

If the SFX is played infrequently, use the following import settings:

  • Load Type: Compressed in memory
  • Compression Format: Vorbis. File might be too long and played too infrequently to warrant ADPCM, so the additional CPU power to decompress isn’t that big of an issue.

Updating a game to C16.4

This process follows the same for updating a game to C16.2.2.

This code contains (C16.2.1/2 + Ads Cascades System + X code Games[new prefabs])

Pre-requisite

  1. Create roll back apk before doing the update. (+2 on the BVC of the live version)/(+1 on the BVC of the current update) and upload it in the corporate dropbox, folder name 7-Rollback APKs.
  2. Old project folder for game.
  3. Exporter package (varies for the version of your game)
  4. For X code games, check this document to see changes for the game. (refer to this link for game changes – 3D Prefabs Team doc)

What exporter version to use:

1.0.8 version – this version is applicable to games that are currently on C16 and the ones on E.1.11 and C10 codes (Pre-C16 Games).

1-1

Branch off of the latest version – Latest branch is called C16.4

screenshot_111516_030109_am

 

Open GitHub Desktop, and switch to the branch that has the features you are updating to. At the time of writing, you’d want the “C16.4” branch but your task instructions should tell you which branch to use. If you aren’t certain, ask. Switch to it and sync up to the latest version of the branch.

Install Enemy Exporter

If the game you’re updating has the last data in the 9-App Asset Packages folder in the corporate dropbox, use that instead and skip this step.

Export the Exporter

Open the new project in the appropriate version of Unity. C16 projects are designed to be used with Unity 5.3.1p2. (If you use a different version, it causes problems.)

New, in Export v1.0.8. From the menu, choose Tools -> Enemy Exporter -> Create Exporter Package and then choose to create a package for C16 games, or for earlier (C10, E11) games.

new_version_of_tools

(Previously, you’d choose Tools -> Enemy Exporter -> Advanced -> Create Enemy Exporter Package, and it would create a package that didn’t work for updating C16-style games.)

You’ll be asked to save it. By default, it’ll use the exporter’s version, the version of the game the exporter works for, and save to your Desktop.

save_enemy_exporter_package_and_menu_unity_-_fps-c11_0_0_-_android__opengl_4_1_

Import The Exporter

Now, import the exporter into your older project.  compiling_indicator[How To Import]

This import contains a lot of scripts (and nothing else).

It’ll recompile for a bit. Unity tells you it is recompiling by showing a spinning circle in the bottom-right corner.

After it recompiles, you’ll have Tools -> Enemy Export in your menus.

Understanding What The Exporter Does

This page is optional, but I advise looking at the ‘Notes’ section.

It may be useful to understand what the exporter does.

exporter_detailsWhen exporting, it:

  • Saves the bundle ID, company name, etc
  • Loads the menu scene, grabs the title image, deletes everything else, and saves it as ‘Menu-Skybox’
  • Goes through each level:
    • Exports all of the enemies, with their settings
    • Exports the player start point and pickups (without any settings)
    • Gets rid of everything in the scene that has a script on it and saves the scene as ‘LevelX-Geometry’
  • Collects a list of all enemy prefabs used in all the levels and saves their settings
  • Saves copies the enemy skins and materials

What does the importer do?

  • It sets the company name, and the bundle version code (and even bumps it up for you)
  • It applies the changes to the enemy prefabs
  • It takes the menu skybox, adds in the C16 menu stuff, and saves it over the existing menu scene
  • For each level:
    • it takes the LevelX-Geometry file
    • it adds in all the new C16 stuff that should be in every level
    • it imports all the enemies with their settings
    • it places the player start point and pickups

Notes

  1. When something is exported (like, say, a pickup, or even an enemy), the exporter remembers the unique ID of the prefab used for that game object. When it imports it, it instantiates the latest version of the prefab.
    • the enemies placed in the scene will be C16-style enemies. (The exporter has special code to update the saved data for the enemies from C10-style to C16-style).
    • the player starting point and pickups will all use the latest versions and artwork in the branch that you started from.
  2. You may want to go through your levels beforehand and make sure that the buildings and other level-geometry items do not have any scripts on them. You may need to break prefab references. (Look at the troubleshooting steps for the levels for more details).
  3. Things that use scripts in your scenes (like elevators and particle effects) will not come over during the import. You’ll need to re-add them manually.
  4. The game’s icon isn’t exported, but that is just as well as you’ll want to get the latest version available for the game (as explained in a later step).
  5. Spiderbots aren’t likely to export at the moment.
  6. The exporter should work as-is for C10 and E versions of the game, and should work for games generated from C16.2.2 or newer. It will need tweaking to work with earlier C16 games.

Export The Data

For X code games, you need to remove all shader scripts in the levels before you export it. (refer to this link for additional details – Level Prep)

From the menu, choose Tools -> Enemy Exporter -> Export All Levels.

export_all_levels

A progress bar comes up, showing you which level it is currently exporting.

exporting_levels_and_level4_unity_-_assassins_freed_united_games_c10_1_bvc_7_-_android

Then, Unity is unresponsive for a couple of minutes, and you see a spinning wait cursor. …

Finally, it asks you where to save the exported game data.

export_game_data_and_untitled_-_assassins_freed_united_games_c10_1_bvc_7_-_android

You may need to tweak the name. Spaces and dashes are fine, but colons and slashes may cause it to refuse to save.

Using the defaults, it created “Assassin’s Freed United Games – C10.2 – BVC 7.unitypackage” on my desktop.

[DO WE WANT PEOPLE TO SAVE THIS INTO DROPBOX?]

Production team agreed that it is better if the data exported from the old project folder will be uploaded in the corporate dropbox.

The folder for these packages is called 9-App Asset Packages.

All the assets for the game should be in this neat little unity package.

screenshot_110316_105248_am

Tada! Everything that we need from that game, in one tidy import file.

For X code Games – refer to this link

(you need to do these steps first before importing the data from the exporter.)

Don’t forget to export the player skin from the old project and import it on your C16.4 project.

(Find for the SteveArmy material [Assets>_Models>_Weapons>BlockGuns>Materials>SteveArmy.mat], click on the texture applied for you to find your player skin)

Import the new prefabs first before importing the data from an X code game.

Import The Game Data

Wait! Stop the presses. Didn’t we just import?

Yes, yes, we did. We imported assets into Unity.

Now, we will import all the enemies and game settings into our game.  It is confusing that they use the same name — if you have a better term, contact your friendly neighbourhood dev team.

It is not a bad practice to clear the messages in the console before beginning. Find your console window (Window -> Console, from the menu) and hit the clear button.

clear_the_console

Now, go to Tools -> Enemy Exporter -> Import All Levels to kick off the process.

tools_and_menubar

You’ll get a nice progress bar to show you what is happening.

importing_levels_and_c16_assets_unity_-_fps-c11_0_0_-_android__opengl_4_1_

Woohoo! This process just save you six hours of mind-numbing work!

If other prefabs are missing please refer to the C16.2.2 process for troubleshooting missing prefabs. 

Rename the Exported Data Folder

Your game relies on the data in the “Assets/! Enemy Exporter Data !” folder, but you can’t leave it named like that, or you won’t be able to export from this project when it is time to update to “C37 now with added awesomeness”.

Therefore, rename the folder. Your hair is too valuable to lose!

level6_unity_-_fps-c11_0_0_-_android__opengl_4_1__and_screen_shot_2016-10-07_at_4_37_51_pm_png

I renamed it to “! Data for Assassin’s Freed”

I’ll refer to it as ‘your import folder’ from here on.

Save it to Version Control

You’ve done some great work. Save it – ’cause, hair loss!

gamecompany_ccoderepos

You may optionally ‘Publish’ and ‘Sync’. (You will need to do that later).

Additional steps to be done:

You can find the game organization at : Apps Task Tracker – Column O

screenshot_112416_051404_pm

Or the Ad Networks Master File – Column E

screenshot_112416_051617_pm

  • Import proper pause menu games package for the correct organization. (refer to this link – C16.4 Pause Menu Packages)
  • Link Unity services. (log in to correct company, link to correct organization, turn off Unity Ads) (refer to this link – Linking the game in Unity services)
  • Setup Soomla Key. (refer to this link – Soomla key is on column D of this spreadsheet)

screenshot_112416_065059_pm

  • Get the latest icon. (refer to this link – Current icon is on column K of this sheet) Please disregard any instructions related to Heyzap Mediation.
  • Setup Time Manager. DON’T FORGET TO HIT APPLY! (Note that enemies from enemy manager of each level is the correct enemy count, which should be the same count indicated on your Time Manager.)
  • Setup Leaderboards script. Don’t forget to click SETUP. (refer to this link for additional ways to setup your leaderboards script – Leaderboard settings)
  • SAVE, COMMIT, SYNC/PUBLISH.

Export the Data and Upload

Export data from new project and upload it on corporate dropbox. (refer to this link for this last step – Export the Data)

HOLD YOUR HORSES!

Before sending an APK for approval, check the logo scene and see if the reporter game object is enabled.

If it is, disable it or remove it on the scene, and then build your apk.

reporter-disable

Send APK for Approval

Follow the format for Approval email. Attach link of the spreadsheet of your game for the Ten Slot Ad Settings and transfer ownership to Top Cube Games (gamecompanya@gmail.com). If ownership is not transferred, the game will not be approved.

screenshot_111816_093435_pm

Balancing the game

After your game is published, you should check the game a day after it was published in Unity analytics after the update. Monitor and balance death and ammo watches based on analytics if needed.

Main factor for balancing are:

  1. Ammo pick ups for a level.
  2. Health packs for a level.
  3. HP of the NPCs.
  4. Number of enemies in a level.

Any questions or suggestions regarding this process, please do not hesitate to contact Production Team.

Create A New Project In GitHub

This post explains how to get a new team project on github.

First, log in to github with the company account (or, get someone with the password to do the first few steps for you 🙂

Click on the “+” button and create a new repository.

1_git_-_create_new_repo

Set the name of the repo and a shot description. Mark it as private and create it.

2__info_on_new_repo

You’ll get a nice page with instructions on setting it up, but you can’t do that yet …

3__quick_setup_page

Click on Settings, and then Collaborators, and add accounts for the people who’ll actually work on the project.

4__add_collaborators

That person will get an e-mail invitation to accept.

5__accept_invitation

After they’ve accepted, and perhaps after waiting a few minutes, they can fire up GitHub Desktop, and clone the project.

6__clone_repo

They’ll be asked where to save the project on their hard drive.

Then, they need to create the project in Unity. Unfortunately, they can’t use the same directory; Unity will complain a project already exists there. So, create a new directory.

7__create_new_unity_project

Then, set up Unity right for use with external version control. Go to Edit -> Project Settings -> Editor, and turn on Visible Meta Files and Force Text Mode for asset serialization.

8__set_up_project_for_version_control

Quit Unity.

Go to your file manager, and copy all the files and folders Unity just created into the proper folder that is in version control.

9__drag_files_into_real_folder

Finally, you need to create a .gitignore and a .gitattributes folder. The ‘.’ in front of the name hides the file on Unix-like systems (including the Mac), which makes them a little tricky to copy. Here I’m grabbing them from another repo on my computer. I suggest getting them from here.

The .gitignore file tells git to ignore things like the Library folder, and build you’ve made. The .gitattributes file helps deal sanely with the line endings on text files.

10_set_gitignore_and_gitattributes

With all that done, you can make your first commit, and publish the branch, and start working on it.

11-publish-project

Updating X-Code Projects

Purpose

This document speculates about how to update X-Code projects.

Instructions

You will, of course, need an X-Code project to update, and I assume you’ll be following most of the steps for doing a C16.2.2 update using the Enemy Exporter. You’ll also need to know which branch you are updating to — I’d go with C16.4 at the time of writing.

It is unclear to me how you’ll get all the new prefabs from an X-project game to the C-code. I’m sure Michelle has a good idea, and will ask her.

Level Prep

Before doing the export, you’ll want to prep your levels. A lot of them look beautiful because of a new shader, but it left scripts on the geometry objects (which aren’t needed any more) that will prevent the levels from exporting. Save yourself some effort; open each level and:

remove_scripts_before_exporting

  1. Search the heirarchy for UNOShaderHelper. It’ll highlight all game objects that have this script on them.
  2. Select all the game objects with the script.
  3. Remove that component from all the objects.
  4. Then, exit your ‘find’, go to the geometry prefabs, and apply them — or, better, break the prefab connection. This’ll save them without the scripts so that they’ll export.

 

Setup Ads Cascade System

 Setup Vungle on Ads Cascade System

  1. Go to the Vungle website.
  2. Click on the “Log in” button.

captura_de_pantalla_110416_042801_am

3. Log in with the correct game company.

captura_de_pantalla_110416_043037_am

4. Find your game on the list and click on the config button.

captura_de_pantalla_110416_044343_am

If the game is not in the list, just add it with the next instructions, else go to the point 5:

  • Click on “Add New Application” button.

captura_de_pantalla_110416_045607_am

  • Click on “Google Android“.

captura_de_pantalla_110416_045845_am  

  • Enter the Game Name on the Application name Field and select the game from the list.

captura_de_pantalla_110416_050155_am

  • Select “Games” on the Category.

captura_de_pantalla_110416_050424_am

  • Select “Landscape” on the Orientation.

captura_de_pantalla_110416_050602_am

  • In the “Force View” options, be sure that “Remove a user’s ability to skip video” is unselected and “Remove a user’s ability to skip an incetivized ad video” is selected.

captura_de_pantalla_110716_041550_am

  • Click on “Submit” button.

captura_de_pantalla_110416_050750_am

  • Click on “Submit” button and go to the point 4.

5. Copy the Application ID to the clipboard.

captura_de_pantalla_110416_044534_am

6. Go to the Unity project and click on the “Ad Networks” Menu ->Vungle -> edit settings.

captura_sin_titulo_110416_044802_am

7.  The settings for the Vungle Ad Network will appear on the Inspector Tab, copy the Application ID to the ID Field.

captura_sin_titulo_110416_045115_am

8.  Be sure that the Status is set on “Active.

captura_de_pantalla_110716_114346_am

9. Save your project.