Field Notes: Projects & Teams
Scripting mistakes cost hours. Project mistakes cost weeks: a corrupted scene merge the day before a demo, a keystore lost after launch, a phone build that runs at 12 FPS discovered in the last month. These notes are about running a Unity project, alone or in a team.
1. Check scenes and prefabs into Git with Force Text
Visible meta files, Force Text serialization, .gitattributes with LFS and Smart Merge, a correct .gitignore: all on day one (setup). Commit .meta files with their assets, always.
2. Make prefabs, not scene edits
Two people editing the same scene is a merge conflict. Two people editing different prefabs is not. Build levels from prefabs and split big levels into additive scenes (gameplay, lighting, audio, UI) so work divides naturally.
3. Build for the target device in week one
Editor performance on a desktop GPU says nothing about a mid-range phone or a Steam Deck. Make a development build for the slowest target early and every week. Problems found in week one are design decisions; found in the last month, they're crunch.
4. Upgrade Unity on a branch
Upgrading the editor or packages can reimport everything, change serialized data and break APIs. Do it on a branch, open every scene, run the tests and make a build before merging. Stay on one LTS line for a whole production when you can.
5. Keep a boot scene and a way to start from any scene
A Boot scene that sets up services, then loads the menu, keeps initialization in one place. Make sure pressing Play in any level scene still works (for example with [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)] loading the boot setup), or designers will lose minutes on every test.
6. Decide early how content is loaded
Direct references, Resources, or Addressables: switching late means touching every system that loads assets. If the game has many levels or downloadable content, start with Addressables.
7. Name and organize things for strangers
Assets/_Game/ for your work, third-party assets elsewhere, one convention (PascalCase files, SFX_Coin_01.wav, T_Rock_Albedo.png), and no New Material (17). Find assets six months later, or let a new teammate find them on day one.
8. Back up signing keys and store accounts
Android keystores, Apple certificates, Steam partner credentials. Store them in the team's password manager with recovery set up. Losing the upload key can mean a long and painful recovery with the store.
9. Iteration speed is a feature
Measure how long it takes from saving a script to playing. Asmdefs, Enter Play Mode Options (with static state reset), smaller scenes and a fast SSD all add up. Ten seconds saved per iteration is an hour a week per developer.
10. Automate builds and keep the log
A CI build per commit (or at least per night) catches broken scenes, missing references and compile errors on other platforms before playtests. Version your builds so a bug report says exactly which build it came from.
11. Read logs from player builds
Debug.Log output in builds goes to a Player.log file (for example under %USERPROFILE%\AppData\LocalLow\<Company>\<Product>\ on Windows, ~/Library/Logs/<Company>/<Product>/ on macOS, adb logcat on Android). Ask testers for it with every bug report, and add a crash/exception reporter before the first public build.
12. Static state and Enter Play Mode Options
Turning off domain reload makes entering Play mode nearly instant, but statics keep their values between sessions. The model shows a static high-score cache that "remembers" a previous Play session until it's reset properly:
using System;
using System.Collections.Generic;
foreach (bool resetHook in new[] { false, true })
{
Console.WriteLine(resetHook ? "with [RuntimeInitializeOnLoadMethod] reset:" : "domain reload off, no reset:");
for (int session = 1; session <= 3; session++)
{
if (resetHook) ScoreCache.ResetStatics(); // Unity calls this at the start of every Play session
new Level().Play(session);
}
}
static class ScoreCache
{
public static readonly List<int> Scores = new();
public static int Listeners;
public static void ResetStatics() { Scores.Clear(); Listeners = 0; } // [RuntimeInitializeOnLoadMethod(SubsystemRegistration)]
}
class Level
{
public void Play(int session)
{
ScoreCache.Listeners++; // e.g. a static event subscription without -=
ScoreCache.Scores.Add(100 * session);
Console.WriteLine(quot; play session {session}: scores [{string.Join(", ", ScoreCache.Scores)}], listeners {ScoreCache.Listeners}");
}
}domain reload off, no reset:
play session 1: scores [100], listeners 1
play session 2: scores [100, 200], listeners 2
play session 3: scores [100, 200, 300], listeners 3
with [RuntimeInitializeOnLoadMethod] reset:
play session 1: scores [100], listeners 1
play session 2: scores [200], listeners 1
play session 3: scores [300], listeners 1
In Unity, the reset looks like this:
static class ScoreCache
{
public static readonly List<int> Scores = new();
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.SubsystemRegistration)]
static void ResetStatics() => Scores.Clear();
}13. Scope like a professional
A finished small game teaches more than an unfinished big one. Cut features before polish. Keep a "known bugs" list and a "not this version" list. See the fundamentals course for scoping habits.
Test yourself
What is the best way to avoid merge conflicts between two designers working on the same level?
- Use binary serialization
- Split the level into prefabs and additive scenes so they edit different files
- Turn off version control
- Always use the same computer
Where does Debug.Log output go in a Windows player build?
- Nowhere
- Player.log in the LocalLow company/product folder
- The Unity Console of the editor
- The Windows registry
Why upgrade the Unity editor on a separate branch?
- Branches build faster
- Upgrades can reimport and reserialize assets and break APIs, so you need to test before merging
- Unity requires it
- It keeps the Library folder small