In this series I want to share a few things that I love about the Godot Game Engine. Today I will write about the TSCN file format.
In fact this post is not only about the TSCN format. It is about the fact that most file formats in godot are human readable text formats.
TSCN is the file format used by godot to store scene files. The format is explained very well in the official documentation. I will not cover these details here.
It basically is a text file specifying the contents of a scene. It contains resources and the complete scene tree.
Most things in godot are stored (or can be stored) in plain text:
- Resources (
- Project Settings (
- Import Settings (
- Scene files exported by other applications (
- probably some more that I have missed
The TSCN files are stored as binary
.scn files in the internal
.import folder. This way they load very fast.
I use git for all my projects. The text file format works perfectly with git. Every change I do in my scenes can be tracked by git. While every little change in the scene can be tracked this can also be too much. I like to group logically connected changes together to not clutter my git history too much.
Another point I love is that I can search for things easily. Forgot in which file the enemy named "KlingonShip01" was? Simply search in all files in the project directory! As everything is stored in plain sight it is very easy to find things.
Last but not least I love the simple structure of these files. It is not only easy to read, it is also easy to generate. For my current space game I wrote a small python script that generates scenes. It looks up the positions of planets and stars in an online database. Based on this gathered data it generates godot scene files.
This is the second post in my series "Things I love about Godot". I will probably cover the editor interface and more in the following posts. If you have any questions or suggestions please let me know!