0 votes

I am looking for an automated way to look at a godot project in a github repo and be able to identify what version of godot it is meant to run on.
Looking at these files:
https://github.com/brunosxs/SMRT-Godot/blob/master/default_env.tres

https://github.com/brunosxs/SMRT-Godot/blob/master/addons/SMRT/editor.tscn

I see both have format=2 in them, and they are both 3.x projects.

This is also a 3.x project, but as a plug in, it doesn't have a .tres or a .tscn file. Looking at:

https://github.com/vnen/godot-tiled-importer/blob/master/addons/vnen.tiled_importer/plugin.cfg

it has config_version=3

Also, this one has a project.godot with a configversion=3 for godot 3.x:
https://github.com/henriquelalves/SimpleGodotCRTShader/blob/master/godot3/project.godot
and for a godot 2.x version of the same project (which doesn't have a project.godot):
https://github.com/henriquelalves/SimpleGodotCRTShader/blob/master/godot2/engine.cfg
there is no config
version

There is also a 2.x version of the project under another tag:
https://github.com/vnen/godot-tiled-importer/blob/1.x/addons/vnen.tiled_importer/import_dialog.tscn

which has a scene in it with a format=1

It's cfg file has no config version
https://github.com/vnen/godot-tiled-importer/blob/1.x/addons/vnen.tiled_importer/plugin.cfg

Here is another that is a 2.x version where the scene file is format=1
https://github.com/YeOldeDM/godot-time-tracker/blob/master/addons/work-time/WorkTime.tscn


Rules?

So the best I can come up with for rules is:
In tres or tscn files, take the format and add 1 to it to find the rough godot version (2.x or 3.x)

If there is a .cfg or a .godot file, and config_version=3, then it is 3.x, otherwise it is 2.x


Are there any other ways to test the version that a godot project should be labeled as? It would be nice to be able to get a more specific version number, like 3.1

The purpose of this all is to provide a way to scan a github repo and add it to this Godot Asset Store with meaningful version number flags.

asked Nov 14, 2019 in Engine by RobKohr (17 points)

1 Answer

+1 vote
Best answer

I think there is no way to tell just from the project file. It has a version but it's only guaranteed to work for that file in particular (i.e if a new version of Godot does not change settings it will have the same number).

And it's even harder to tell from the rest of the project... some other files have a version in them but that version only pertains to those in particular and not the engine in general. You could combine all such files to deduce the version but it's quite sloppy.

If you aim to make a system that opens the project automatically with a version of Godot, you can only take the latest version using the project file version.

See https://github.com/godotengine/godot/issues/25497

answered Nov 15, 2019 by Zylann (26,157 points)
selected Nov 15, 2019 by RobKohr
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.