Only Packaging Some Files in the .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.
Post Reply
User avatar
pyxledev
Prole
Posts: 27
Joined: Tue Jul 26, 2022 2:19 pm
Contact:

Only Packaging Some Files in the .love File?

Post by pyxledev »

I was wondering if there was a way to package only the necessary files in the .love file (e.g. script files) so that the large sound & image files would be left out. Because I just find it weird that everything about the game is compressed down to an exe file, which makes it around 50MB in my case.

Is there a way to do this? I've tried, but it ends up giving errors. It'd also give opportunity to the user to make their own resource packs & such.
MrFariator
Party member
Posts: 559
Joined: Wed Oct 05, 2016 11:53 am

Re: Only Packaging Some Files in the .love File?

Post by MrFariator »

If you go searching the forums, you'll find plenty examples of people asking about how to make love.filesystem point outside the project/.love or save directory. One often suggested approach is using native-fs library. To my knowledge, 12.0 will add the ability to mount other paths, which will make it possible to do what you're asking.

However, if you want players to be able to make their own resource packs, you can also make use of the "appendidenitity" option in conf.lua. If you set it to false, love.filesystem will look in your game's save directory first, the source directory second. So long the folder structure in both places is similar, you can give players the ability to override assets or behavior.
Rigachupe
Party member
Posts: 100
Joined: Fri Jun 18, 2021 11:21 am

Re: Only Packaging Some Files in the .love File?

Post by Rigachupe »

pyxledev wrote: Tue Jul 23, 2024 4:43 pm I was wondering if there was a way to package only the necessary files in the .love file (e.g. script files) so that the large sound & image files would be left out. Because I just find it weird that everything about the game is compressed down to an exe file, which makes it around 50MB in my case.

Is there a way to do this? I've tried, but it ends up giving errors. It'd also give opportunity to the user to make their own resource packs & such.
This should help the investigation of yours : love.filesystem.mount and love.filesystem.unmount

Mounts a zip file or folder in the game's save directory for reading. It is also possible to mount love.filesystem.getSourceBaseDirectory if the game is in fused mode.

Example from the wiki page:
-- Assuming content.zip exists in the game's save directory and contains a file called 'myimage.png'.
love.filesystem.mount("content.zip", "content")

assert(love.filesystem.getInfo("content/myimage.png") ~= nil)
User avatar
togFox
Party member
Posts: 828
Joined: Sat Jan 30, 2021 9:46 am
Location: Brisbane, Oztralia

Re: Only Packaging Some Files in the .love File?

Post by togFox »

You'll need to be clear with your user base that a one time full installation is needed before benefiting from smaller patches but yeah - often thought about this but never bothered to try it.
Last project:
https://togfox.itch.io/hwarang
A card game that brings sword fighting to life.
Current project:
Idle gridiron. Set team orders then idle and watch: https://togfox.itch.io/idle-gridiron
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 4 guests