Co to jest format pliku TSCN?
Plik .tscn to scena tekstowa utworzona przez Godot Engine, darmowy i otwartoźródłowy silnik do tworzenia gier 2D i 3D. TSCN oznacza „text scene” (scena tekstowa), a każdy plik opisuje pojedyncze drzewo sceny: węzły tworzące poziom, postać, ekran interfejsu użytkownika lub komponent wielokrotnego użytku, wraz z ich właściwościami i połączeniami.
Format jest wzorowany na stylu INI i jest czytelny. Plik zaczyna się od linii deskryptora, takiej jak [gd_scene format=3 uid="uid://cecaux1sm7mo0"], po której następują wpisy [ext_resource] linkujące do zewnętrznych zasobów, wpisy [sub_resource] osadzające dane, takie jak materiały i kształty kolizji, wpisy [node] budujące drzewo oraz wpisy [connection] łączące sygnały. Godot 3.x zapisuje format=2; Godot 4.x zapisuje format=3 i dodaje tekstowe identyfikatory UID, dzięki czemu scena może być śledzona nawet po jej przeniesieniu. Ponieważ format jest zwykłym tekstem, czysto pokazuje różnice (diff) i łączy się (merge) w systemie Git, co jest jednym z powodów, dla których zespoły preferują go nad binarnym wariantem .scn.
Bezpieczeństwo
RYZYKO: 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.
Szczegóły formatu
w pigułceProgramy otwierające pliki TSCN
Szczegóły techniczne
specyfikacja| 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 |
| Wydano | 2016 (Godot 2.x era; format=2 in Godot 3.x, format=3 in Godot 4.x) |
| Najnowsza wersja | format=3 (Godot 4.x) |
| Specyfikacja | docs.godotengine.org |
Konwersje TSCN
Pytania i odpowiedzi społeczności
pytania użytkownikówBrak pytań - bądź pierwszą osobą, która zapyta o pliki TSCN.
Najczęściej zadawane pytania
Jak otworzyć plik .tscn?
Czy mogę ręcznie edytować plik .tscn?
Jaka jest różnica między .tscn a .scn?
.tscn jest tekstowy i dobrze współpracuje z kontrolą wersji, podczas gdy .scn to skompilowana forma binarna, która ładuje się szybciej i zajmuje mniej miejsca. Godot generuje wersję binarną podczas importu.Dlaczego mój plik .tscn zaczyna się od [gd_scene format=3]?
format=3 oznacza, że plik został zapisany przez Godot 4.x; format=2 oznacza Godot 3.x.