I am working on a game and I want to be able to host it so my friends can play it. This needs to be able to include support for a SQLite addon that creates a database file locally. What are some options to do this?
I don’t want it to be so that they have to download an exe to run it, are there any other options for me?
You can make a HTML5 web build and host your game on itch.io or github pages for free. You will need to double check if your addons support web exports and if your game looks good in the compatibility renderer.
I tried hosting on itch.io and I tried running the compatiblity renderer (assuming that is remote debug mode) and I keep running into the same problem. It loads the loading bar to full then just freezes there. I’m assuming that’s because it’s trying to access/create the database file and its not able to do so.
I changed all my paths in the scripts to “user://” instead of “res://” but that didn’t fix it
the compatibility mode is one of three, selected either at project start or in the top-right most corner of Godot, it may say “Forward+”, “Mobile”, or “Compatibility”. Select “Compatibility”
Errors when playing the game in your browser through remote debugging should give error message in the web browser’s console, press F12 on your keyboard to open the web console.
“user://” paths are for userdata, this will be totally empty unless you are writing save files to it. “res://” paths are for exported resources, the bulk of your stuff.
Ah my apologies for the mix-up of compatibility mode. I was on “Compatibility” and this is the only error message i see when i start up the game with the browser console:
Uncaught (in promise) LinkError: WebAssembly.instantiate(): Import #120 “env” “memory”: mismatch in shared state of memory, declared = 1, imported = 0
I am using OperaGX if that would change anything
Also as for the user:// and res://, so if I am just accessing my created scenes and generated resources I use res? And for the database file that I create on load should that go to user://?
I enabled Thread Support now and the error message is gone but replaced with a new one
“LinkError: WebAssembly.instantiate(): Import #72 “env” “_ZNSt3__29to_stringEx”: imported function does not match the expected type”
Not sure if you are aware…
But sqlite addon only supports read-only databases on web and mobiles builds.
So you will get errors if you try to create or write data to the SQLite database.
And you might want to have thread support disabled to have better support for your game.
If you have thread support turned on, only a few hosts will work, and your game won’t run inside macOS browsers.
Also, you’d need to have “SharedArrayBuffer support” enabled on the itchio hosting options.
Which is why, you probably don’t want thread support enabled.
I was not aware that the add on only supported read only on web builds thank you for letting me know. I am very new to this stuff so this is great information.
Is there an option or a separate add on or something else I can use that allows write access on web builds?
As for the thread support stuff thank you again for letting me know, I’ll make sure to disable it. And I did have SharedArrayBufferSupport enabled
Is there a specific reason you need to use a database? If it’s just for save data, chances are you could just save to / load from files in “user://”, then you won’t be limited on web. Godot makes it relatively straightforward to save and load user data.
See the Godot docs for some useful tips on saving/ loading:
If it’s just for you and your friends, buy one of the cheap gaming minipcs, and host it on there, then you just need to learn how to do port forwarding on your firewall / router. That’s very straightforward to do.
In fact that’s what I do for my test environment so my PC isn’t hosting EVERYTHING during testing.
It’s for a school project so I only need my professor to be able to run it on his machine to test it. Before an exe is suggested he said he will not run any exe so that’s why I need hosting.
How “cheap” would one be do you have a suggestions? Also how easy is that to set up?