i was wondering how to add a system to check for updates, download them and run the game with the new files.
im not even sure if this is possible
dynamic updates or patches
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
- zorg
- Party member
- Posts: 3470
- Joined: Thu Dec 13, 2012 2:55 pm
- Location: Absurdistan, Hungary
- Contact:
Re: dynamic updates or patches
It is possible, but it's a bit involved; There were a few threads about this before, but the most compelling mode i saw was the following:
- Only have the auto-updater/downloader part in your project (may not be that necessary, but would be cleaner this way), or a splash screen, maybe permitting some settings.
- It would download the code and assets into the save folder (should do it in a <version_number> subfolder if you ask me) of the project, since that's the only location you can write to.
- Have a file there that contains which version you want to run
- love.filesystem.load or require in the <version_number>/game lua file, and call love.load that should exist in it, and boom, you have implemented a thing.
- Only have the auto-updater/downloader part in your project (may not be that necessary, but would be cleaner this way), or a splash screen, maybe permitting some settings.
- It would download the code and assets into the save folder (should do it in a <version_number> subfolder if you ask me) of the project, since that's the only location you can write to.
- Have a file there that contains which version you want to run
- love.filesystem.load or require in the <version_number>/game lua file, and call love.load that should exist in it, and boom, you have implemented a thing.
Me and my stuff True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
Re: dynamic updates or patches
I've been attempting to do this, and while I do not have working system yet, I can give a few pointers for sure.
First off, you'd need some kind of (async) script that can download and save code from a server.
Some kind of wrapper for http.request in a thread would do the trick.
Next, as Zorg said you can download everything at mygamedomain.com/version_x_x_x/ into a folder with the version name, and just execute that.
Alternativly you could keep track of every "version" of every file on your server, and only download the ones that are a newer version that you have locally. This may be tricky though.
Then you can run them with love.filesystem.load.
First off, you'd need some kind of (async) script that can download and save code from a server.
Some kind of wrapper for http.request in a thread would do the trick.
Next, as Zorg said you can download everything at mygamedomain.com/version_x_x_x/ into a folder with the version name, and just execute that.
Alternativly you could keep track of every "version" of every file on your server, and only download the ones that are a newer version that you have locally. This may be tricky though.
Then you can run them with love.filesystem.load.
Re: dynamic updates or patches
Surely you could have mygamedomain.com/latest, have that link to the latest version and have the game check if that version number is newer than the current, and if so download it.Tjakka5 wrote:Alternatively you could keep track of every "version" of every file on your server, and only download the ones that are a newer version that you have locally. This may be tricky, though.
Learning to Löve.
- Jasoco
- Inner party member
- Posts: 3727
- Joined: Mon Jun 22, 2009 9:35 am
- Location: Pennsylvania, USA
- Contact:
Re: dynamic updates or patches
I bought into the Concerned Joe preview and they way they did it is they used two separate Löve projects. What you would download is a launcher and update checker which would show news and updates and if you want to update the game or it's your first launch, it would download the files for the actual game into its own folder and launch that .love project separately.
Minecraft Launcher and the Steam app both work the same way. The Launcher is just a launcher which downloads the appropriate Java files into their own folders and launches them as a separate process. And Steam is just a front end that downloads all the needed files when you run it so you can have a tiny compact installer and it makes it easier for them to update later.
Minecraft Launcher and the Steam app both work the same way. The Launcher is just a launcher which downloads the appropriate Java files into their own folders and launches them as a separate process. And Steam is just a front end that downloads all the needed files when you run it so you can have a tiny compact installer and it makes it easier for them to update later.
Re: dynamic updates or patches
You can also check this out to get an idea of how to make an (albeit, somewhat unsafe) auto-updater.
GitHub | MLib - Math and shape intersections library | Walt - Animation library | Brady - Camera library with parallax scrolling | Vim-love-docs - Help files and syntax coloring for Vim
Who is online
Users browsing this forum: Bing [Bot] and 3 guests