Is there a manual build tutorial somewhere?

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

1 Like

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:

  1. Download the normal package from here Downloads

  2. Unpack the package.

  3. Export your game from GDevelop in to a local folder

  4. Copy the exported game folder in to the NW.js folder you have unpacked in step 2

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

  1. 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 :slight_smile:

6 Likes

That worked PERFECTLY, so much easier than fighting with electron! Thank you so much :smile:

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 :slight_smile: thank you!

In package.json, add the following just after “main”

}
     "name": "MayGame",
     "main": "/game/index.html",
     "window": 
     {
         "width": 800,
         "height": 600,
         "min_width": 800,
         "min_height": 600,
         "max_width": 1024,
         "max_height": 768 
     }
}

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:
http://docs.nwjs.io/en/latest/References/Manifest%20Format/#manifest-format

2 Likes

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.

1 Like

Thank you for taking the time to answer, ddabrahim. As always, your knowledge is appreciated. :+1:

1 Like

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.

1 Like

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.

1 Like

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.

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

Hello!

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.

https://wiki.gdevelop.io/gdevelop5/publishing/#publish-on-stores-and-other-platform

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.