Self-updating LÖVE

General discussion about LÖVE, Lua, game development, puns, and unicorns.
Post Reply
Hexxeh
Prole
Posts: 3
Joined: Sun Jul 27, 2008 10:26 am

Self-updating LÖVE

Post by Hexxeh »

So the only place you can write to with the filesystem library is the designated write-access folder for your game. But I'd like to be able to update my game code via the net, so that users don't have to update the client to keep playing on the server. Rather than have to write an Lua module to allow external file write-access, is this something that could be implemented cleanly into an update of LÖVE? The ideal solution would be to be able to write new resources from data received from LuaSocket and update the script itself, then restart the script.
User avatar
mike
Administrator
Posts: 364
Joined: Mon Feb 04, 2008 5:24 pm

Re: Self-updating LÖVE

Post by mike »

So... you want to be able to do the following:
1. Download a file, or more, from the internet (saved to temporary folder)
2. Unzip the .love file that is currently running
3. Replace files in the .love file with new ones that were downloaded
4. Re-zip that motherfucker
5. Restart love
All in one convenient function....

Jesus... it seems like a cool idea, but it also seems a lot of work. I am not sure, but rude and I discussed the manipulation of currently-loaded .love files before (used for saving things inside the file instead of in the designated folder), but scrapped the idea for some reason or other. My suggestion, until rude comes back from exam-land to look over this idea is the following:

Create a script that just downloads everything it needs for the game from the net when it's started, saving it to the default location, and then runs the files from that location. Then you are free to change the files that are downloaded at your leisure and the people who run the script will get the choice to either play what is currently on their computer or look for new updates. The .love file that is passed around is just there for downloading purposes, much like how the new MSN Live Messenger is pushed around.
Now posting IN STEREO (where available)
User avatar
rude
Administrator
Posts: 1052
Joined: Mon Feb 04, 2008 3:58 pm
Location: Oslo, Norway

Re: Self-updating LÖVE

Post by rude »

Yeah, what Mike said.

Writing to the .love-file is not supported by PhysFS, so it is unlikely that it will be added. Remember that the root of the .love file and the root of the write directory are "merged" by PhysFS. For instance, if you want to load "awesome.png", it does not matter if it's in your .love or in the write directory, love.graphics.newImage("awesome.png") will work either way.
User avatar
mike
Administrator
Posts: 364
Joined: Mon Feb 04, 2008 5:24 pm

Re: Self-updating LÖVE

Post by mike »

Ah, so that was the reason. Come to think of it, the solution I suggested could potentially be really cool as a small love utility (much like the extremely awesome console), so if anyone is up for making it, please do.
Now posting IN STEREO (where available)
Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests