GDevelop-examples icon indicating copy to clipboard operation
GDevelop-examples copied to clipboard

High performance GPU on Windows

Open Daveee19 opened this issue 3 months ago • 8 comments

Description

Although this is not a game example, I hope this is a good contribution to make future projects made with GDevelop better. :)

By default, your games and apps will run on the integrated GPU, even if a dedicated one is available in your Windows PC, due to the web-app nature of games created with GDevelop. Most of the time, the performance this way is not enough even for the simplest 3D games, or more complicated 2D games when heavily using effects.

This means, when you ship your game, users would manually have to edit their Windows graphics settings to use their dedicated GPU.

Image

To make your games run just as you intended, I've created a really simple launcher that works for your Windows builds of games.

  1. Move your build to "FOLDER_NAME", then rename the folder, only using letters and "_".
  2. Edit the "config.txt" text file to point to your build's EXE file.
  3. For dedicated GPU, leave the "gpu" property on "2", for integrated, edit it to "1".
  4. Rename the launcher to your liking.

https://github.com/user-attachments/assets/d207f21e-511e-41fa-b59d-e128b932733b

Made by creating a C# code that adds a specific application to Windows' graphics settings, and setting the GPU to either the power saving one or high performance one, then creating a self-containing Windows application with Visual Studio. Full source code here.

Checklist

  • [ ] I've followed all of the best practices.
  • [ ] My game has a proper name in the game properties.
  • [ ] My game package name begins with com.example..
  • [ ] My game has all events unfolded.
  • [ ] I've added myself as the author in the game properties.
  • [x] I've included a file called "README.md" with a description in proper English, explaining what this example is doing.
  • [x] I confirm that this game and all of its resources can be integrated to this GitHub repository, distributed and MIT licensed.
  • [x] I've cleaned unused resources.

Download

launcher_v2.zip

Daveee19 avatar Sep 22 '25 11:09 Daveee19

Thanks for sharing this! I wonder if there is a way we can force this on GDevelop side.

4ian avatar Sep 22 '25 12:09 4ian

Thanks for sharing this! I wonder if there is a way we can force this on GDevelop side.

I've found another method, where the "main.js" file has to be modified a bit. But, I can't confirm if it works on every system, and it's basically only for NVIDIA and AMD GPUs, so the newer Intel models would fall outside this method. My idea is, either that solution, but modified and confirmed to work on all systems, would be one of my suggestions, and the second would be integrating this launcher into the build process. I don't know JS and C# myself, these were both AI-assisted solutions, but I tried them on multiple systems at home, and even on Cloud PC ("AirGPU"). They seem to work fine. It also sets either the integrated graphics to "low power" or "high power" if a dedicated one is not available.

Daveee19 avatar Sep 22 '25 16:09 Daveee19

pleeeeeeeeeease tell me how to use it

Boy1developer avatar Sep 27 '25 21:09 Boy1developer

pleeeeeeeeeease tell me how to use it

Do you have a Discord? I can help you there and send a tutorial if you need. I just need some time. :)

Daveee19 avatar Sep 27 '25 22:09 Daveee19

yes my discored name I am in gdevelop server just mention me @boy.developer

Boy1developer avatar Sep 28 '25 13:09 Boy1developer

Thanks for sharing this! I wonder if there is a way we can force this on GDevelop side.

I found a solution for the "main.js" method. It contains code for Linux too, but I don't have a Linux system, so I cannot test it. I can confirm that it works on Windows 11. This way, users wouldn't even need the "launcher method" anymore that I suggested before. What is the best way to share my idea with the development team?

Daveee19 avatar Dec 06 '25 02:12 Daveee19

That sounds great :) You can:

  • Share the file directly here as an attachement (or upload its content on a hosting like https://pastebin.com/ and give the link here).
  • Or if you know how to use git, you can "fork" the repository https://github.com/4ian/GDevelop and open a "Pull Request". If you don't know how to use git, it might be simpler to edit the file main.js online: https://github.com/4ian/GDevelop/edit/master/GDJS/Runtime/Electron/main.js (paste the content of your modified file) and then GitHub will guide you to open a PR so we can take a look at your changes and integrate them.

Thank you!! :)

4ian avatar Dec 06 '25 14:12 4ian

That sounds great :) You can:

  • Share the file directly here as an attachement (or upload its content on a hosting like https://pastebin.com/ and give the link here).
  • Or if you know how to use git, you can "fork" the repository https://github.com/4ian/GDevelop and open a "Pull Request". If you don't know how to use git, it might be simpler to edit the file main.js online: https://github.com/4ian/GDevelop/edit/master/GDJS/Runtime/Electron/main.js (paste the content of your modified file) and then GitHub will guide you to open a PR so we can take a look at your changes and integrate them.

Thank you!! :)

I think the best is if I show the file here first, because it's quite a modification compared to GDevelop's original one. And also it's easier than creating a fork just for this in my opinion. So, here it is, with the Windows + Linux solution: main.js

A quick edit: It's important that this is clearly used in an exported project that I tested it with, so I didn't upload this from the engine files. That is why it will contain pre-written things like project name and all that. 😅

Daveee19 avatar Dec 06 '25 19:12 Daveee19

That sounds great :) You can:

  • Share the file directly here as an attachement (or upload its content on a hosting like https://pastebin.com/ and give the link here).
  • Or if you know how to use git, you can "fork" the repository https://github.com/4ian/GDevelop and open a "Pull Request". If you don't know how to use git, it might be simpler to edit the file main.js online: https://github.com/4ian/GDevelop/edit/master/GDJS/Runtime/Electron/main.js (paste the content of your modified file) and then GitHub will guide you to open a PR so we can take a look at your changes and integrate them.

Thank you!! :)

Hey! Just notifying you that it was me who committed the changes to the two "main.js" files, so maybe the development team can see it earlier. I did it for both the project export template (the one you have linked), and for the engine's main JS file too.

I hope my contribution can help in making GDevelop better, my personal tests sometimes showed jumping from 14 FPS to 144 FPS, so it is definitely one of the most important things that the engine would support dedicated graphics without the need of manual tweaks from users and players.

Daveee19 avatar Jan 05 '26 13:01 Daveee19