0 votes

I wish Godot saved things in a way that was immediately friendly to version control systems and also to human eyes. I want to be able to do side by side diffs to see what I have done since my last commit. That is not fun with the .tscn format as far as I can tell.

I have seen in other Q&A that there are some ways maybe to configure Godot to use text files or something, I can't say I have followed up on it. I do not think Godot should default to making it hard to diff things. I don't think I should have to find some place to reconfigure and reexport and whatever all my stuff. At least for my gd scripts. I know some things are more inherently binary, but not gd scripts.

thanks for a great tool.

in Engine by (103 points)

What are you asking for?
By default Godot let you save scenes in .tscn, which is text-based and friendly to version control because data is ordered before saving. If lines change unexpectedly, that might be a bug.
There is no diff tool built in Godot because that's not the job of a game engine, it depends on what you use (Git, SVN, Mercurial, Perforce...).

Thank you for your comment. I mean that the .tscn file is all mushed together. Lines are mushed together. Also, entire gd scripts are mushed together into the file. It is not very human readable or diffable. I would suggest letting things be individual flies, and not mushing lines together since "\n" only takes up at most a few bytes.

What do you mean?
If you ask Godot to create "built-in" script, of course they will end up in the .tscn file. If you want them in a separate file (which I do), make sure the option is not checked when creating a script.
Also, what do you mean by "mushed together"? What are you using to open /diff the files?
Do you mean there are no line breaks/newlines?

Yeah, it seems weird, the .tscn files are fine for my git version control. Each child node, property, resource, etc. is on it's own line.

Thanks for the messages! Various things...

(1) I think it would be more usable with [version control, any text editor, diff programs, unix utilities, etc.] if it were multiple files e.g. one per script. one per material, one per node possibly even -- by default. Having to even know about "the option" is to me backwards usability, for me and my personal preferences anyway. The files can be in a directory structure like "bundles", down one level in the project, if that makes it look any cleaner (ie. replace the file *.tscn with a folder of the same name, and the individual files inside it)

(2) The "\n\t" etc. inside the *.tscn file on linux show up at literal "\n\n" rather than as any sort of actual newline (example below). I know cross-platform line endings are a nightmare. Git supports doing it automagically across platforms for whatever it is worth for example.

Nothing is a show stopper, it is more about solid end to end usability for software project management.

[subresource type="GDScript" id=9]
script/source = "extends Spatial\n\nonready var k
player = getnode( \"/root/Spatial/player\" )\nonready var kground = getnode( \"/root/Spatial/grou
nd\" )\nonready var theta = PI # 0 radians is north/up.\n# todo: kinematics to get it on the ground for real\?\nonready var radius = k
e().y + get
scale().y\nonready var z = kplayer.gettranslation().z\nonready var origin_transform = Transform( Vector3(1,0,0), \\n\tVector3(0,1,0), ...

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.