Saturday, November 20, 2010

Blue Skies v1.15

  - Bug Fix: Moon image not showing up on some handsets
  - Update: Stars twinkle more
  - Update: Balloons light better

The moon thing is actually a bit odd, let's discuss that.  Basically, if you dig back in the archives far enough, you'll find a post about Android incorrectly premultiplying PNG files.  What I did to work around that was implement a loader for TGA images, which generally works well.  As a bonus I got support in for greyscale luminance textures that way as well, which has definitely saved some memory here and there.

Now, since TGA isn't a native Android image format, the program that builds the APK package compresses it to save space, like when you're making a ZIP file.  The standard formats of PNG and JPG don't get this compression, since they're compressed already and it's a waste.

Once you have a compressed file in your APK, what happens later on is you open the file and attempt to read it.  The system transparently decompresses it into memory to allow this, so you yourself don't need to deal with the compression at all.  You read the file and close it, the systems throws away the temporary decompressed version, and all is well.

The wrinkle is that this temporary buffer it puts things into has a size limit, of around 512k.  If the file in question is bigger than that, it'll just fail to open and you're out of luck.  That's what happened here, the uncompressed TGA file for the moon was bigger than 512k, so the file didn't open, so my TextureManager class just returned an empty white image.  Now the question is, how did I manage to miss this?  Don't I ever test anything?

Well, that's the trick.  Some of the manufacturers raise this limit.  I know Motorola and HTC do -- to what, I'm not sure.  I've run into this before, and I know to pay attention to it, but since I was testing primarily on an HTC Incredible, it worked just fine and I forgot to double-check it.  It worked on a Droid 2 as well.  It does not, however, work on something like a G2 or a Nexus One that's running stock Android.

So what can you do to work around this?  Annoyingly, the Eclipse ADK doesn't support any way to tell a file to store uncompressed.  If you write an ANT script or something you can do that, but the Eclipse build process won't let you.  However, if you want to work around THAT, you can change the filename extension to something like JPG, and the Eclipse build process will automatically skip compressing it, and you can make your file as big as you like.  I mean, hey, the Android resource process doesn't use extensions anyway, right?

So, to summarize:  Careful about non-native file sizes in your package files, if it's larger than half a meg you might run into trouble.

EDIT:  It looks like the 'assets' folder can be used for the purpose of non-compressed files, which somehow or other I missed the last time I was researching this.  I'll have to try this next go-round.

Friday, November 19, 2010

Blue Skies v1.1

  - New Feature: Stars at night
  - Bug Fix: Flickering clouds

I thought I had the flickering issue fixed with an adjustment to my sorting function, but I was wrong.  As it turned out, the sorting has been fine all along.  Here's what the bug actually was.

Basically, the clouds move towards the camera.  As they get close they alpha out, and once they pass a certain point they teleport back to their distant starting position.  This gets us the infinite-supply-of-clouds look.

Cool, except that when I moved them back to the start I was moving them explicitly to CLOUD_START_Y.  Since their movement is time-adjusted based on the framerate, they'd gradually drift relative to the other clouds as fractions of a value got knocked off.  Eventually, you'd end up with two clouds really close to each other, and then you'd get a framerate hitch or something, and have two clouds get teleported within the same frame.

Once that happens, those two clouds end up sitting in the exact same spot forever, effectively.  The sorting code would work its way through the list, and occasionally slight rounding errors would result in them being sorted in a different order, then back again a bit later.  This is where the flickering look came from.  This also explains why I never saw the problem yesterday -- I was restarting the wallpaper periodically as I tested things, and it takes quite a while to manifest, somewhere around 20-30 minutes.

The fix for all this is to calculate CLOUD_START_Y - CLOUD_VANISH_Y and subtract that value from the cloud's existing Y origin.  This means everything stays spaced the same relative to each other, and the flickering doesn't occur.

While doing this, I added stars that fade in during the night, since I got that as a comment.  :)

Thursday, November 18, 2010

Blue Skies v1.05

  - New Feature: Time of Day cycling
  - New Feature: Sun and Moon
  - Bug Fix: Flickering clouds

Since the first thing people always ask for is time of day shifting, here it is!  This one was kind of tricky to get looking good, as it's fairly fill-rate expensive already so I'm trying to avoid blending from one background to another and do everything with color tinting.  In the process I added a moving sun and moon that key off the time of day as well.  The sun is always there, and the moon only shows up if you have time of day enabled.

The occasional cloud flickering you might have seen was due a bug in my sorting code, it should be smoothed out now.

EDIT:  I tell a lie, the flickering still happens.  Amazing, I didn't see it the entire time I was testing the time of day stuff, then see it happen right after I publish the update.  I guess that's tomorrow's task.

Wednesday, November 17, 2010

Lots of Updates for the HowTo Activity

We get a lot of e-mail from folks confused about how to use the wallpaper they just downloaded, and while several of these have the open button set up with a popup that takes you to the live wallpaper chooser, several of the products are still missing this.

I'd like to get this to be consistent, so in the name of pulling the band-aid right off, we'll be pushing a number of updates over the next couple of days to make our handling of this consistent.  Sorry for any inconvenience, folks!

Tuesday, November 16, 2010

NA Flags Free

As it's been a slow seller for quite a while, I just put a free version of NA Flags up on the market.  It's an attractive wallpaper with really nice animation, in my opinion, but it doesn't show well in a static screenshot -- I'm hoping a free version being available will help get folks to check it out.

Aquarium v2.2

  - Update: Old default background is available again
  - Update: Two new fish!
  - Bug Fix: Fish shouldn't get stuck refusing to eat

Nothing huge here, but the 'fish not eating' but was not obvious to reproduce, read a few posts down for an explanation.  :)

Monday, November 15, 2010

Blue Skies Live Wallpaper v1.0

( Android Market link )
( YouTube link )

Consider this a counterpart to Thunderstorm.  :)

Blue Skies takes you soaring through fluffy white clouds, and has a very clean, serene feeling to it.  There's prefs for controlling speeds, cloud density and so on, and it'll show you how many unread text messages you have by drifting colorful balloons through the scene!  Or, if you prefer, it'll show you balloons randomly.  However you like it, really.

The text message thing is a bit of a silly feature, but I'm hoping folks like it.  They don't even pop in and out, they'll drift up through the clouds, hang around, then drift away once you've read a message.  It's quite elegant looking, really.

I really like how this one turned out overall, it works really well as a low key background, and is kind of relaxing to sit and watch.  Hope everybody else likes it too!

One of the clouds backdrops is based on a Creative Commons Attribution image, posted by Grenade on Flickr.

First Child's Play donation, check!

It's been three weeks since we put Snowfall Live Wallpaper up on the market, and, well, it's done better than I was expecting.

Searching our Checkout listings for "Snowfall Charity charged" (which gets us the non-canceled orders only) results in 10,343 hits as of 10:39am today.  Each of these nets something like 67.482 cents after Google and Checkout fees.

Rounding the half up to 34 cents, that means we owe Child's Play $3516.62!

So, rather than sitting on this I figured it was time to send over the first donation.  I checked the local Texas Children's Hospital's wish list and bought them a PS3, 360, Wii, and a DS Lite, along with a Blu-Ray copy of the absolutely stunning Planet Earth.  The rest I sent over as a Paypal cash donation a few minutes later.

This has been a lot more successful than I was expecting, I have to admit, especially considering we're only just now getting into the holiday season.  I want to thank everybody for the great support, both for ourselves and for Child's Play, and look forward to writing another one one of these posts a couple weeks from now.  :)

Tuesday, November 9, 2010

NA Flags v1.25

  - New Feature: Custom flag images

Just like you could choose any PNG/JPG file for a custom image before, you can now do the same for the flag.  This is the same basic thing as the EU Flags update from a few days ago, so if you want to get your Jolly Roger on there's nothing standing in your way!

Synergy v1.3

  - New Feature: Online Leaderboards
  - New Feature: Achievements

Synergy's been neglected for quite some time, so it's about time it saw some movement.

This particular update includes the integration of OpenFeint, an XBox Live style back-end for matchmaking, leaderboards, achievements, and so on.  Integration went very smoothly all told, after an initial mistake that they really need to fix -- the instructions on their web page are out of date, you need to read the readme.txt and follow that instead.  They look basically the same at first glance, but they aren't.

After a bit of e-mail ping pong with one of their quite good customer service folks, I got things straightened out and all told was impressed by how simple OpenFeint's library made things.  I managed to get six online leaderboards and nine achievements setup and working in what I'd guess was less than eight hours total.  If I had to do it again it'd be more like four or five, probably.

I'm hoping to see some activity on the leaderboards -- Synergy never sold as well as I'd have liked, but I still think it plays pretty well and it was nice to revisit it.  This was also exploration for another game project that we'll hopefully be moving on in another month or so.

Snowfall v1.1

  - New Feature: Aurora Borealis effect
  - Bug Fix: Gap at top of background (for real, this time)

I've been tinkering with the borealis effect for a while on and off, and think I've got a good, reasonably subtle result out of it.  It's really best used as a night-only thing, but you can do what you want with the options.  :)

The gap at the top of the background managed to not be fixed last time around through a miraculous lack of double-checking.  Sorry about that folks, I don't know how that slipped through the cracks.

Saturday, November 6, 2010

Why fish (sometimes) won't eat

I've been getting e-mail reports off and on for months about how people's fish wouldn't eat, and though I've sat down and looked at it several times I could never figure out how in the world to get that to happen, and nothing I ever changed seemed to change it.

Well, this evening I was attempting to replicate a completely unrelated bug, and noticed my fish wouldn't eat anymore!  Not only that, but I noticed there were some fish flakes floating in the middle of the tank, uneaten.  That's it!

Here's how the fish eat:

1) User double-taps on the screen
2) This calls a function, which checks if there's fish food in the tank already.  If there's no food already present, it drops some fish flakes from the top of the tank, one for each fish.
3) We then check on each of the fish, and assign each fish a fish flake to eat.
4) The fish home in on their assigned food, and when they're close enough they eat it.
5) The fish then go back to wandering.

Now, it generally takes a couple seconds for the fish to get to their assigned food.  This is your opportunity to break it.  BEFORE the fish gets there, bring up the wallpaper settings.  This means the wallpaper goes to sleep, since it's not visible anymore.  Time is paused.

While in the settings screen, change your fish population.

When you exit the settings screen and return to the home screen.  Time starts again.  The preference changed, so the fish are removed and respawned from the new list.  The detail here is that the list of entities isn't cleared -- only fish are cleared/replaced.  Plants, toys, etc are left alone.  This includes the food.

We now have orphaned fish flakes, with no fish assigned to eat them!  These will slowly drift off-screen, so you won't even see them after 30 seconds or so, but they're still there.  Up in step 2, you can see it doesn't do anything if there's already food in the water.  Therefore, no more fish feeding until you reboot the phone or reapply the wallpaper from scratch.

The two-line fix here is to have the flakes remove themselves if they're left alone too long.  That will be in the next update.  You have no idea how long I've been wondering about this one!

Thursday, November 4, 2010

Aquarium v2.1

  - Update: Two new fish!
  - Update: Five new backgrounds!

In addition to the new fish, this week there'll be five new pieces of really great background art included.  Three of these are replacing existing backgrounds, and two are being added to the list.  The art is by Allyson Vaughn and looks extremely good.  This update will be uploaded either tomorrow or Saturday, most likely.

Here's a couple of pics:

Tuesday, November 2, 2010

EU Flags v1.2

  - New Feature: Custom flag images!

You want your jolly roger?  Go for it.  This feature allows you to browse for a custom flag image just like you could already browse for a custom background.  Seems to work fine in practice, and forced me to make my custom image selection a bit more robust -- you couldn't specify which pref you were browsing for before, now you can!

This will follow in NA Flags in a few days.

Snowfall v1.05

  - Bug Fix: Gap at top of screen on some handsets
  - Bug Fix: Snowflakes visibly popping away
  - New Features: Adjust snow appearance and velocities

This update wraps up a collection of features we've had requested along with a few minor bug fixes.  The first visible bug is that that in some situations you could see a gap at the top edge of the screen.  Apparently there's some phones with translucent notification bars that allowed the user to see the problem (as the top 30 pixels or so weren't covered by the bar in that case), something I had no idea about until now, as every phone I've ever seen has an opaque bar.  I'm amazed none of the other wallpapers have this issue.

The other bug is that sometimes you'd see snowflakes vanish suddenly.  This was due to lighting being enabled, which means the fadeout that should've been there wasn't working properly.  This got worked around by incorporating the current light color into the particle's coloration, and disabling lighting for them.  Looks about the same, but should be a bit cheaper and allows fading to work.

Finally, I got several e-mails with various complaints/requests regarding the appearance of the snow.  You can now dial down how much lateral motion the flakes will have (down to almost nothing) and can adjust the fall speed as well.  I'm afraid I couldn't allow you to knock the fall speed down too far, as it'd create too many particles in view at once, but it does make some difference.


How to skip Samsung Fascinate activation

Found here originally.

* Press the Emergency Call button
* At the dialer, dial * # 8 3 7 8 6 6 3 3
* Press the Home key.