Distributing your games (making a .love file)

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.
philnelson
Prole
Posts: 48
Joined: Sun Feb 01, 2009 3:32 am

Re: Distributing your games (making a .love file)

Post by philnelson »

That's precisely what I was hoping someone would say, Joe.
User avatar
mike
Administrator
Posts: 364
Joined: Mon Feb 04, 2008 5:24 pm

Re: Distributing your games (making a .love file)

Post by mike »

Moved to support (to try to pre-empt someone who is about to make a support thread about it).
Now posting IN STEREO (where available)
User avatar
Jasoco
Inner party member
Posts: 3726
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:

Re: Distributing your games (making a .love file)

Post by Jasoco »

I just tried that trick of simply adding .love to the end of a folders name and it worked perfectly when I double-clicked it on my Mac.

Which is awesome, because for some reason, OS X's built-in ZIP archive creator creates incompatible files. Not sure why.
User avatar
mike
Administrator
Posts: 364
Joined: Mon Feb 04, 2008 5:24 pm

Re: Distributing your games (making a .love file)

Post by mike »

Jasoco wrote:I just tried that trick of simply adding .love to the end of a folders name and it worked perfectly when I double-clicked it on my Mac.
What? How? Macs are weird...
Now posting IN STEREO (where available)
User avatar
appleide
Party member
Posts: 323
Joined: Fri Jun 27, 2008 2:50 pm

Re: Distributing your games (making a .love file)

Post by appleide »

You have to open the folder, select all items, right click Archive... then rename the resulting zip.

Mike: I made it so. so I can open the lua files in an editor, then after editing code, just save and double click. I'm sorry for the incompatible mess it might have resulted when the users try to distribute said .love files. :(

Also... when safari downloads properly packaged .love files, safari automatically unzips everything, which is very annoying, the quickest way to fix it is just rename the folder rather than re-zip the contents....
User avatar
Jasoco
Inner party member
Posts: 3726
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:

Re: Distributing your games (making a .love file)

Post by Jasoco »

appleide wrote:You have to open the folder, select all items, right click Archive... then rename the resulting zip.
That worked for me. Thanks, I was compressing the folder, not the contents. Oops! Beginners mistake!
mike wrote:
Jasoco wrote:I just tried that trick of simply adding .love to the end of a folders name and it worked perfectly when I double-clicked it on my Mac.
What? How? Macs are weird...
It becomes a package when the correct extension is added.

Windows doesn't support packages. (If it did, life would be so much simpler for programmers and GUI modifiers)

A package is a folder with a specific extension (.app for applications, .widget for Konfabulator widgets, .pkg for installers, etc..) that acts like a single file or application in the OS. In other words, when you open it, the OS treats it like a file instead of a folder.

Smartest idea ever.

In fact, when Konfabulator was ported to Windows, they had to stop using the package format and, well, basically do the same thing you guys do by zipping the files and renaming the extension. In other words, if I tried to give a Windows user my "packaged" .love folder, it would appear as a folder to them. Not as a file. OS X will treat a file with the same extension as a folder with that extension as a file.

The benefit of packages over single binaries for applications is that you can dig inside the "file" and change the resources without needing special tools. Don't like the icon the app uses in the Dock? Don't like what the toolbar icons look like? Change them in your favorite image editor.

Image
The file on the left is a folder. The one on the right the original zipped file. Both act exactly the same on OS X.

Thus concludes my lecture on packages versus archived LÖVE files. Class dismissed. See you in the fall.
User avatar
Tenoch
Citizen
Posts: 76
Joined: Mon Jul 21, 2008 7:49 am

Re: Distributing your games (making a .love file)

Post by Tenoch »

About releasing for Mac OS, I made an epic cheat for my project (http://love2d.org/forum/viewtopic.php?f=5&t=791).

I didn't want the user to have to drag a ".love" file over a "love" app, which would have brought nothing but questions and problems, so I did:
  • rename poyta.love to poyta.poyta
  • modified the Resources in the love.app bundle (removed everything and replaced with just a new icon file)
  • modified the Info.plist in the love.app bundle so that it uses the new icon, and defines the document extension .poyta as his, as well as the same icon for this document type
  • renamed the bundle to something stupid like "data.app"
Now, thanks to extensions hiding, the real app appears as the totally harmless "data", and the love file as "poyta", and both have the icon. And double-clicking poyta automatically launches the real app, which is fine.

Of course it's not perfect since if someone doubleclicks "data", they get the fancy "no game" LÖVE screen.

Well, all this to say that it would be easier if we could include the .love inside the bundle. By renaming it, and changing its icon, it would make a nice release system already.
"When in doubt, use brute force." Ken Thompson
User avatar
Jasoco
Inner party member
Posts: 3726
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:

Re: Distributing your games (making a .love file)

Post by Jasoco »

Would be nice if eventually each LÖVE app had its own way of creating real executable apps for each OS at the click of a button. Or a menu item in the LÖVE menubar. For Windows it would dump all the stuff into a .EXE file, on OS X it would create an application bundle that contains the runtime and an optional encryption algorithm so you can decide whether or not you want the end user to be able to open the .love file and view the code or not.
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: Distributing your games (making a .love file)

Post by bartbes »

You do know that's already possible, however OS X gives the problems here, windows is done, and linux should be done, never tested that though..
User avatar
Tenoch
Citizen
Posts: 76
Joined: Mon Jul 21, 2008 7:49 am

Re: Distributing your games (making a .love file)

Post by Tenoch »

On Linux:

cat `which love` game.love > game
chmod u+x game

works like a charm. Just remember to tell your players to install the libraries on which LÖVE depends.
"When in doubt, use brute force." Ken Thompson
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Google [Bot] and 2 guests