Can we ship compiled gdscript files?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By wombatTurkey
:warning: Old Version Published before Godot 3 was released.

So apparently I never knew that the GDScript could be compiled into .gdc files.

I am just curious since we can ship our game with a zip, we could also just send out the appropiate files “gamemanager.gdc” for easy patching.

My question is, would it be okay to do this? How easy could it be for someone to read the gdc file to get the source? I mean, if it would require advance knowledge, and not just a “script kiddy” could do it… I mean, I think it’s fine and I’m excited! But if it’s something where a script kiddy could just get in < 2 minutes… I’ll be hesitant! :stuck_out_tongue:

Thanks in advance!

:bust_in_silhouette: Reply From: volzhs

you can export encrypted script, .gde not .gdc
it’s in Export > Script tab.

but in order to do this work properly,
you need to make encrypted template.
get aes256 key here. (try with aes-256-cfb)

and compile template like this.

scons -j 4 platform=x11 target=release

and then, use same key in Export > Script.

now you get encrypted script game.

(IIRC, there was document about this, but I could not find now)

Hey all,

Is this still valid for 3.x ? I can’t seem to find the “script” tab in export anymore, and the info mentioned here (i guess from : seems old…)

Thx in advance :slight_smile:

GameVisitor | 2018-06-26 13:47

I can’t find it either for 3.x
I’m not sure it’s forgotten feature or removed…

volzhs | 2018-06-26 17:26

So how can we point it to the developers, to see if it is missing ?

On a side note, (probably not proper script encryption) but when manually checking the binary in a text / Hex editor, in 2.x, I was able to see the strings of my code, whereas here (in 3.x) I am unable to find them.

Again, this is not proper encryption i think, but might a small default security layer… ?

GameVisitor | 2018-06-26 18:04

I’m not expert on this.
you can open an issue for it and discuss with expert on it.
Issues · godotengine/godot · GitHub

volzhs | 2018-06-26 18:16

Another way to generate key offline (linux):
openssl enc -aes-256-cbc -k secret -P -md sha1 > godot.gdkey

Xrayez | 2018-12-19 13:41

:bust_in_silhouette: Reply From: eons

The normal behaviour of 2.x is to compile scripts (export a zip package and look inside), you need to refer to gdc files instead of gd when loading resource packs too.

Is also possible to export a zip, extract the gdc and attach it to a node in another project (just do not try to edit it).

Both great answers… I accepted the other one for now though, appreciate it!! I’m thinking of doing the option you listed

wombatTurkey | 2017-05-06 19:04

:bust_in_silhouette: Reply From: GameVisitor

This feature seems to be back in 3.1 (at least in graphically in the IDE, didn’t actually test it).