TWiLightMenu icon indicating copy to clipboard operation
TWiLightMenu copied to clipboard

Reduce file size?

Open mariomadproductions opened this issue 5 years ago • 6 comments

Currently the app is quite large for a DS homebrew.

Some ideas for reducing the size of the data:

  • Instead of PNGs, use tiled image formats, lossy compressed graphics, GIF, or maybe vector graphics(?).
  • Instead of wav/raw audio, use compressed sound formats, or even implement sequenced audio (that's what was used in the DSi System Menu).
  • Text/config files could definitely be compressed

Apologies if this comes off as interfering or rude. It just seems like a sensible idea.

mariomadproductions avatar Nov 04 '20 18:11 mariomadproductions

  • We actually switched from BMP to PNG files to reduce file size. GIF files are used in the DS(i) splash screen and the manual.
  • Unfortunately, MaxMod cannot play compressed audio, afaik. As for sequenced audio, it could work by implementing each instrument into the soundbank, and then implement some kind of sequence system in arm7. idk how the music file would be layed out though.
  • idk how that could/would work. :P

RocketRobz avatar Nov 04 '20 19:11 RocketRobz

PNG and RAW audio are used for ease of customization. We used to use BMPs before which were even larger and still were harder to customize.

As with many things there is always a time-space tradeoff with compression. SD card space might be at a more of a premium than other mediums but CPU time is the most precious resource on the DS. More heavy compression (especially with time sensitive audio) might be pretty infeasible with the slow ARM CPUs if we want to keep up any semblance of performance.

chyyran avatar Nov 04 '20 19:11 chyyran

I guess the solution to the "ease of customization" in regard to images is to provide simple tools to convert from png to whatever smaller format. For images, compression doesn't necessarily need to be used to reduce the file size. Tiled graphics, like commercial games use, can be smaller without requiring any or much extra CPU time.

mariomadproductions avatar Nov 04 '20 19:11 mariomadproductions

There are certain structural reasons why tiled graphics would be difficult with the current VRAM layout and graphics libraries... It's something to be improved on but will require a lot of work. Not to mention that the tools available to create and edit tilemaps aren't the most documented.

chyyran avatar Nov 04 '20 19:11 chyyran

#1411 reduces file size considerably overall, since the AP patches no longer have to be in separate files

Peter0x44 avatar Apr 16 '21 20:04 Peter0x44

LTO has also reduced file size slightly. 4f0e04480

RocketRobz avatar Apr 04 '24 09:04 RocketRobz