godotengine / godot-docs

Godot Engine official documentation
https://docs.godotengine.org
Other
3.94k stars 3.22k forks source link

Documentation for saving files in html5. #9486

Open Torguen opened 5 months ago

Torguen commented 5 months ago

Your Godot version: 3.6 beta 5 Issue description: As far as I know, there is no documentation that shows how to save a data file (save game) in an html5 game, for example hosted on itch.io or other. From what I know, I think it is done with javascript, you must access the indexDB and handle this to save a data file and retrieve it. There is no documentation on how this should be done, there is no example project or anything like that. My suggestion is a page to document this with example codes, of course. URL to the documentation page (if already existing):

AThousandShips commented 5 months ago

You can use the normal file system as long as the web server allows it, see here, you shouldn't need to do anything yourself with the indexDB as long as the server is set up

Torguen commented 5 months ago

You can use the normal file system as long as the web server allows it, see here, you shouldn't need to do anything yourself with the indexDB as long as the server is set up

Are you sure about that?. I've been reading a lot of posts on reddit and they all say the same thing: It's due to browser or server restrictions, so it should be done using indexdb.

From a local server, there is no problem, the problem happens when uploading to a server like itch.io.

Right now I have that problem, from my local server everything (using a normal file system) works but when I upload it to itch.io the problems appear.

AThousandShips commented 5 months ago

The server has to support it regardless, I don't know how to specifically set it up for itch though that probably is something to search for online, but if there's a problem with the automated support for this when the server is configured this is a bug to report in the main repo, otherwise, unless it's general configuration steps it's hard to document how to set up for each server type