Page 2 of 3

Re: How to load a file from game directory

Posted: Fri Sep 28, 2012 12:11 pm
by OmarShehata
Robin wrote: Also, I don't care how you distribute your games, but every time you use Lua's IO library in a LÖVE project, god kills a kitten.
I don't see what's so wrong about that. Wouldn't a game with C++ have the same access to your files? So if you trust to run an exe then that shouldn't be a problem. (Unless you mean when distributing your game as a .love)

Also, keeping assets out of the exe can be useful especially if you want people to mod your game. Or update/edit graphics and other files without recompiling anything.

Re: How to load a file from game directory

Posted: Fri Sep 28, 2012 12:56 pm
by Robin
OmarShehata wrote:(Unless you mean when distributing your game as a .love)
Yeah, this basically is about LAAP vs LAAF (LÖVE As A Platform/Framework). I might be a bit biased. :P
OmarShehata wrote:Also, keeping assets out of the exe can be useful especially if you want people to mod your game. Or update/edit graphics and other files without recompiling anything.
We have the save directory for that. :)

Re: How to load a file from game directory

Posted: Fri Sep 28, 2012 3:01 pm
by slime
Robin wrote: We have the save directory for that. :)
The save directory is an extremely poor solution for that. Say I have 150MB of art, sound, and music assets. Why should I be forced to copy them all to a separate directory just so people have marginally less trouble accessing and changing them? Plus, the save directory can be in pretty obscure locations depending on OS.

Re: How to load a file from game directory

Posted: Fri Sep 28, 2012 5:31 pm
by luaz
What about game saves? What if the guy wants to play on multiple computers? It isn't practical to copy the WHOLE GAME to be able to do that, a simple game save folder weighting <1mb is much more practical.

Re: How to load a file from game directory

Posted: Fri Sep 28, 2012 5:33 pm
by qaisjp
luaz wrote:What about game saves? What if the guy wants to play on multiple computers? It isn't practical to copy the WHOLE GAME to be able to do that, a simple game save folder weighting <1mb is much more practical.
Jesus, the pictures go inside the .love (or .exe - whatever); the saves go in the appdata folder.

love.filesystem can only write to the following: "Inside the .love"; "Inside the appdata folder"

Re: How to load a file from game directory

Posted: Fri Sep 28, 2012 5:42 pm
by luaz
qaisjp wrote:
luaz wrote:What about game saves? What if the guy wants to play on multiple computers? It isn't practical to copy the WHOLE GAME to be able to do that, a simple game save folder weighting <1mb is much more practical.
Jesus, the pictures go inside the .love (or .exe - whatever); the saves go in the appdata folder.

love.filesystem can only write to the following: "Inside the .love"; "Inside the appdata folder"
What if it's XP or older system? What if it's Linux or MacOS?

Re: How to load a file from game directory

Posted: Fri Sep 28, 2012 5:47 pm
by qaisjp
luaz wrote:
qaisjp wrote:
luaz wrote:What about game saves? What if the guy wants to play on multiple computers? It isn't practical to copy the WHOLE GAME to be able to do that, a simple game save folder weighting <1mb is much more practical.
Jesus, the pictures go inside the .love (or .exe - whatever); the saves go in the appdata folder.

love.filesystem can only write to the following: "Inside the .love"; "Inside the appdata folder"
What if it's XP or older system? What if it's Linux or MacOS?
%appdata%... every system has a similar thing.
love.filesystem
This module provides access to Files in two places, and two places only:

The root folder of the .love archive (or source directory)
The root folder of the game's save directory.
Each game is granted a single directory on the system where files can be saved through love.filesystem. This is the only directory where love.filesystem can write files. These directories will typically be found in something like:

Windows XP: C:\Documents and Settings\user\Application Data\Love\ or %appdata%\Love\
Windows Vista and 7: C:\Users\user\AppData\Roaming\LOVE or %appdata%\Love\
Linux: $XDG_DATA_HOME/love/ or ~/.local/share/love/
Mac: /Users/user/Library/Application Support/LOVE/

Re: How to load a file from game directory

Posted: Fri Sep 28, 2012 5:49 pm
by josefnpat
Robin wrote:
OmarShehata wrote:(Unless you mean when distributing your game as a .love)
Yeah, this basically is about LAAP vs LAAF (LÖVE As A Platform/Framework). I might be a bit biased. :P
OmarShehata wrote:Also, keeping assets out of the exe can be useful especially if you want people to mod your game. Or update/edit graphics and other files without recompiling anything.
We have the save directory for that. :)
I guess this is the heart of the matter here is exactly LAAP vs LAAF.

I agree with slime that the love.filesystem leaves something to be desired. I agree it should be used whenever one can.

Like I said, as long as you exhaust all alternatives, I think it's fine to go with solutions that aren't entirely within the love philosophy. Sometimes one has to kill kittens to get the job done. (Now this is an argument of `do the ends justify the means`?)

Re: How to load a file from game directory

Posted: Fri Sep 28, 2012 7:37 pm
by Przemator
What if I want to distribute the game as EXE, but would like users to create custom maps/levels/mods and share them? Then they would be forced to put the mod inside the save folder?

Re: How to load a file from game directory

Posted: Fri Sep 28, 2012 7:50 pm
by Nixola
Either that, or extract the .exe's contents, modify them and repacking it, and then distribute modified copies.