OK, so now I’m down to 4094 bytes!! Whoo hoo. The game is finished too. I’m, very happy with the results, as it is the exact type of game that I’d like to play.
Some things I learned from people who commented here and from other message boards that I used to get the size down are as follows: (this is all in AS2)
- Using ADPCM compression far audio dropped my already super-compressed .mp3 to 1/4 it’s size.
- Text colors seemed to add size to final .swf, so IIleft most everything white.
- _sans is the only font I used and since it is built-in, it cost me nothing.
- I created as many global vars as possible, including iterators for my loops.
- The Glow Filter may have added bytes, but it sure does make stuff look pretty!
- Limiting text led to a direct 1 to 1 byte drop (as expected)
- Creative use of bit-wise with a polynomial sequence can help you create interesting levels with almost no code (I learned this first hand from “Pitfall” creator David Crane, but I was never able to implement it until now.
- Limiting the names of variables and and constants gave me no net gain at all.
- Getting rid of classes gained me (at least) 250 bytes per class.
Jeff and I are both going to embark on 32K versions of our games to launch once the contest is over. However, since those versions will have fancy title screens, Mochi support, and encryption, they may balloon much higher. However, we like the idea of limiting the core game-play down to a small size. It has been a very beneficial process for both us.
As well, I may work on a 16K version of my game for the Microsoft Mix’09 10K Silverlight Contest. I plan to do some work this week converting it to see if it will even work within the confines of a Silverlight 2.0 app. I’m pretty sure it will, but I have to test it first