Wat is het TSCN-bestandsformaat?
Een .tscn-bestand is een tekstscène gemaakt door de Godot Engine, de gratis en open-source engine voor het bouwen van 2D- en 3D-games. TSCN staat voor „text scene” en elk bestand beschrijft een enkele scène-boom: de nodes die een level, personage, UI-scherm of herbruikbaar component vormen, samen met hun eigenschappen en verbindingen.
Het formaat is in INI-stijl en leesbaar. Een bestand opent met een descriptorregel zoals [gd_scene format=3 uid="uid://cecaux1sm7mo0"], gevolgd door [ext_resource]-vermeldingen die linken naar externe assets, [sub_resource]-vermeldingen die gegevens zoals materialen en botsingsvormen insluiten, [node]-vermeldingen die de boom opbouwen, en [connection]-vermeldingen die signalen koppelen. Godot 3.x slaat op als format=2; Godot 4.x slaat op als format=3 en voegt op tekst gebaseerde UID's toe, zodat een scène kan worden gevolgd, zelfs nadat deze is verplaatst. Omdat het formaat platte tekst is, kan het netjes worden vergeleken (diff) en samengevoegd (merge) in Git, wat een reden is waarom teams er de voorkeur aan geven boven de binaire .scn-variant.
Beveiliging & veiligheid
RISICO: 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.
Formaatdetails
in een notendopProgramma's die TSCN-bestanden openen
Technische details
diepe specificaties| 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 |
| Uitgebracht | 2016 (Godot 2.x era; format=2 in Godot 3.x, format=3 in Godot 4.x) |
| Laatste versie | format=3 (Godot 4.x) |
| Specificatie | docs.godotengine.org |
TSCN conversies
Community V&A
gevraagd door gebruikersNog geen vragen - wees de eerste om iets te vragen over TSCN-bestanden.
Veelgestelde vragen
Hoe open ik een .tscn-bestand?
Kan ik een .tscn-bestand handmatig bewerken?
Wat is het verschil tussen .tscn en .scn?
.tscn is tekst en werkt goed met versiebeheer, terwijl .scn de gecompileerde binaire vorm is die sneller laadt en kleiner is. Godot genereert een binaire versie bij import.Waarom begint mijn .tscn met [gd_scene format=3]?
format=3 betekent dat het is opgeslagen door Godot 4.x; format=2 betekent Godot 3.x.