TSCN ファイル形式とは?
.tscnファイルは、2Dおよび3Dゲームを構築するためのフリーでオープンソースのエンジンであるGodot Engineによって作成されたテキストシーンです。TSCNは «text scene» の略であり、各ファイルはレベル、キャラクター、UI画面、または再利用可能なコンポーネントを構成するノードと、それらのプロパティおよび接続を記述した単一のシーンツリーを表します。
この形式は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を追加します。この形式はプレーンテキストであるため、Gitでの差分比較(diff)やマージがクリーンに行えます。これが、チームがバイナリ形式の .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 の変換
コミュニティ Q&A
ユーザーからの質問まだ質問はありません。TSCN ファイルについて最初の質問をしてみましょう。
よくある質問
.tscnファイルを開くにはどうすればよいですか?
.tscnファイルを手動で編集できますか?
.tscnと.scnの違いは何ですか?
.tscnはテキスト形式でバージョン管理での差分確認に適していますが、.scnはコンパイルされたバイナリ形式で、読み込みが速くサイズが小さくなります。Godotはインポート時にバイナリ版を生成します。なぜ私の.tscnは [gd_scene format=3] で始まっているのですか?
format=3 はGodot 4.xで保存されたことを意味し、format=2 はGodot 3.xを意味します。