Что такое формат файла TSCN?
Файл .tscn - это текстовая сцена, созданная в Godot Engine, бесплатном игровом движке с открытым исходным кодом для создания 2D и 3D игр. TSCN расшифровывается как «text scene» (текстовая сцена), и каждый такой файл описывает отдельное дерево сцены: узлы, из которых состоит уровень, персонаж, экран интерфейса или многоразовый компонент, а также их свойства и связи.
Формат напоминает INI-стиль и легко читается. Файл начинается с дескриптора, например [gd_scene format=3 uid="uid://cecaux1sm7mo0"], за которым следуют записи [ext_resource], ссылающиеся на внешние ассеты, записи [sub_resource], содержащие встроенные данные (например, материалы или формы столкновений), записи [node], выстраивающие дерево, и записи [connection], связывающие сигналы. Godot 3.x сохраняет файлы с format=2; Godot 4.x использует format=3 и добавляет строковые UID, чтобы сцену можно было отследить даже после перемещения. Поскольку формат является текстовым, он чисто проходит через diff и merge в Git, что является одной из причин, почему команды предпочитают его бинарному варианту .scn.
Безопасность и защита
РИСК: 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.
Детали формата
в двух словахПрограммы, открывающие файлы TSCN
Технические подробности
глубокая спецификация| 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 |
| Выпущен | 2016 (Godot 2.x era; format=2 in Godot 3.x, format=3 in Godot 4.x) |
| Последняя версия | format=3 (Godot 4.x) |
| Спецификация | docs.godotengine.org |
Конвертации TSCN
Вопросы и ответы сообщества
спрошено пользователямиВопросов пока нет - станьте первым, кто спросит о файлах TSCN.
Часто задаваемые вопросы
Как открыть файл .tscn?
Можно ли редактировать файл .tscn вручную?
В чем разница между .tscn и .scn?
.tscn - это текст, который удобен для систем контроля версий, а .scn - скомпилированная бинарная форма, которая загружается быстрее и весит меньше. Godot генерирует бинарную версию при импорте.Почему мой .tscn начинается с [gd_scene format=3]?
format=3 означает, что файл сохранен в Godot 4.x; format=2 - в Godot 3.x.