The Godot Q&A is currently undergoing maintenance!

Your ability to ask and answer questions is temporarily disabled. You can browse existing threads in read-only mode.

We are working on bringing this community platform back to its full functionality, stay tuned for updates.

godotengine.org | Twitter

0 votes

I lost part of my project when my hard drive failed. However, I did happen to send a windows export of the latest version to my friend beforehand.

I have access to all of my artwork from the project, but the script files were converted to .gdc and can't be opened and edited in the engine (the scene files seem functional other than missing the .gd dependancies).

Basically, I was wondering if there is any way to revert .gdc back into a regular .gd before I jump into recoding the project.

in Engine by (12 points)

I don't think it is possible but I MAY be wrong.

Personally, I think that is possible. My guess is that godot translates/compiles the gd scripts into bytecode. (Also because the word "bytecode" occurs often in modules/gdscript/gd_compiler.cpp)

There exist bytecodes decompilers for other languages which work quite well. But I don't know of any which is available for godot. You could try a decompiler for python pyc. I doubt it will work. Decompiled bytecode will however not be the same as your gdscript. Comments will be missing and probably also the names of local variables/identifiers.

So most certainly you'd have to write your own gdscript decompiler (or adjust an existing decompiler to understand the gdc file format and tokens). :-) Probably re-coding your scripts is easier but I don't know the size of your project.

Thanks for your response :)
My project was not very big, it was my first game, and honestly it would benefit from being done a second time. I was still curious if there was a simple way to revert the scripts, it would be a bummer to re-do them and find out later there was a simple fix ( like wondering for an hour why a script won't work and it turns out something was misspelled).
I'll be sure to back up my files next time, haha.

It may theoretically happen that a decompiler (or something which is easily adjustable) exists somewhere. But I don't know. Especially when the developer which coded the gdscript compiler cared about a bytecode which is compatible with other languages.

Anyway, if you spend more time searching for a (probably non existing) working decompiler than doing the programming again might be the simpler task.

So don't worry about what might be. :-) Stay happy, keep coding...

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 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.