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:
Download the normal package from here Downloads
Unpack the package.
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
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
That worked PERFECTLY, so much easier than fighting with electron! Thank you so much
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!
In package.json, add the following just after “main”
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.
You can find all the properties you can tweak in the doc here:
Thank you so much for this information! I have a question though, you mentioned that content is not protected without taking extra steps.
Does that mean that all assets (graphics, sound, etc) can be plucked from the package by anyone who has the game?
Also, it sounds like builds from GDevelop’s online build service DO protect the game’s assets, is this correct?
Yes because there is no package just your html5 game with all assets in a folder that anyone can open with no additional tool or skill required.
Sorry, I don’t know about that, I can not say for certain how secure the packages are made using the online build service.
Thank you for taking the time to answer, ddabrahim. As always, your knowledge is appreciated.
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.
its not working it just opens up some window with ‘NW.js’ on the screen.
well now to think of it, is there a possibility of this being outdated? since this was 3 - 4 years ago
Please do not bump multi-year old topics.
The documentation site has a tutorial on manually building your game, and the instructions there are still valid as of Friday, when I last used them.
This page includes links to manually building for web, mobile, and desktop at the bottom.
You will need internet access to br able to get the packages installed required to build the game, once. After that it can be completed offline.
Hopefully this, helps. This thread will be closed due to age and there being official docs.