So I’m testing things before I take the plunge and make a big game, and this came up- probably the most important thing in order to create a game is to, actually build the game haha. I’m using GDevelop on a computer with absolutely no Internet access, so the easy online build is a no-go.
So... I'm trying to figure out how to use Electron to package it myself (downloaded from github)and I can't even figure out how to run it 😅 I'm such a novice at this type of thing. I've searched but it almost sounds like you have to be connected to the internet to even use Electron and I'm not sure if any tutorial is applicable to GDevelop games in general? Or maybe I'm just not looking in the right place?
Would really appreciate it if someone could point me in the right direction! 😊
Could really use some help here. Everything I’m seeing says you have to download Electron with the command prompt on the computer you’ll actually be using. So, I’m not sure if I’m just not seeing something or if I maybe have to switch to GDevelop 4…? (which would stink a bit, i really like the physics in GD5)
No documentation with GD atm, but Electron side you can find the official docs here
GDevelop side you need export with “Local Folder” and use this files exported for package it in Electron it’s explain in docs.
After installing the CLI tools you no longer need the internet.
But In case you are afraid of using command line tools and you want to target desktop only, the most simple way to go is NW.js:
Export your game from GDevelop in to a local folder
Copy the exported game folder in to the NW.js folder you have unpacked in step 2
Assuming the folder containing the game is called ‘game’, in the root directory of the NW,js folder, create a new text file called ‘package.json’ containing the following
{
“name”: “MyGame”,
“main”: “/game/index.html”
}
save it as .json.
On Windows run nw.exe, on Linux you may need to rename nw to nw.sh and then run it.
That’s it, if you did everything right this is all you need to do to share and run your HTML5 game as a desktop application using NW.js. No code or command line is required. However, it is for desktop only and your content is not protected in anyway. There are ways to protect it but it is require command line but you can not target mobile with NW.js.
If you want to target mobile, I believe someone did actually shared a tool to package HTML5 game in to an .apk using Cordova CLI. You still need to download and install Cordova, but I believe the tool does everything and package the game for you. However, I can’t find the topic where the tool have been posted. Maybe you can find it if you search the forum or someone else
Just a quick question regarding NW.js! The output screen size is rather small, 500x300 I think, how do I change that? I know you can just maximize the window or resize it, but ideally I’d like it to start at whatever size the original project was (800x600). Not a major thing but I’m not sure how to search for the answer thank you!
This is set the default window width and height to 800 by 600 and as you can guess, set the minimum size to 800 by 600 so you can not scale the window below that, and set the maximum size to 1024 by 768 so you can not scale the window above that.
It is not protected from people with the right knowledge, but not directly accessible. All the files will be stored in an asar file and you have to know how to extract it to access the files.
That’s what I thought, thank you arthuro555. Essentially .asar files, .pak files, etc. are just archive formats then. And, that’s about all the security I’m expecting at this level. I’m guessing that even high budget games and apps can be unpacked with relative ease, with the right tools.
Actually, yes and no. The problem here comes from the fact that JavaScript is interpreted, so it needs an Interpreter to run, and the interpreter needs the source code. That is way the source is required to be on the computer. The same problem happens with python for example. But high budget games uses C or C++ to have the best performance and cross-compatibility, and those compile, Wich means that the human readable code is converted to Assembler, the only language readable directly by a CPU. The assembled code is then distributed, and that thing is readable but very difficult to understand, and if the game is high budget it has probably lots of code, and assembler instructions are much more detailed than normal languages. For example, you have all the operations of the CPU copying, creating and deleting each entry in the memory. So yes the code is “extractable” (readable is more appropriate) but almost impossible to completely understand and impossible to directly modify.