Che cos'è il formato di file TSCN?
Un file .tscn è una scena di testo creata da Godot Engine, il motore gratuito e open-source per la creazione di giochi 2D e 3D. TSCN sta per «text scene» (scena di testo) e ogni file descrive un singolo albero di scene: i nodi che compongono un livello, un personaggio, una schermata UI o un componente riutilizzabile, insieme alle loro proprietà e connessioni.
Il formato è in stile INI e leggibile. Un file si apre con una riga descrittiva come [gd_scene format=3 uid="uid://cecaux1sm7mo0"], seguita da voci [ext_resource] che rimandano ad asset esterni, voci [sub_resource] che incorporano dati come materiali e forme di collisione, voci [node] che costruiscono l'albero e voci [connection] che collegano i segnali. Godot 3.x salva con format=2; Godot 4.x salva con format=3 e aggiunge UID basati su stringhe in modo che una scena possa essere tracciata anche dopo essere stata spostata. Poiché il formato è in testo semplice, permette confronti (diff) e unioni (merge) puliti in Git, motivo per cui i team lo preferiscono alla variante binaria .scn.
Sicurezza e incolumità
RISCHIO: LOWA .tscn is plain UTF-8 text, so it cannot execute on its own. Scenes can reference GDScript (.gd) files that do run inside Godot, so treat scenes from untrusted projects with the same caution as any downloaded source code. Opening a .tscn in a text editor is harmless.
Dettagli del formato
in sintesiProgrammi che aprono file TSCN
Dettagli tecnici
specifiche approfondite| Encoding | UTF-8 plain text |
| Byte order | Not applicable (text format) |
| Container | INI-style sections with bracketed headings and key = value property lines |
| Compression | None; the text file is uncompressed. Godot compiles it to a binary form on import for faster loading. |
| Encryption | None by default |
| Typical size | A few hundred bytes to several hundred KB depending on node count and embedded sub-resources |
| Structure | Five ordered parts: a single [gd_scene] descriptor line, [ext_resource] entries pointing to external files, [sub_resource] entries holding embedded data, [node] entries describing the scene tree, and [connection] entries for signal wiring. An optional [editable] section marks instanced sub-scenes as editable. |
| Integrity | None built in |
| Platforms | Windows, macOS, Linux, Android, Web |
| Notes | The descriptor carries format=2 for Godot 3.x and format=3 for Godot 4.x. Godot 4 replaced incremental integer resource IDs with string-based uid values (uid://...). References inside the file use ExtResource("id") and SubResource("id"). Single-line comments start with a semicolon and are stripped when the editor re-saves the file. The .escn export variant uses the identical format but signals that the file came from another program and should not be hand-edited in Godot. |
| Human Readable | Yes, this is a design goal of the format for version control diffing and merging |
| Rilasciato | 2016 (Godot 2.x era; format=2 in Godot 3.x, format=3 in Godot 4.x) |
| Ultima versione | format=3 (Godot 4.x) |
| Specifica | docs.godotengine.org |
Conversioni TSCN
Domande e risposte della community
chiesto dagli utentiAncora nessuna domanda - sii il primo a chiedere informazioni sui file TSCN.
Domande frequenti
Come si apre un file .tscn?
Posso modificare un file .tscn a mano?
Qual è la differenza tra .tscn e .scn?
.tscn è testuale e si presta bene al controllo di versione, mentre .scn è la forma binaria compilata che si carica più velocemente ed è più piccola. Godot genera una versione binaria all'importazione.Perché il mio .tscn inizia con [gd_scene format=3]?
format=3 significa che è stato salvato da Godot 4.x; format=2 indica Godot 3.x.