Could I recover a project from an export?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Bizhen

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.

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

SingingApple | 2018-02-18 02:38

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). :slight_smile: Probably re-coding your scripts is easier but I don’t know the size of your project.

wombatstampede | 2018-02-20 11:01

Thanks for your response :slight_smile:
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.

Bizhen | 2018-02-22 23:51

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. :slight_smile: Stay happy, keep coding…

wombatstampede | 2018-02-23 08:08