Several ways to decrease game size (and possibly increase it's performance)

Darkhog

  • Posts: 1243
This was moved from old forums, because I felt it's important and it still applicable

1. Auto-Convert imported MP3s to static bitrate, 64kbps.

You said that you'd need Fraunhorfer Institute license for that, but I've found out that only applies if you're using their codec. If you use LameMP3 there shouldn't be law issues (and if they're be, you'll just remove lamemp3 codec from SW, as creators of Audacity once did and let users download it by themselves at their own risk)

2. Redefine animation saving routines in SW.

Today animations in SW are saved (and probably later exported to flash) in bars like this:

which is perfectly all right if all frames are different. Look again at the sheet:

Frame 1 and frame 3 are the same (should have same checksum too if they're would be alone). In my opinion better option would be to save every frame as separate PNG and in animation/actor config file just refer to frame order (and if one of frames is the same as one of previously loaded, I mean have same checksum it won't be really imported, but reference would be put).

Sample xml for this file:

Code: [Select]
<animation name="animation name" frameorder="1,2,1,3">and resources will be save in resources folder with names like frame<framenumber>.png. Frames will be shared between all actors in game, so if I import this sheet I've mentioned here so many times to another actor, code in his actor.xml will be the same, maybe only with different animation name.

This solution will prevent to adding same frame graphic into swf/iOS too many times and will make result files smaller.

There are no impossible things. There is only lack of skills.
Don't click this if your computer has less than 641 kilobytes of RAM.
Stencyl stencyling stencylish stencylers :D

irock

  • *
  • Posts: 2891
Convert all MP3s to 64kbps? I don't want my music's bitrate cut in half.

Darkhog

  • Posts: 1243
Only for Flash. It's reasonable compromise between sound quality and file size (normal person with normal audio set won't ever notice difference between 192kbps and 64kbps). Well, either that or 50mb games or falling back to java/developing own web plugin which support OGG.

There are no impossible things. There is only lack of skills.
Don't click this if your computer has less than 641 kilobytes of RAM.
Stencyl stencyling stencylish stencylers :D

irock

  • *
  • Posts: 2891
I have mediocre speakers, yet I can tell a massive difference between a 64kbps audio file and a 128kbps audio file. Your game doesn't have to be 50 megabytes large just because you have 128kbps audio; none of my games exceed 5 megabytes. We shouldn't automatically lower the quality of anything. It's up to the user to compromise quality in the name of size as they see fit.

Rhys

  • Posts: 1046
This is one of the reasons I have a dislike for certain flash movies and games. Noticably bad sound quality; just sounds unprofessional.

If you want to make your sounds and music sound... terrible, then you can compress them on your own with the same effect.

Darkhog

  • Posts: 1243
Rhys, good to know that you want your games sound good. Looking forward your flash games. We'll have to wait half or whole hour (maybe more) to load, but hey! Guess what! It has great sound WHOAH!!!

But let get back on topic - in old thread on old forums I, Hectate and Alexin had nice and productive discussion on this topic

@first post:
Alexin: Most frames differ from each other and it's rare they don't.
I don't believe it's worth the trouble.

Darkhog: Even if 2nd suggestion wouldn't be implemented, the first really should, because music&sound files can take up to 90% of game. Also I don't think case in 2nd suggestion is "pretty rare". I think this is very often that some of frames are the same as other, especially for character walk cycles, flag animations, etc. Also same frame used in one animation can also be used in another. In this case frame "1" in above sheet took from Mambo actor also is used in Idle animation of it and instead of making several copies of it inside game you could just point reference to one frame.

In Poland we have saying "Grosz do grosza, a będzie kokosza" (Penny to penny and we will have chick). It means that even small amount can make difference if it is collected over time.

And so 10 same frames, every 102,4 KB in size used in many different animations/actors will increase size of game by 1MB! So reference thing IS worth effort. But maybe not for b367.

Hectate: The spritesheet suggestion is pretty much how Flixel already does it. I don't know how things are converted in Stencyl, but in Flixel, the artist determines the layout of the sprites, and the coder determines the order that they are used in ("0,1,2,1" for example).

Darkhog: Yeah, I know that, but my concern is frame, the SAME frame is saved to SWF several times, because I remember Jon said that Stencyl handling animations different than Flixel because of frame delays.

Also auto-compression/auto-convert to mp3 would be good, but as I mentioned Fraunhofer's license things applies only if you're using their official codec, not for example LameMP3.

Look at OpenOffice - they don't pay M$ for using their format (.doc, .xls, etc.) and why? Because they don't use MS code, but have rather their own exporter. For MP3 equivalent of "own exporter" is called LameMP3 and FI won't do anything if you use unofficial codec, because it doesn't contain any of their programming (is based upon mp3 format details available to almost everyone and used for example by players, pretty much like OOo exporter to .doc).

So please get back to topic, ok?

There are no impossible things. There is only lack of skills.
Don't click this if your computer has less than 641 kilobytes of RAM.
Stencyl stencyling stencylish stencylers :D

Rhys

  • Posts: 1046
That's why you stream the music; people have something called "broadband" nowadays which is usually faster than 128Kbps so they can stream it fine. If it took me an hour to download audio files then I would be pretty screwed doing anything else online.

PNG files have a very little size per pixel ratio, so it doesn't really matter.
http://imgtops.sourceforge.net/bakeoff/o-png24.png
Try to load this image. Should be about the size of a tileset, right? Should go really fast - even on my poor connection.

Music and sound files take up 90% or more of every game. The only games that have less than 50% are calculation applications and games that generate their music and graphics at Runtime. (A new zero)

Also, I don't see how discussing one of the points you made from a negative perspective is off topic. Is it only on topic if it is positive?

knhirt

  • Posts: 9
I have to say that I agree with the rest of the posters here about audio quality. Audio is pretty much integral to most games that I enjoy - mandatory degradation of audio in Stencyl would be a killer.

HNF

  • Posts: 232
Honestly, I can tell if music is at an average quality (128 kbps), and it sounds unprofessional and low quality to reduce the quality even more.

If you have a lot of music, you can stream it from another source.

Darkhog

  • Posts: 1243
If you have a lot of music, you can stream it from another source.

Primo: Stencyl have no easy to use solution for streaming (only stream pack by HNF which isn't very friendly even with custom blocks)

Secundo: Even if it had such solution I simply don't know from where I could stream it - my host - Quotaless forbids to use account for file storage and even if music is a part of my games they may not see it that way. Otherwise it's great free hosting with pretty big space and no ads. And server of my friend who could host my music pretty often is down. And no - I have no money for paid service.

There are no impossible things. There is only lack of skills.
Don't click this if your computer has less than 641 kilobytes of RAM.
Stencyl stencyling stencylish stencylers :D

Joe

  • *
  • Posts: 2478
HNF, would you want to write up a quick doc page for the streaming pack?

Chris

  • Posts: 84
Darkhog, try out Dropbox. It'd be perfect for your needs, and it has a Linux client.

HNF

  • Posts: 232
HNF, would you want to write up a quick doc page for the streaming pack?
Sure, I'll start documenting various custom block packs I've created. I'll probably have to do it anyway before public beta.

Quote
Secundo: Even if it had such solution I simply don't know from where I could stream it - my host - Quotaless forbids to use account for file storage and even if music is a part of my games they may not see it that way. Otherwise it's great free hosting with pretty big space and no ads. And server of my friend who could host my music pretty often is down. And no - I have no money for paid service.
I agree with Chris that Dropbox is a good solution. Can box.net stream music? I'm not sure.

Darkhog

  • Posts: 1243
Darkhog, try out Dropbox. It'd be perfect for your needs, and it has a Linux client.

Yeah, it's perfect for my needs except one little fact. When you not log in for certain time they delete your account (even if someone else downloaded file day before that). It happened to my friend and me some time ago.

There are no impossible things. There is only lack of skills.
Don't click this if your computer has less than 641 kilobytes of RAM.
Stencyl stencyling stencylish stencylers :D

irock

  • *
  • Posts: 2891
If you're concerned about them possibly deleting files after 90 days of inactivity, then use Dropbox every 90 days.