Godot Version
4.3
Question
Hello everyone,
It’s my very first post here so hopefully it is allowed to ask multiples questions in one subject rather than creating a topic for each of them. I’m making my first game and I have some troubles about exporting to the web. Hopefully it’s tagged properly as well.
- What is the best approach to load data from outside of the game, but on the same server (my website)? I guess I have to use the HTTPRequest node but then, how can I use a relative adress and not an absolute one to load my “data.gd” file?
- How to “embed” the game in a page? Right now, the game IS the page, and I want something like you can see on itch.io, but to my knowledge, the HTML shell provided in the export is more for customisation “on the fly”. I would rather build the website separately, then embed the game wherever it fits, but every ressource that I find online talks about the standard HTML export.
- I found a way to reduce the size of the game by using a compression system as described here. Calinou (who I believe is a Godot dev) says that it’s better to use Brotli and provide a script for the server, but I’m not smart enough to figure it out on my own… Does anyone know how to do it? (I would host the game on my own, NOT on itch.io so I have access to server settings through CPanel, if that matters).
- The index.wasm that is generated (before compression) is about 34Mb.I want to reduce it even further by stripping fonctionalities that I don’t use in my game (3D for instance)? How would I do that? It says here that it is possible but I have no clue. I don’t understand what “scons” is and where to put it.
- I may be blind but I don’t find any info about how to change the loading bar. As I use an archive, I suspect the loading to still refers about the “normal” size of the index.wasm rather than the reduced size, which cause the bar to stop at 25% because, well, it’s loaded.
- And finally, I noticed that Firefox “leaks” memory when I play my game. That does not happen on other browsers and I checked memory leaks in the inspector before export. I don’t have any orphan nodes or an infinite number of objects creating themselves… But Firefox increases it’s RAM usage by like 6Mb every two seconds. Any thoughts or clues?
And… That’s about it! Thanks a lot if you read the whole thing!