Tier 2 Series 100

100A: The Data Cockpit

Pilot Record
Student Profile
"In a professional aircraft, you don't rewrite the flight manual every time you change the fuel load. The Manual (the code) stays the same, while the Manifest (the data) is updated separately. If your AI is hard-coding stats inside your scripts, you're welding your manifest to your manual."

The Concept: ScriptableObjects

As detailed in Chapter 4 of our guide, ScriptableObjects are data containers used to store large amounts of data independently of class instances.

The Flight Engineer's Advantage:
* Changes made in Play Mode are permanent (no lost stat tweaks).
* Reduced memory footprint (data is shared, not duplicated).
* Designers can balance the game without touching a single line of C#.
Red Flag Detected

The AI Trap: "The Hard-Coded Anchor"

You ask the AI: "Make a script for an enemy with 100 health and 5 speed."

// AI-Generated Code: Hard-coded and rigid
public class Enemy : MonoBehaviour {
    public float health = 100f; // Audit Fail: This is logic + data
    public float speed = 5f;
}

If you want a "Boss" with 1000 health and a "Minion" with 10 health, you have to create separate scripts or manually change them on every object. It creates a maintenance nightmare as your game grows.

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 Pilot's Correction

Corrective Protocol
// The Manifest (Data)
[CreateAssetMenu]
public class EnemyData : ScriptableObject {
    public float health;
    public float speed;
}

// The Manual (Logic)
public class Enemy : MonoBehaviour {
    public EnemyData data; // Reference the manifest!
}
Your Pilot Command
> Direct the AI to use RaycastAll to detect multiple targets in a single line of sight.
Next Mission
Collision Physics