Skip to content
opera-pavelg edited this page Aug 23, 2024 · 15 revisions

This repository contains the code for the plugin which allows to register games on GX.Games and upload them. It also contains some simple game code for testing the plugin.

The plugin is written for Godot 4.3 dev 5 Standard. Note that the .NET version of the editor does not support export for Web.

Installing Godot and locating export templates

You need to install Godot version 4.3 dev 5 or higher. Here is the link to download Godot 4.3 dev 5: https://godotengine.org/download/archive/4.3-dev5/. Note that you need "Standard" version, not ".NET":

322467001-19f0fdc2-a596-4b37-9066-e2a92b0bb5d6

Install and open Godot. Go to "Editor -> Manage Export Templates". Keep the default settings and click "Download and Install":

322479497-767b9759-57af-4c87-8459-1b9b7d0681ed

Plugin Installation

Download this repository.

Open the folder with your own project. Copy the folder addons from this package into your project. If you already use other packages you should copy the folder addons\opera_sdk into the folder addons inside your own project:

357381796-af0439f9-782b-4382-8289-9a8c018bf479

To enable the plugin, open Project > Project Settings at the top of the editor then go the Plugins tab. You should see it in the list of plugins. Click the "On" checkbox to enable the Opera plugin:

322463296-6b48c7e6-36e6-4f92-93d5-84dfe1c21ba0

Now you can see the new panel "GxSettings" on the right:

357382318-7d88ec26-2072-4fa5-b582-704899b9150a

You will see the message box which proposes to reload the project. It is necessary to apply the changes in the export presets. You may agree or make it later manually. To reload the project manually, go to "Project -> Reload Current Project":

325669632-6bc8c6b0-7235-4c2a-99ec-9a8a51d37784

Uploading a new game to GX.Games

You need to authorize on GX.Games to fetch all the data from the cloud. Click "Update". You will be authorized, and the data will be downloaded for you.

Let's upload your project as the new game. First, enter the name in the field "Game Name". Then, select the group which will own your game. You may select it from the dropdown list "Select Group":

357382505-43da07be-7b93-4e5d-89e5-49780f586c98

Optional step: you may press "Register on GX.Games". It will only register the game without uploading the bundle to the cloud. It's not necessary because it will be done automatically during the next steps.

Now you need to export the project. Go to Project -> Export...:

278675338-4c8de7f7-0809-4ee0-ae85-5a96abe39641

You will see the export window. In the left panel, select "Opera GX" preset:

325670308-8eb99d43-fa64-4cd4-a47f-5b0f3553ee61

If you do not see it, make sure that you reloaded the project after the plugin installation.

Press "Export Project". You will need to enter the name of the main page file. Please verify that it is index.html. A main file with another name is not correct and such a bundle will be declined before uploading.

278676361-5cc50b3f-4d29-4343-9163-1756d052d2b5

Press "Save". Godot will build your project for Web. If it is successful you will be prompted to upload it to GX.Games. Press OK:

278677372-31b1725b-72dc-4b5d-889b-2aca205d25cd

You will be informed by the message box whether the uploading was successful or failed. If it failed, the errors will be logged in the console.

Uploading an existing game to GX.Games

The process is similar. But before exporting the project you need to select it from the "Select Game" dropdown list in GXSettings tab:

278678675-5aa81853-e53b-41d3-bb3c-0297170ebf8f

Note that the most of the settings will be blocked. It is not allowed to change the game's parameters from the game editor (e.g., name, group etc). But it may be done in the browser. You can click "Edit game on Opera" to go to the game's settings page:

278679177-c7940e6e-2597-4c66-8241-5a3cc4538788

Notes for the plugin developers

Just download this repository, open this project and start working. The repository contains the very basic project for testing. It is a good idea to commit changes in "addons" folder only if it is not absolutely necessary to commit something else.

When you pull the project for the first time, there could be errors on the very first start: https://github.com/opera-gaming/opera-godot-sdk-4/wiki#errors-on-opening-the-sdk-project-on-mac.

Also, the editor may silently crash on opening scene GxSettings.tscn. It started after I switched from version 4.2.1 to 4.3-dev5, the same happens in 4.3-dev6 as well. If you need to edit this scene, disable the plugin in the project settings. Looks like an editor's bug.

Known issues

Errors on opening a newly downloaded project with enabled plugin

If you open the project with SDK itself, there could be problems on the first start. If you open it for the first time you may get a ton of errors like this that Godot cannot find the types:

322476604-6a3cd611-e373-4262-8bfc-deaf3ff9e6e4

Just restart the editor and the errors will be gone. It was investigated and it looks like a problem inside the engine.

Browser hotkeys suppressing

Godot games suppress the most of the hotkeys. But there are two combinations (or maybe more) which are protected from disabling. This is Ctrl+W and Ctrl+Shift+W which close the tab and the browser correspondingly. There is a way to disable them, but this method requires to show the warning popup which is also not acceptable. So it looks like the only way to disable them is to rearrange these key combinations in the browser itself, and it should be done by the user. As for Opera GX, it is possible to rearrange the hotkeys directly in the browser settings.

These hotkeys are not invoked in the fullscreen mode so it's not a problem here.

Clone this wiki locally