# Default property values for Instance.new objects

> Engine note from the Rove documentation: https://docs.rove.wtf/notes/property-defaults

When a script creates an object with `Instance.new` and reads a property it never
set, Roblox answers the class default (`TextLabel.TextColor3` is 27, 42, 53, a
`ParticleEmitter` emits white, `UICorner.CornerRadius` is 8 px). Rove used to
throw `property '...' unavailable in snapshot` for most of these.

`rust-client/src/rust_host/instance_new_defaults.rs` is a sorted table of
`(class, property, value)` with the value in Rove's tagged JSON. It holds 3,164
defaults for 331 creatable classes, generated from the community
`rbx_reflection_database` (rbx-dom), which records what Roblox itself produces
for a new instance. It is static data: no memory is used until a lookup.

## Where it applies

Only as the last step of a script's property read (`world.rs`,
`default_for_unavailable`), and only for objects created on the client.
Everything Rove already answers keeps its own value, including Rove's own
defaults such as animation priority. A missing value on an object the server
sent still errors, because it means the server didn't send it.

## Regenerating

    cd rust-client/tools/defaults-gen
    cargo run --offline --release > ../../src/rust_host/instance_new_defaults.rs

Bump the pinned `rbx_reflection_database` version in `tools/defaults-gen/Cargo.toml`
for a newer Roblox release. Notes on the conversion:

- Colour channels are written as exact multiples of 1/255 when that's what they
  are, so a default equals `Color3.fromRGB(...)`.
- Infinity (Roblox's "no limit", e.g. `LineForce.MaxForce`) is written as
  `{"$number":"inf"}`.
- Derived properties the database doesn't store are filled in:
  `UICorner.CornerRadius` (from the per-corner radii) and `BrickColor` for
  parts (Medium stone grey).
