Hi!
I was wondering how to trim/ optimize my game in size? I did pong step by step from cs50 and got around 6 mb. That's a lot for simple game like pong, so I compared it to mari0 and found that (mari0) has sdl, openal32 and DevIL dll's. And my game has msvcp,msvcr and love dll's alongside previously mentioned.
Is there a way to make it smaller besides zipping it? In haxeflixel I used -dce (dead code elimination) command for that.
Thanks for your time
How to reduce size of final build?
Re: How to reduce size of final build?
Maybe you should optimize images, sounds, etc, because often code is only ~5-10% of game's size and other ~90-95% it's assets like sounds, images, etc
Re: How to reduce size of final build?
The way you zip the love file can also affect its final size. Make sure to choose the slowest and highest level of compression.
PNGGauntlet can reduce the size of PNGs considerably and FLAC/OGG is considerably smaller than WAVs.
You could also try minifying the Lua code, using something like https://github.com/2dengine/love.maker
PNGGauntlet can reduce the size of PNGs considerably and FLAC/OGG is considerably smaller than WAVs.
You could also try minifying the Lua code, using something like https://github.com/2dengine/love.maker
Last edited by ivan on Sat Dec 11, 2021 8:16 am, edited 1 time in total.
Re: How to reduce size of final build?
Does anyone know maybe it will be possible to build love2d without OpenAL and Box2d, because the game does not need sound and physics?
- Gunroar:Cannon()
- Party member
- Posts: 1143
- Joined: Thu Dec 10, 2020 1:57 am
Re: How to reduce size of final build?
Maybe in conf.lua you could disable love.physics. I heard that will not include the library in build, but I might be wrong.
-
- Party member
- Posts: 559
- Joined: Wed Oct 05, 2016 11:53 am
Re: How to reduce size of final build?
That prevents love.physics from being loaded and thus probably in small part reduces the runtime RAM usage of löve, but any disabled modules are still very much present in the executable and love.dll. lucked and azoyan are talking about reducing the file size of the shipped game, and for that you'd basically have to build löve from source with the unnecessary modules removed or commented out; conf.lua does nothing there. That should be feasible, but you'll probably have to pull the source code from github and do the stuff yourself.
However, I think that'll only have a rather small impact on the overall file size of your game. Maybe 1-3MB at most in a very generous case, not at all familiar with how much Box2d and OpenAL add together. Considering löve is about 10MB total by itself (according to my Windows machine anyway), that's rather small save (in terms of magnitude) - and great many indie titles today are far larger than that. You're probably better off taking ivan's advice, unless your game doesn't use any external art assets and instead relies purely on love.graphics.rectangle, love.graphics.line, and such. Usually the storage capacity is much less of an issue than any runtime memory usage when it comes to today's games, even if I do dislike modern triple A titles for having uncompressed audio in the tens of gigabytes in their installations.
However, I think that'll only have a rather small impact on the overall file size of your game. Maybe 1-3MB at most in a very generous case, not at all familiar with how much Box2d and OpenAL add together. Considering löve is about 10MB total by itself (according to my Windows machine anyway), that's rather small save (in terms of magnitude) - and great many indie titles today are far larger than that. You're probably better off taking ivan's advice, unless your game doesn't use any external art assets and instead relies purely on love.graphics.rectangle, love.graphics.line, and such. Usually the storage capacity is much less of an issue than any runtime memory usage when it comes to today's games, even if I do dislike modern triple A titles for having uncompressed audio in the tens of gigabytes in their installations.
Re: How to reduce size of final build?
See also:
https://love2d.org/forums/viewtopic.php?f=3&t=89168
https://love2d.org/forums/viewtopic.php?f=4&t=85799
FWIW, Löve 0.3-1 has the modules as shared libraries, so you only include the ones you need. https://sourceforge.net/projects/love/files/love/
https://love2d.org/forums/viewtopic.php?f=3&t=89168
https://love2d.org/forums/viewtopic.php?f=4&t=85799
FWIW, Löve 0.3-1 has the modules as shared libraries, so you only include the ones you need. https://sourceforge.net/projects/love/files/love/
Who is online
Users browsing this forum: No registered users and 4 guests