Tier 2 Series 106

106E: The File Path

Pilot Record
Student Profile
"You cannot save to "C:/MyGame". That folder doesn't exist on a mobile phone or a console. An Engineer uses `Application.persistentDataPath` to find the safe, writable folder on ANY device."

The Concept: Persistent Data Path

The operating system's designated save folder.

* **Windows:** AppData/LocalLow/...
* **Mobile:** /private/var/mobile/...
* **Universal:** `Application.persistentDataPath` works everywhere.
Red Flag Detected

The AI Trap: "The Desktop Hardcode"

You ask the AI: "Save the file to the game folder."

// AI-Generated Code: Permission Denied
File.WriteAllText("C:/Saves/save.json", data);
// Audit Fail: This crashes on Android, iOS, and Mac.

This is "Platform Ignorance." Hardcoded paths only work on your specific computer.

Elite Telemetry

Research shows "Elite" teams achieve 15% faster lead times by keeping AI on a "very tight leash."

  • Small Batches Solving one problem at a time prevents logic drift.
  • Modular Design Localizing the "blast radius" of AI changes.
  • Tight Loops Rapid iteration with constant code review.

The Engineer's Correction

Corrective Protocol
// Corrected: Safe Path
string path = Path.Combine(Application.persistentDataPath, "save.json");
Your Pilot Command
> Use the SceneManager.LoadSceneAsync method to load levels in the background.
Next Mission
The Checksum