dynamic updates or patches

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
User avatar
adekto
Prole
Posts: 35
Joined: Thu Dec 06, 2012 11:42 am

dynamic updates or patches

Post by adekto »

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
User avatar
zorg
Party member
Posts: 3436
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

Re: dynamic updates or patches

Post by zorg »

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. :3
Me and my stuff :3True 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.
User avatar
Tjakka5
Party member
Posts: 243
Joined: Thu Dec 26, 2013 12:17 pm

Re: dynamic updates or patches

Post by Tjakka5 »

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.
User avatar
skyHights
Citizen
Posts: 78
Joined: Mon Aug 25, 2014 12:14 pm

Re: dynamic updates or patches

Post by skyHights »

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.
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.
Learning to Löve.
User avatar
Jasoco
Inner party member
Posts: 3725
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:

Re: dynamic updates or patches

Post by Jasoco »

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.
davisdude
Party member
Posts: 1154
Joined: Sun Apr 28, 2013 3:29 am
Location: North Carolina

Re: dynamic updates or patches

Post by davisdude »

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
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 44 guests