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?
- zorg
- Party member
- Posts: 3465
- Joined: Thu Dec 13, 2012 2:55 pm
- Location: Absurdistan, Hungary
- Contact:
Re: How to reduce size of final build?
Hi and welcome to the forums!
The newest version of löve has 7 dll files included (clocking in at almost 9 MB); you can't do anything about that.
Your pong game itself is probably just a few kilobytes, or even less. The running environment (löve itself, along with all the stuff it needs to work with luaJIT, handle video, interact with windows, handle sound through OpenALSoft, and most things through SDL) is what's taking up the most space.
You have two choices; first, you could try and see if an older löve version is still suitable for your needs, although people including me will try to dissuade you from that for multiple reasons.
The other option is to distribute only the .love file (a renamed zip archive of your code [and assets] only) and ask people to install/download löve separately... that will drastically reduce the size, and is what i would recommend... at least as an option.
The newest version of löve has 7 dll files included (clocking in at almost 9 MB); you can't do anything about that.
Your pong game itself is probably just a few kilobytes, or even less. The running environment (löve itself, along with all the stuff it needs to work with luaJIT, handle video, interact with windows, handle sound through OpenALSoft, and most things through SDL) is what's taking up the most space.
You have two choices; first, you could try and see if an older löve version is still suitable for your needs, although people including me will try to dissuade you from that for multiple reasons.
The other option is to distribute only the .love file (a renamed zip archive of your code [and assets] only) and ask people to install/download löve separately... that will drastically reduce the size, and is what i would recommend... at least as an option.
Me and my stuff True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
Re: How to reduce size of final build?
For code you can use a code minifier (though the code is probably the smallest thing in any project). For PNGs, use Pngcrush. Use a lossy format for sounds instead of lossless.
As zorg says, distributing a .love file will save you the size of the binaries, but then you're relying on the end user installing a dependency and having to launch the game in a specific way or else things may break (i.e. the wrong version of LÖVE being used).
I'm curious why you want to reduce the size? 10 MB is close to nothing at all, even if it's a small game. Modern computers have lots of storage.
As zorg says, distributing a .love file will save you the size of the binaries, but then you're relying on the end user installing a dependency and having to launch the game in a specific way or else things may break (i.e. the wrong version of LÖVE being used).
I'm curious why you want to reduce the size? 10 MB is close to nothing at all, even if it's a small game. Modern computers have lots of storage.
Tools: Hot Particles, LuaPreprocess, InputField, (more) Games: Momento Temporis
"If each mistake being made is a new one, then progress is being made."
"If each mistake being made is a new one, then progress is being made."
-
- Prole
- Posts: 6
- Joined: Wed Sep 04, 2019 5:15 pm
Re: How to reduce size of final build?
Thanks for advices. Well I'm that kind of guy who likes minimalism and is bit too ambitous also it's a good way to train writing clean code and maxing out hardware limitations. Like Carmack said "if it runs doom..."
Re: How to reduce size of final build?
Like ReFreezed said, compressing your PNGs is a great way to do it.
Make sure your PNGs are indexed-color, that's considerably smaller than having an alpha channel.
PNGGauntlet is another good program for optimizing your PNGs.
Also use FLAC or OGG instead of WAV.
Make sure your PNGs are indexed-color, that's considerably smaller than having an alpha channel.
PNGGauntlet is another good program for optimizing your PNGs.
Also use FLAC or OGG instead of WAV.
- zorg
- Party member
- Posts: 3465
- Joined: Thu Dec 13, 2012 2:55 pm
- Location: Absurdistan, Hungary
- Contact:
Re: How to reduce size of final build?
Or go tracker format, that can be even smaller
Me and my stuff True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
Re: How to reduce size of final build?
Zopfli compressing possible files is also always an option. Possible files are:
[*] Your .love file using AdvanceCOMP
[*] PNG files using zopflipng
[*] Any data that's compressed using zlib or gzip format using zopfli
[*] Your zipped game distribution files using AdvanceCOMP
Note that compressing single file in zopfli is 80 times slower! So you may want to do that only when you really distributing your game.
[*] Your .love file using AdvanceCOMP
[*] PNG files using zopflipng
[*] Any data that's compressed using zlib or gzip format using zopfli
[*] Your zipped game distribution files using AdvanceCOMP
Note that compressing single file in zopfli is 80 times slower! So you may want to do that only when you really distributing your game.
Profile. Do you encounter crashes in LÖVE Android and wanna send me logcats? Please hit me up in LÖVE Discord and send the full logcat file!
Re: How to reduce size of final build?
You can also compress it to 7z, but beware that the decompression time is slower.
Re: How to reduce size of final build?
a simple games can be easily written in pure SDL c/c++VanBandama wrote: ↑Sun Jul 19, 2020 9:48 pm Thanks for advices. Well I'm that kind of guy who likes minimalism and is bit too ambitous also it's a good way to train writing clean code and maxing out hardware limitations. Like Carmack said "if it runs doom..."
and there is also tiny library called LodePNG
i as well im not fan of heavy game engines like unity for 2d games
Who is online
Users browsing this forum: No registered users and 0 guests