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:


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:


it has config_version=3

Also, this one has a project.godot with a configversion=3 for godot 3.x:
and for a godot 2.x version of the same project (which doesn't have a project.godot):
there is no config

There is also a 2.x version of the project under another tag:

which has a scene in it with a format=1

It's cfg file has no config version

Here is another that is a 2.x version where the scene file is format=1


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.

in Engine by (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

by (28,966 points)
selected by
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 Frequently asked questions and 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 [email protected] with your username.