Tuesday, December 28, 2010

KF Hearts Live Wallpaper

( YouTube link )
( Android Market link )

Since we're coming up on Valentine's Day, I figured we should cave to some requests and make an appropriate wallpaper!  This one's relatively simple but has some nice art in it, and has a number of settings to allow you to tweak its appearance.  Plus, you can set it to have puff of little hearts when you tap the screen!


Thursday, December 23, 2010

Silhouette v1.5

This is a mostly invisible update that finally brings Silhouette in line with all the other wallpapers, in the sense that it has a consistent upsell dialog box, a how to dialog, etc.  It's also finally using the same back-end as everything else, which will save me some sanity.

Aquarium v2.25

  - New Feature: Fish flee when touched

A bit silly, but kind of fun to play with at the same time.  This actually came as a result of finally getting screenspace to worldspace translation implemented, as I needed it for the flame burst feature in the last KF Flames update.

Sunday, December 19, 2010

Final Child's Play Donation!

It's  been a few says since the 15th now, so everybody who was going to keep their Snowfall charity wallpaper should've done so already.  Time to make the last donation!

Okay, so last time we had 24,793 sales.  Searching through Checkout this time, we're at 45,427 sales.  That's over 20k sales in two weeks!  Crazy!

So, let's do the math:

45427 - 24793 = 20634
20634 * 0.34 = $7015.56

I'm really kind of floored how well this has gone, tons of thanks to everybody who picked up a copy, we'll have to do this again next year.  :)

Checking the local Children's Hospital page, they're looking surprisingly set at this point, so I picked them up an extra Wii, WiiMote, and a copy of Spyro for the 360.  This is the second copy of Spyro we've gotten them, but as most 360 games are of the hardcore serious variety it seems important to get something friendlier for that system, to me.

Cost of Items: $313.97
Cast Donation: $6701.59

Total of all donations: $15,445.18

KF Flames v1.05

  - New Feature: Flame bursts on touch!
  - Update: New settings screen style

This is a bit of a silly feature but seems to work pretty well.  Basically, wherever you touch the screen, you'll get a little burst of flame!  There can be up to six of these at once, which seems like enough to feel responsive to me.

This actually got somewhat deep, as my particle system previously only supported looping particles.  This required I support one-off particles, which changed the spawning logic a fair bit, though most of the rest of the logic was fine either way.  I'm sure I'll find some more uses for this in the next few weeks.  :)

Wednesday, December 15, 2010

Snowfall v1.2

  - New Feature: Santa sightings
  - Update: Visual cleanup
  - Update: New settings theme

The main new thing here is that you'll see Santa and his reindeer fly by here and there, if you enable 'santa sightings' in the options.  This is a bit silly but fun, and will grow more frequent as we get closer to christmas. :)

The new settings theme is due to Samsung completely ruining the Light visual style that I've been using for the various settings screens.  The Samsung rendition is almost unusable, so I'm reverting to the default Settings theme instead.  I'll be doing this as I make updates, it's not an emergency.

Sunday, December 5, 2010

Snowfall v1.15

This is primarily a maintenance release that will hopefully improve the framerate a bit.  More importantly the goal is to reduce problems with lockups on HTC phones, which as I've mentioned before can occur any time any OpenGL app is running.  I can't promise anything, but it seems like it happens more in applications that use point lights, so this update switches from lights to tinting to handle its color shifting.

Saturday, December 4, 2010

Android Belt v1.2

  Bug Fix: Asteroid numbers building up over time
  Update: Saturn's rings more visible

Pretty much what it says.  The asteroid numbers were indeed increasing when the wallpaper came back from sleep mode.  That was a very stupid bug, I just wasn't checking the current asteroid count before refreshing the list.  It's fixed now.

Wednesday, December 1, 2010

KF Flames Live Wallpaper v1.0

( YouTube Video )
( Market Link )

There's already like 20 of these on the market, so I figured we'd give it a pass... then someone pointed out most of those are just looping videos.  We can do better than that!

So here it is!  Flames is a reasonably complex particle system that gives you control over flame density, start and end color, and more.  The default is just a black background, but you can select from a few built in ones or select your own custom image.

In addition, you can have the color of the flames change based on which home screen you're on.  You can see this in the video, with the flames turning blue on the far left and deep orange on the far right.

The motion and feel of this one turned out nicely, though it took a few tries to get a fiery feel to it.  The framerate sits in the mid thirties on my Incredible, so should do well on more or less any handset out there.  Hope folks like it!

Second Child's Play Donation

(Check out the previous post if you'd like to see the math!)

Searching our Checkout listings shows 24,793 sales as of 11:30am today.  Subtracting the previous sales, that leaves us with 14,450 sales over the last two weeks or so.  Multiply by 34 cents, and it looks like today's donation is going to total $4,913!  Man, when we decided to do this I never thought it'd get this successful!  That's pretty awesome.  :)

So, the plan is to head to the Texas Children's Hospital wishlist and buy a few games for the consoles we picked up for them last go-round.  The remainder will be sent as a cash donation to Child's Play.  Thanks again for everyone's support!

Here's the games I went with.  In the interest of variety, I tried to pick ones that nobody had purchased for them yet.  Despite that I ended up with a pretty good list!

Need for Speed: Shift for Xbox360
Legend of Spyro for Xbox360
NHL 2011 for Xbox360

Sly Cooper Collection for PS3
Ratchet & Clank Future for PS3
ModNation Racers for PS3
Lego Harry Potter Years 1-4 for PS3

Kirby's Epic Yarn for Wii
Sonic Colors for Wii
Epic Mickey for Wii

Professor Layton & the Curious Village for DS
Pokemon Mystery Dungeon for DS

Games Total: $415.82
Cash Donation: $4,497.18

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.

Enjoy!

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.

Saturday, October 30, 2010

Aquarium v2.05

  - Update: More fish!

A simple update that adds a couple more fish to the list, enjoy!  Expecting to add a few more next week.

Thursday, October 28, 2010

Asteroid Belt v1.15

  - Update: More planets!

So, when originally creating this wallpaper, the idea was that the solar system on display wasn't ours, it was just a random solar system somewhere out there.  The problem is, the layout ended up being fairly similar to our system and I got a lot of comments about that.  So, I'm going ahead and taking that the rest of the way by incorporating Saturn, Uranus, and Neptune way out there.  Neptune will complete one orbit every twelve hours of real-time, with Uranus and Saturn being a notch faster as you go inward.

I'm also incorporating the HowTo screen in this update -- Asteroid Belt is the highest-user-count wallpaper that I've added this to, we'll see how much trouble or confusion it causes.

Bamboo Forest v1.1

  - New Feature: Time of Day colors

At this point I've gotten quite comfortable with getting something to sync up to the real-time day, and a few folks have requested it, so here it is again -- Bamboo Forest now supports having fog and light color shift based on the time of day.  You can individually control the color settings for morning, daytime, evening, and night.

Wednesday, October 27, 2010

Jungle Waterfall v1.05

  - New Feature: Sky Color pref
  - New Feature: Time of Day colors

I got several requests for a time of day preference on this one, so tackled that with this update.  It adjusts the fog and sky color based on the hour of the day, so you get a nighttime feel at night and a daytime feel during the day.  As I ended up needing to adjust the sky color anyway, I also made it possible to customize that if you'd like to.

Tuesday, October 26, 2010

NA Flags v1.2

  - New Feature: Guam flag
  - New Feature: DC flag
  - New Feature: "How To" popup

This is a fairly routine update to add a bit more flag art, and in the process I rolled in the "How To" popup I created for Snowfall.  This will hopefully reduce the confusion about how to make use of live wallpapers a notch, allow the 'open' button to do something useful, and it'll automatically disable once you use the wallpaper for the first time.

Monday, October 25, 2010

Snowfall Live Wallpaper v1.0

(YouTube Video)
(Android Market Link)

We've had a ton of requests for a winter-themed wallpaper, and as I personally hail from the great white north I'm not about to say no.  The result is Snowfall, a beautiful winter scene of snow covered pine trees, with snowflakes falling from above.

The particle system took a while, as performance with a ton of independently moving pieces was hurting at first.  Eventually I got it down to three instances of an effect with only 32 particles (if you set snowfall to the highest setting), though it looks like a whole lot more than that.  This kept performance up and worked out very well in practice.

Trees and the daytime sky were all made by Allyson Vaughn, who did very well at tolerating some back and forth feedback.  The nighttime sky ended up being based on the same moon that Halloween used, which I feel a bit guilty about, but it's really a great image, so what you do you?  Basically everything in the foreground animates, and we're once again using the visibility system to avoid rendering off-screen items.  The framerate's quite good on my Incredible, and works well on the Evo as well (as you can see from the YouTube video!).

There are a couple new things happening here.  Firstly, I'm taking another stab at making use of the 'Open' button on the Marketplace page.  This is basically a rework of the 'HowTo' activity I had set up for Aquarium and Silhouette for a while, though it has more depth now.  Basically, running the activity will still explain how to use a wallpaper, but now it will also provide a shortcut directly to the Live Wallpaper Chooser.  Additionally, the first time the user successfully runs the wallpaper, the HowTo activity will disappear -- that way it won't annoyingly clutter your app listing.

The other new thing is that up until December 15th we'll be giving 50% of the revenue from Snowfall to charity -- specifically Child's Play.  This is one of those things I've always wanted to do, and I can't think of a more appropriate product to do it with.  I'm excited to have this on the market and can't wait to see what people think.  :)

Saturday, October 23, 2010

Halloween v1.15

  - Bug Fix: Flashing background when bats are disabled
  - Bug Fix: Log prints when ghosts appear
  - New Feature:  ???

This is mostly a maintenance release to clean up a few bugs that I'd had reported.  I also reduced the filesize a bit by switching some PNGs over to JPGs.  While I was at it I added a new feature, but it's silly and a secret.

Monday, October 18, 2010

Thunderstorm v1.3

  - New Feature: Drops hitting camera
  - Update: Slider bar for setting bolt interval
  - Update: Slider bar for setting number of clouds

One of the most requested features is water drops hitting the camera, and after some delay it's finally in and working!  It looks pretty good, but regardless I've defaulted it to off -- look towards the bottom of the settings screen for the checkbox!

The slider bar dialog is a new class I put together this morning, which should work well for some of the more numerical settings in the future.  In this case it means I can have a wide range of lightning bolt frequencies without having a big awkward scrolling list.  Much better!

Friday, October 15, 2010

Jungle Waterfall v1.0

(YouTube link)
(Android Market link)

This one's been struggling while I attempted to work out the issues with the G2, but things finally cleared up the last few days, and the end result is really great!  This one's an entire jungle scene, with a waterfall streaming down the middle.  The trees and ferns all move, the fires are fiery, the fog turned out great, and there's mayan ruins scattered around to reinforce the Indiana Jones vibe.  Honestly, I think it turned out to be one of the best looking examples of OpenGL on Android around.

This one started as a roughed out scene in Blender, was passed on to Allyson Vaughn for finishing and texturing, then came back to me for all the scene setup, animation, and particle stuff.  Performance is quite good (despite the fog!) and can be made better if you want to disable the fog pass -- though I really think it looks much better with the fog on.  There's preferences for fog color and you can tweak the density, and you can disable the embers particle that's going on overhead.

The biggest issue with this concept, aside from the general scene complexity, is that it doesn't really lend itself to a deep set of preferences.  As a result this one's paid only I'm afraid, as I try to make sure the donation version gives substantially more than the free one, and I don't think I can differenciate this one enough.  No worries, the next one will have a free version. :)

The biggest technological challenge here was getting the sorting right and working out inexpensive ways to get everything animating.  That all turned out well, luckily, and I'm thrilled to be able to present the end result to folks!

1.0a:  Quick update to fix a gap visible on the far right edge when using a 480x854 screen ratio.

Thursday, October 14, 2010

Halloween v1.1

 - New Feature: Ghosts!
 - New Feature: Wind speed control

Let's face it, the ghosts turned out awesome.  Very appropriate for the feel this wallpaper has, and the behavior's good I think.  You can set how often they show up or turn them off completely.  The ghost models and textures are the work of Allyson Vaughn, who did damn well as usual.

As a bonus, you can speed up or slow down the clouds now.  Huzzah!

Monday, October 11, 2010

Checklist

* Galactic core flickers on the EVO and the Desire, why?
    - Purchased an EVO and can't get this to happen!
    - Saw it happen, looks like a driver issue or something :(
* Debug crashy images for custom background selection
    - Nothing to do with image, timing issue.  Fixed!
* Finish Jungle Waterfall
* Halloween ghost
* Upsell screen for Silhouette
* Water drops hitting screen in Thunderstorm
* Sound in thunderstorm -- how problematic is this concept?
* Can the open button be made useful?
* Time of day for Bamboo
* Time of day for Jungle Waterfall

Using Google's ADB driver for other phones

If you've got a few test phones and you're developing under Windows7, you may find that your particular device doesn't work with the standard Google ADB driver.  This is the one that's installed by the SDK in the usb_driver folder.

The easy way to fix this is to add the device's ID into the android_winusb.inf file found in the root of the usb_driver folder.

Here's some I've had use of recently, and know work on Win7 x64.

;Xoom
%SingleAdbInterface%        = USB_Install, USB\VID_22B8&PID_70A9
%CompositeAdbInterface%     = USB_Install, USB\VID_22B8&PID_70A9&MI_01

;Droid X2
%SingleAdbInterface%        = USB_Install, USB\VID_22B8&PID_70C9
%CompositeAdbInterface%     = USB_Install, USB\VID_22B8&PID_70C9&MI_01

;Sony Xperia Play

%SingleAdbInterface%        = USB_Install, USB\Vid_0fce&Pid_215b
%CompositeAdbInterface%     = USB_Install, USB\Vid_0fce&Pid_215b&MI_01

;Samsung Galaxy Tab 10.1
%SingleAdbInterface%        = USB_Install, USB\VID_04E8&PID_685E&MI_02
%CompositeAdbInterface%     = USB_Install, USB\VID_04E8&PID_685E&REV_0400&MI_02


;Verizon HTC Incredible
%SingleAdbInterface%        = USB_Install, USB\VID_0BB4&PID_0C9E
%CompositeAdbInterface%     = USB_Install, USB\VID_0BB4&PID_0C9E&MI_01

;T-Mobile HTC G2
%SingleAdbInterface%        = USB_Install, USB\VID_0BB4&PID_0C91
%CompositeAdbInterface%     = USB_Install, USB\VID_0BB4&PID_0C91&MI_01

;Sprint HTC EVO
%SingleAdbInterface%        = USB_Install, USB\VID_0BB4&PID_0C8D
%CompositeAdbInterface%     = USB_Install, USB\VID_0BB4&PID_0C8D&MI_01

;Motorola Droid 2
%SingleAdbInterface%       = USB_Install, USB\VID_22B8&PID_42A4
%CompositeAdbInterface%      = USB_Install, USB\VID_22B8&PID_42A4&MI_01

; Motorola Droid 3
%SingleAdbInterface%        = USB_Install, USB\VID_22B8&PID_42D7
%CompositeAdbInterface%     = USB_Install, USB\VID_22B8&PID_42D7&MI_01

;Google Nexus S
%SingleAdbInterface%        = USB_Install, USB\VID_18D1&PID_4E22
%CompositeAdbInterface%     = USB_Install, USB\VID_18D1&PID_4E22&MI_01

;Samsung Fascinate
%CompositeAdbInterface%     = USB_Install, USB\VID_04E8&PID_6640&MI_00
%SingleBootLoaderInterface% = USB_Install, USB\VID_04E8&PID_6640&MI_04

; Acer Iconia a100
%SingleAdbInterface%        = USB_Install, USB\VID_0502&PID_3348
%CompositeAdbInterface%     = USB_Install, USB\VID_0502&PID_3348&MI_01

The attractive thing about this, to me, is that you get to avoid installing whatever annoying music-sync software comes with the phone, but can still debug with it.

Friday, October 8, 2010

Where things stand with HTC's drivers

I acquired a G2 and have been attempting to work around this problem for the last couple of days, and while I think I may have improved it marginally, I also don't think I fixed it.  They will definitely still lockup without warning during either eglSwapBuffers or eglCreateSurface, and there's just no way for me to detect it's going to happen -- everything appears fine, no errors are reported.  When the lockup occurs, you'll see a long string of this:

WARN/SharedBufferStack(2005): waitForCondition(LockCondition) timed out(identity=9, status=0). CPU may be pegged. trying again.
WARN/SharedBufferStack(71): waitForCondition(LockCondition) timed out (identity=9, status=0). CPU may be pegged. trying again.

The thing to note here is that eglSwapBuffers and eglCreateSurface are never, ever supposed to block.  If they can't succeed, they're supposed to return with an error indicating so.  All error checking for these is meant to be done after the fact -- you call them, check if it worked, try again if it didn't.  This means there's nothing built into OpenGL to help with this, and the error is low level enough that it's well below my code's level of visibility.

Behaviorally, this primarily seems to happen upon losing and recreating the OpenGL context during a portrait/landscape switch, and is uncommon in the sense that it happens maybe one or two percent of the time.  Doesn't sound like a lot, but that's actually pretty high if you're using your phone actively.  It happens about 25% of the time if you call glFinish before swapping the buffers -- pretty good evidence it's a race condition.

While I can avoid glFinish easily enough, I must support both portrait and landscape for these wallpapers, as I'm at the mercy of the home screen there.  An application can simply insist in running one or the other and minimize its exposure, but that's not the case with a live wallpaper.  Odds are HTC just didn't test any of the marketplace ones at all, and only tested Google's default wallpapers, which are written with the NDK and take a different route, though I wouldn't be shocked if they lockup occasionally as well.

Since it doesn't appear I can actually fix the problem, I unfortunately need to admit defeat.  I've added a note about locking up on the G2 to all of our market listings and we will offer a refund to G2 owners upon request.  Sorry folks, until HTC looks at the issue there doesn't appear to be anything I can do.

Aquarium v2.0

  - New Feature: Seahorse!
  - Update: Realer shark!
  - Update: Nicer customize screen buttons!

Finally got the seahorse done after way too much delay.  Sorry about that, folks.  The shark got updated with a more realistic texture as well.

This update also incorporates my attempts at smoothing over some of HTC's driver problems, but it wasn't 100% successful.

Sunday, October 3, 2010

Various Updates & HTC Drivers

So, HTC has rather iffy OpenGL drivers on their phones.  They suffer from a long-standing intermittent bug that locks up your whole phone, frequently requiring a battery-pull to recover.  The bug appears to be a race condition when they swap framebuffer frames, so it's really below my ability to to anything about, and I suspect it's somewhat framerate dependent.

Now, one way you can minimize the problem, one fellow on the mailing list identified, is by using glFinish() to wait until all operations are done before swapping the buffers.  The problem is this slows down rendering substantially across all phones (not just HTC's phones).  The other problem is that starting with the G2, using glFinish() causes the wallpaper rendering to lock up when switching between portrait and landscape.  No other phones do this, just the G2.

All of these will eventually boil down to a whole mess of messages in your logs, all reading something like this:

W/SharedBufferStack(21310): waitForCondition(LockCondition) timed out
(identity=2376, status=0). CPU may be pegged. trying again.
W/SharedBufferStack(21310): waitForCondition(LockCondition) timed out
(identity=2376, status=0). CPU may be pegged. trying again.
W/SharedBufferStack(21310): waitForCondition(LockCondition) timed out
(identity=2376, status=0). CPU may be pegged. trying again.

Whatever they did with the G2, they did improve one thing because this doesn't appear to be pull-your-battery fatal anymore.  It does seem to happen much more easily though, and as it appears to happen much more often when I have glFinish() being called, and as calling glFinish() really hurts the framerate, I'm going to go back to the original status quo and remove it from the wallpapers that I'd added it to.  My hope is that this change of behavior on the G2 at least signals that someone at HTC is attempting to fix the problem, and maybe in a future update they'll fix it for real.

As it is, whatever I do results in failure on some HTC devices, so I may as well make failure rare if I can't fix it.  So, this is the purpose of a handful of updates that are going to go out today -- get everything on an even keel and hopefully minimize whatever failures occur on HTC devices, as I'm fairly confident I can't completely fix it.

Friday, October 1, 2010

Bamboo Forest v1.05

 - New Feature: Custom color picker
 - New Feature: Scene complexity pref
 - Bug Fix: HTC flickering bug

The color picker and flickering issue are the same as Galactic Core in the below post, but unfortunately that couple of fps loss from calling glFinish() hurts a lot on Bamboo Forest, which already has fog axing its framerate down lower than I'd like.

This resulted in some simplification of the scene to get the framerate back up, and the addition of a "Scene Complexity" setting in the preferences.  If you've got a really fast-rendering phone (A Galaxy S, Droid 2, etc) you can turn it all the way up just fine, but if you've got an original Droid you might want to stick with a low complexity.  Pick your prettiness/performance sweet spot!  The default value for this is 'medium'.

Galactic Core v1.55

 - New Feature: Custom color picker
 - Bug Fix: Flickering on HTC devices

The flickering fix really just involves calling glFinish() at the end of each frame.  This is something that, I thought, went the way of the dodo when we got double-buffering, but apparently HTC's hooked enough stuff onto glFinish() that you get flickering and full-phone lockups if you don't call it.  Also, you lose a few frames per second.  Thanks HTC!

The color picker is way cooler, and is based on one posted by pskink on AndDev.org.  It's has a few modifications, notably the removal of the progress indicator on the top bar and the background being given a proper hue distribution.  It works well and I'll hopefully replace the existing "list of colors" approach with this wherever it's relevant in the future.

Because this makes it a lot harder to get back to the default color settings than the list approach did, there's also a "Reset to default colors" item that you can tap to, well, reset it to default colors.

Wednesday, September 29, 2010

Friendly Bugs Live Wallpaper v1.1

  - New Feature: Butterflies!  Six different types!
  - New Feature: Population Settings (ladybugs & butterflies)
  - Update: Categories in settings menu
  - Update: Name change from Ladybugs Live Wallpaper
  - Bug Fix: Now calling glFinish() to satisfy HTC's drivers

Ladybugs has long been the least popular of our live wallpapers, and let's face it: the lack of butterflies is why.  So, taking action on that observation, it now has a whole mess of butterflies (six different types) and if you set the population to "Invasion" you get swarms of them!

This, of course, means "Ladybugs Live Wallpaper" is now a bit of a misnomer, so after a few attempts that kept bumping into the 30 character limit, we're going with "Friendly Bugs Live Wallpaper" for the new name.  It's descriptive, it's totally friendly, and it's got a vaguely Japanese anime vibe that we like.

The butterfly models and textures are the work of Allyson Kates, who did damn well for just a few hours!  Getting the landing and taking off to feel right took a bit of time, but overall I'm happy with the result, and it'll probably get a bit of tweaking in future updates.  Summoning a butterfly when you tap the screen might make sense too. :)

Monday, September 27, 2010

How to disable vCast Media Manager popup

If you have an HTC Incredible, you probably noticed that as of the 2.2 update Verizon saw fit to include an agonizing popup every time you plug your phone in, telling you to install vCast Media Manager.  Here's how to disable that.  I use this phone as my main test device, so I get to see that thing dozens of times a day.  No more!

Here's how to disable it:

* Go to the dialer, dial ##7764726
* Hit Call
* Type Password 000000 (six zeros)
* Select Feature Settings -> CD ROM
* Disable it

Thursday, September 23, 2010

Asteroid Belt Live Wallpaper v1.0

(Android Market Link)
(YouTube link)

Been working on this one on and off the last couple weeks, and finally have it to a point where I like it.  For a change not a lot of tech development happened with this one, it was mostly a matter of tackling the art and scene setup, and I'm happy with how all that turned out.

There's a few dozen asteroids in the foreground that tumble from one side of the screen to another, with the rest of the solar system in the background.  The orbits of the planets in the system are tied into time of day, with the slowest (the green gas giant) orbiting once every six hours.  The rest of them are at 3, 2, and 1 hour intervals.

The original scene didn't have the planetary orbits outlines, and it felt rather empty, and was hard to understand where the planets are were relative to each other (since they're all different sizes).  Adding the rings helped that a lot and means you get to see some shift when switching home screens.

The sun is a couple of layers of alpha, rotating at different speets, multitextured together, with a color gradiant overtop.  The result in a subtle but attractive animation, I think.

This is the first wallpaper that's really leaned heavily on OpenGL's lighting for effect, I think, and it didn't turn out badly.  I'm actually quite happy with the asteroids -- they're two passes, the first diffuse lighting and the second specular lighting.  They've got a good cold shiny look that feels very appropriate, I think.  They're also dark enough that they don't distract as a background.

All told I'm quite happy with how things shaped up.  It still needs a few more user options, I think, but I haven't worked out exactly what those should be yet... they'll happen in future updates.  Any thoughts as to what those should be, I'm all ears.

Checklist

Things to tackle over the next few days:

* Halloween update (ghosts & witches!)
* Vertex color support in model format
* Seahorse (finally) in Aquarium - 50%
* Upsell activity into Silhouette
* Butterflies
* Landscape mode upsell dialog
* More prefs for Asteroid Belt
* Implement Jungle Waterfall

Monday, September 20, 2010

Thunderstorm v1.2

  - Update: Sharper lightning bolts
  - New Feature: Minimalist Mode

Minimalist mode is actually a bit of an off-the-cuff feature in response to an e-mail asking if they could get just the lightning against a black background.  As it's easy to do, why not?

The lightning bolt graphics are now double the resolution, with some tech development done to offset the memory usage.  While previously all images were treated as RGB, now the engine supports loading of greyscale TGA images, and will appropriately treat them as luminance at upload time.  That means while the image is much higher res, it should actually be using a comparable amount of memory to before.

Notably, while the glTexImage2D description says input format and internal format are supposed to be separate, and that it's OpenGL's responsibility to convert from one to the other, I didn't find that to be the case on my HTC device.  Whatever your input format is dictates your internal format, so far as I can tell.  I suspect the internal format argument is more or less ignored.

Tuesday, September 14, 2010

NA Flags v1.15 & EU flags v1.1

  - New Feature: Custom Backgrounds
  - Update:  Removed banner-style Canadian flag
  - Update:  Added England flag

These are all pretty self-explanatory.  Everyone seemed to hate and loathe the portrait-mode Canada flag, so away it goes.  It was based on an actual banner that some reference photos showed (similar to American flag banners that might put the stars all the way across the top), but the general tone of the comments clearly didn't appreciate that.  It's gone now, as the customer is always right.

EU Flags gained the red-and-white flag of England, which was an oversight in the original release.  Sorry folks.

The Custom Backgrounds feature is using most of the same tech development as Aquarium's equivalent (which you can read about below), though it was interesting dealing with PreferenceActivity rather than with standard UI buttons.  Similar but not quite the same, and I'd been leaning on the load-from-XML implementation enough previously to not have to deal with it.

Aquarium v1.95

  - New Feature: Custom Backgrounds
  - Update: Three-position bubbler

Some people apparently don't like the new bubbler, so now the bubbler button is three-position.  Off, old style, new style.  Simple.

Custom backgrounds, on the other hand, took a while to get working, as there's actually some complexity to it under the hood.  On the surface it looks like a button, you push it, an image browser gets launched, you pick an image, and you're good.  Underneath there's some interesting complexity.  Let's discuss that for a bit.

Firstly, since Aquarium is OpenGL rendered, everything needs to be a power of two.  So, the first step was to load the selected image, determine the best power of two, and resize it.  The logic got a little more complicated though, as I wanted to make sure the size was reasonable and the proportions worked out sanely.  So, the actual logic ended up like this:

1) Determine the longest dimension, X or Y
2) Scale that dimension to the nearest power of two, maxing out at 1024.
3) Determine the amount of scaling it took to get it there
4) Scale the other dimension by the same amount
5) Find the other dimension's nearest power of two

This means you get something more or less proportional, with the longest axis safely capped.  Then you do some browsing around and the entire process gets task-killed.  What's up with that?

Basically, a given Android process isn't allowed to allocate more than 20 meg of memory.  In these heady days of 8 megapixel phone cameras, some of these images are freaking big.  Loading a 8 megapixel image and manipulating it takes up several meg of ram.  On top of that, a year from now we'll probaby be seeing phones with 12 megapixel+ cameras.  On top of that, what if somebody has some gigantic 8000x5000 photoshopped something or other on their SD card, and they select it? 

What to do about that?  BitmapFactory has a subclass called Options, which you can use to, well, set options on bitmaps when loaded.  One of these options (inJustDecodeBounds)  tells the system not to load the actual bitmap, but just load the dimensions.  So, to save loading the entire 8 meg image, I get the starting size, then work out what scaling factor (bitmap supports scaling to half, one quarter, one eighth, one sixteenth, etc) gets me to the 1000-1500 range (preferably) then load the bitmap with that scaling factor.  Sweet, I can now rest easy that I'm not blindly reading 40 meg of image data.

This works pretty good, we're back to being well within our memory budget.  Now the problem becomes the secure digital card, which lots of people store their images on.  The SD card can be pulled from the phone, or unmounted to be read via USB, and on top of that is unmounted at boot time for a while.  Basically, the SD card's presence at any given time isn't trustworthy.  So, you need to make sure that the custom image that's selected actually exists when you're trying to read it, and that you have a reasonable fallback -- I end up just using whichever standard background was most recently selected.  After that I check the status of the custom image's path every time the wallpaper becomes active, so if you put the SD card back in (or it finishes mounting after a reboot), it'll eventually get loaded when the user leaves and comes back to the home screen.

If the SD card is removed and the custom image is already loaded as a texture, then sweet, I keep it around until I'm forced to throw it away (like during an OpenGL context change).  This means you can take the SD card out and your custom image will remain visible until you put it back, almost all the time.

After all this, the thing seems to have gotten sewn up pretty well.  Hopefully if anything apocalyptic happens I'll get an e-mail.  :)

Monday, September 13, 2010

Halloween Live Wallpaper v1.0

(Android Market Link)
(YouTube link)

Had a few requests for one of these, and it was fun to put together! You get a collection of Jack-O-Lanterns sitting atop gravestones, with a full moon and swarms of bats in the background.  There's a cartoony haunted house with glowy eyes and everything.  :)

The prefs on this one are a little thin on the ground currently, but I expect to add more stuff over the coming weeks.  Basically, you can control the density of the bats and the color of the candles in the pumpkins, the camera speed, and can set it to only spawn bats when you touch the screen.

On  the technical side, the particle system now supports animated meshes as particles, which is what the stream of bats is composed of.  Particle systems now can have their spawning enabled and disabled at will, plus a few other minor features that should come in handy in the future.  The visibility system worked out for Bamboo works well in this case as well.  It's not nearly as object intense, but it's getting a few fps back.

I'm quite happy with how it looks overall, it was a fun project and it's cool to get it out there for folks to see!

Saturday, September 11, 2010

An Android Logging Class That Writes to SD Card

In case anyone's interested... I'm currently trying to work out the cause of a very uncommon lockup that happens with one or two of the wallpapers.  It only seems to happen on HTC phones so I'm honestly guessing it's a driver bug, but the real problem is that it happens with no apparent cause with a frequency of perhaps once or twice per day.

I've got an HTC Incredible here that I have seen it happen on, the problem is actually seeing what's going on.  I'd normally use the system log, but since this problem can lock-up the phone, that log gets wiped out upon a restart.  So, I've tossed together a simple static logging class that can output to an SD card.  The filename is tagged with the date and time upon creation, so it won't overwrite an earlier file, and since it's on the SD card it can run and get plenty gigantic.  I've put calls to LogToSD.write at the top of basically every single method on the wallpaper, so it's going to get big by the time I see it lock up next.  :P

Here's the class, if anyone's looking for something like this.  Don't forget you'll need to set uses-permission WRITE_EXTERNAL_STORAGE.

public class LogToSD
{
    static PrintWriter outFile = null;
  
    private static void initialize()
    {
        try {
            File root = Environment.getExternalStorageDirectory();
            if( root.canWrite() )
            {
                Calendar rightNow = Calendar.getInstance();
                long day = rightNow.get( Calendar.DAY_OF_YEAR );
                long hour = rightNow.get( Calendar.HOUR_OF_DAY );
                long minutes = rightNow.get( Calendar.MINUTE );
                long seconds = rightNow.get( Calendar.SECOND );
              
                String date = day + "-" + hour + "-" + minutes + "-" + seconds;
              
                File gpxfile = new File( root, "log_" + date + ".log" );
                FileWriter gpxwriter = new FileWriter( gpxfile );
                outFile = new PrintWriter( gpxwriter );
                outFile.write( "\n\n----- Initiating LogToSD Session -----\n" );
                outFile.write( "----- Start Time: " + date + " -----\n\n" );
            }
        } catch (IOException e) {
            Log.e( "LogToSD", "Could not write to file: " + e.getMessage());
        }
    }
  
    public static void write( String text1, String text2 )
    {
        if( outFile == null )
            initialize();
      
        Calendar rightNow = Calendar.getInstance();
        long minutes = rightNow.get( Calendar.MINUTE );
        long seconds = rightNow.get( Calendar.SECOND );
        long ms = rightNow.get( Calendar.MILLISECOND );
      
        String time = minutes + ":" + seconds + "." + ms;

        outFile.write( time + "\t" + text1 + " " + text2 + "\n" );
        outFile.flush();
      
        Log.v( "LogToSD", text1 + " " + text2 );
    }
  
    public static void shutdown()
    {
        if( outFile != null )
            outFile.close();
    }
}

Wednesday, September 8, 2010

Thunderstorm v1.15

  - New Feature: Tap to summon lightning!

This one's pretty simple but a few folks have asked for it.  Basically, there's now a setting that will cause lightning to flash whenever you tap on the screen!  It's a bit silly, so it's off by default, but it's there if you want it.  :)

This will be uploaded in the morning.

Aquarium v1.91 & v1.92

  - New Feature: Fish Selection Window
  - Update: Twelve Fish at a time!

This update happened pretty soon after the last one - sorry about that.  Generally I'd have waited longer, but v1.90 had an unfortunate bug that resulted in the particle bubbles being visually wrong on some phones.  I hadn't excluded them from mipmapping, and on some handsets the automatic mipmap generation doesn't work correctly with an alpha channel.

So, v1.91 was primarily to fix that problem.  At the same time I'd started working on a popup window for selecting your fish species, as the tap-to-cycle approach was getting kind of ridiculous when there's a dozen fish in the list.  The new window has all the available fish listed.  You tap the thumbnail, the window appears, and you make your selection.  It's a lot more elegant at this point, I think.

While I was messing with the UI, I figured I may as well use up that couple FPS we gained and allow 12 fish instead of 10.

This all went in just fine, until I started getting mail asking how to remove a fish.  Now, the thing to remember is, when I'm testing this stuff I ended up wiping my preferences a lot and starting from the default values... so while I'd confirmed all 12 slots worked I'd really just been testing the new functionality, and somehow managed to completely forget that you might want to take away fish too.

So, v1.92 was a rush to fix this problem, by adding the "no fish" red X to the popup window.  I confirmed it worked and got that out as quickly as possible, so hopefully not too many people needed to update twice in a day.  Sorry folks!

Thursday, September 2, 2010

Bamboo Forest v1.0

(Android Market link)
(YouTube link)

In the mood for something a bit zen?  Bamboo Forest is a serene scene of waving bamboo trees with shafts of light from above.  It's got a mess of color preferences for fog and light, along with settings for fog density and camera speed, and controls for enabling/disabling the particles and light rays if you don't like them.

There's a surprising amount of complexity to this scene, and a lot of time went into making it perform well with that many object visible and at that detail level.  It works well and is quite pretty!

A lot of useful functionality came out of this one, development-wise.  The export tools can finally handle multiple animated objects being exported in one file, for one thing.  Originally, the scene had somewhere in the neighborhood of 100 separate animated models at a time, and that was just too much for the phone to handle.  Some of these got thinned, while others got combined to reduce the total object count.

There's also a basic visibility system in place that avoids updating and rendering objects that are off-camera.  That doesn't sound like much, but none of the other wallpapers so far have really justified writing something like that, as generally they're floating around 5-15 objects at a time.  These features combined with a lot of profiling and optimizations should help make future projects go quicker and smoother, as a bonus.

Aquarium v1.9

 - New Feature: Particle-system based bubbles
 - Update: A bunch of optimizations

Most of this update is invisible, honestly.  Been doing a lot of optimization for high-object-count scenes and the library changes have been moved into Aquarium as well.  This gets it a couple of frames per second, but honestly it's high enough already that you probably won't notice.

The noticeable change is the addition of particle-based bubbles!  These are exercising a new system that is starting to work its way into the various wallpapers are updates are done, and feel a lot more dynamic than the old ones.

The original plan was to get better fish selection and a seahorse into this update... unfortunately other stuff got in the way, so that'll be in next round.

Monday, August 30, 2010

Thunderstorm v1.1

- New Feature: Rain and its preferences
- Bug Fix: Camera speed pref
- Update: Background image is higher res
- Update: Lightning depth range further from camera

Yeah, kind of obvious in retrospect, but the initial release didn't have rain!  Well, it's here now, exercising the particle system I've been writing on and off over the last few weeks.  Some meaningful optimizations went into this one, as the system will now avoid updating fields that don't need to change, and can detect which ones to ignore fairly well.

The default rain effect simply plays overtop the camera - this is the least expensive one.  Fancier than that is rain that actually falls from where the clouds are, which is noticably more complicated as it means there's something like a dozen systems all updating at once.  Fancier still, you can enable both the global rain and the cloud-spawned rain all at once.  If you have framerate problems, I recommend sticking with the default 'everywhere' rain, though all of them behave fine on my HTC Incredible.

The depth range thing is a bit non-obvious... when a bolt of lightning strikes, it's placed randomly within the scene.  This includes depth, and previously it could get as close as 25 units from the camera.  This showed as noticeably low res sometimes, so now the close-range threshold is something like like 40.

Flowers v1.1

- New Feature: Particles in the wind
- Bug Fix: Camera Speed Pref

This is a fairly minor update that's partly a maintenance release, and partly to make use of a particle system I've been gradually getting working over the last few weeks.  The dandelion seeds blowing in the background are a simple particle effect making use of the new system, that I think help lend some additional motion to the scene.

The camera speed pref has been working incorrectly this whole time, a bug that apparently worked its way into a few other wallpapers as well.  I'll be fixing this as updates get made.

Friday, August 20, 2010

Thunderstorm Live Wallpaper v1.0

Update: YouTube video!
Update: Marketplace link!

This one actually went pretty quick, thanks to some artistic help from Joel Mejia and several hours trapped at an airport. :)

The most time consuming aspect of Thunderstorm was the clouds, which I guess is obvious in retrospect. The number of them needs to be minimized as these phones are very fill-rate limited, but at the same time you need several layers to get any kind of good motion.  I ended up defaulting to 9, spacing them out evenly along the Z plane (Z = up), and randomizing their depth between the camera and background layer.  The image distribution is random.

A lot of time went into tweaking the color ranges and nature of the alpha to allow them to blend together somewhat and create an amorphous shape when possible, as having sharp edges didn't play well in practice.  The phones I have access to also tend to knock the alpha channel to 4-bit (it looks like), which really hurts here.  It creates some pretty visible banding, so it was necessary to keep a fairly busy color channel to help hide that.  There's still a few artifacts here and there on a couple of the images, but for the most part the remaining banding isn't too bad.

To minimize fill-rate cost, both the lightning and clouds all have custom models that cut out the empty space so we're not rendering unnecessary invisible pixels... it's still a little expensive at times but it's about as minimal as is possible, I think.  The models themselves have normals forced outwards on the edges, so the clouds will directionally shade smoothly based on the light source in the scene.  The light direction very slowly orbits the periphery, but blips to the X origin of the lightning bolt when a bolt is spawned, then lerps back to its correct position.  The flash is accomplished by keeping the diffuse light as-is and spiking the specular light to the bolt's user-defined color, then fading that back down as the bolt fades out.

All this worked out pretty well.  There's still the occasional spot where the clouds kind of stand out as a cut-out sprite... that's really hard to eliminate completely without more layers of blending, but as updates happen I'll probably reduce it further.  As a whole the results here turned out really cool, and I'm happy to be able to release it.

I'm trying a different sort of approach to the free version with this one... the free version doesn't have an app icon, instead the settings button links to a pop-up dialog that explains the range of settings available in the full version, with a marketplace and web page link.  I'm hoping this is unobtrusive while still letting people know the full version's available if they want it.

Thursday, August 19, 2010

Checklist

Things to get done on various projects:

* Sanity check app names for all wallpapers.
* Add Albania to EU Flags.
* Seahorse for Aquarium
* Popup menu when selecting fish for Aquarium
* Cleanup flare overlays for Thunderstorm clouds
* More prefs for Thunderstorm
* Confirm whether Motorola fixed their filtering bug with the 2.2 update They DID!

* Flowers update

Monday, August 16, 2010

European Flags Live Wallpaper v1.0

There's now an EU Flags Live Wallpaper to go along with the North American one!  This one features a collection of 8 picturesque backgrounds along with 33 national flags from throughout Europe.  As before, there's prefs for flag speed, camera speed, flag rendering style, and performance.  It's been localized into French, German, Italian, and Spanish as well.

We did make use of some Creative Commons Attribution images in this case.  There's a fantastic italian vineyard shot by Francesco Sgroi, a beautiful shot of the swiss alps by Problemkind, and a portion of a super-wide panorama shot by NathanMac87.  These all worked out great, and are much appreciated.

Check out the YouTube video!

Tuesday, August 10, 2010

NA Flags v1.05

 - Update: Sharper backgrounds
 - Update: Nicer preferences screen organization
 - New Feature: Puerto Rico and Greenland flags

Not a lot to be said on this one.  The background improvement is actually a bit of a bug fix -- originally landscape mode had more horizontal travel to the camera than it does now, and because of the width of the screen it was necessary for the background image to be wide enough to encompass the camera's full width.  At some point during development the landscape camera's motion got cinched up from a 90 degree arc to a 60 degree arc, but we never thought to fix the background model.  This means that about 25% of the background image was actually going to waste, because you couldn't ever see it!

So, the big change there cinching up the width of the background, so you can see more of the image now.  This has the happy side effect of getting a lot more pixels on-screen, and it's now visibly sharper.  On top of that, the canyon and mountains images were resaved with a higher compression quality, so they're outright sharper even without this change.  The sum total is a significant improvement in background quality.

Aquarium v1.85

 - New Feature: Sea turtle!
 - Update: Better framerate on Motorola Droid
 - Bug Fix: SD card support

I've been doing most testing on an HTC Incredible lately, and when I fancified the overhead light rays everything seemed cool... until I got a couple mails from Motorola Droid owners asking why things seemed so slow on Android 2.2.  Looking at it, the 2.2 update was just a coincidence, the real problem was that I'm now doing two passes with the default overhead light.  I'd forgotten how fill-rate limited the Droid was, and it came back to bite me here.  To make up for it I set the default back to one pass (like it was before), and additionally cinched up the edges of both the overhead light model and the bubbles model to eliminate any empty space.  The default settings now should be faster than before I changed things a week ago.  Sorry about that, Droid users.

SD card fix is the same as outlined below -- I turned off the copy protection flag.

Sea turtles -- well, who doesn't love 'em, and people ask about them pretty regularly.  It's making a bit of a wreck of the already questionable fish sizing, but ah well.  :)

Saturday, August 7, 2010

Galactic Core v1.53

 - Update: More color selections
 - Update: Nicer prefs listing
 - Bug Fix: 2.2 SD card support

This is primarily a maintenance update to fix an issue with SD card offloading -- basically, while I've had support enabled for months now, I just recently discovered that it wasn't actually working for several of my wallpapers.  I tested this locally on a Motorola Droid running 2.2 and it seemed to work fine, so what gives?

A couple questions to the Android Development mailing list taught me that the market can't modify my signed APK file in any way, and the configuration between the working and non-working apps is exactly the same... plus, they work when I test them locally.  This means it has to be something with the market listing.  I did a couple of experiments with one of the folks who reported the bug to me, and eventually worked out that the 'copy protection' flag that the market allows you to enable on a listing doesn't play nice with SD card storage.  The install-location documentation doesn't mention this anywhere, so while I thought I'd been good to go for months, I've actually been sabotaging the feature by enabling copy protection.

So, half the point of this update is to disable that flag.  As mentioned with the City at Night entry below, I'm not a fan of completely invisible updates, so cleaned up the prefs listing using PreferencesCategory (which I just learned about) and additional color selections as a bonus.

As a side note, anyone with a leaked ROM isn't able to see anything flagged as copy protected, and that happens often enough to be meaningful in my experience.  Worse than that, Samsung just released an official update for the Galaxy S in some regions that also can't see anything flagged as copy protected.  Between the SD storage issue and the fact that it seems to frequently mean potential customers can't see the software, I think it's time to ditch the copy protection feature on all my listings.  As a bonus, it'll trim the amount of storage space required, so really everybody wins.

Sea Turtle!

Issues of scale aside, people really want a sea turtle... so here we go.  I'm starting with an existing model and reducing the polygon count down to budget, but he's looking pretty good so far.  This is based on an original model by Ajunip.  He'll probably have 200-300 triangles trimmed by the time I'm done, then it's on to animation.

Friday, August 6, 2010

City at Night v1.07

 - Update: More blinking lights

Sounds silly, I guess, but there's several more animated lights in the new version.  It's small, but a little more motion is always a plus, and I wanted to get a couple framework updates integrated without doing one of those completely invisible what-did-I-get-out-of-this style updates.  Enjoy!

Thursday, August 5, 2010

Generala v1.57

 - Bug Fix: White text on Droid X
 - Update: SD card storage support

I think one or two other things might've snuck in there too, it's been a while since Generala got an update.  Of the above items, the interesting one is the Droid X bug.  Let's discuss that.

Basically, what I was doing to control the color of the score text was to use a 'style'.  These are defined in an xml file and work basically like a CSS style, in the sense that you bundle up a font, font size, font color, and a number of other things all into a single object -- say, one called "BlackScriptBold".  Then, when you define your text fields, you simply hook that field up to BlackScriptBold to give it all those properties.

In general,  this is good practice, because that way if you need to do something like change the font, you only change the one style entry and everything using that style automatically uses that new setting.  Otherwise, you'd have to visit every place where you were using your script font and change them all individually, which in a decent size project could be dozens or hundreds of locations.  Obviously, there's a lot more margin for error when making a hundred scattered changes.  Thus, good practice.

So, this is what I was doing for the score boxes in Generala.  I got a bug report a week or two ago saying the scores showed up in white on the Droid X, which was nearly impossible to read against the paper-grain background.  I double checked that everything still looked right, which considering it works everywhere else I was pretty sure of, and ultimately ended up forcibly setting the color to black for each individual score box instead of in the style.  This fixed the issue.

The moral of this story is that if you're having weird issues with Android UI display on a Droid X, it's possible Motorola has munged up their handling of styles somehow.  Between this and the live wallpaper filtering bug (which I hope and pray gets fixed with the Droid's 2.2 update) Motorola's been a bit iffy with their handling of standard functionality so far...

Silhouette v1.45

 - New Feature: Camera zoom pref
 - Update: Greater range of camera motion
 - Update: SD card storage support

The primary work feature here is wider camera motion, which required rework of some of the background graphics, as, frankly, they didn't go all that far before.  Widening the landscape and sky models allowed for more horizontal camera travel in both landscape and portrait mode, which definitely helps the feel in this brave new world of 5 and 7 home-screen phones.

Along those same lines, I've had a couple folks request the ability to reduce the amount of black at the bottom of the screen.  After trying a couple approaches, I settled on one that moves the camera up and bit and zooms in its' field of view by about 20 degrees.  This frames the scene a bit differently and works very well, I think, while reducing the amount of dead space at the bottom of the composition.

Wednesday, August 4, 2010

Aquarium v1.8

 - New Fish: Clown Triggerfish
 - Update: Better overhead light
 - Update: Closer bounds on fish movement
 - Update: Mipmapping off by default
 - Update: Fish take an interest more often

Big credit goes to cliff1066™ for his (Creative Commons Attribution licensed) clown triggerfish image, which worked quite well as source material.  Check out his photostream for a bunch of cool stuff!

Closer bounds on fish movement is probably the most mysterious thing here.  Basically, the fish periodically select a destination to swim to, and upon approaching that destination slow down, begin turning, and select a new destination.  As they travel they'll occasionally re-evaluate and change to a new destination.  The destination position itself is randomly selected within a range of X and Y, roughly encompassing the background area.

As I've noticed occasional comments about fish leaving and not coming back (which is impossible given the way the system works, they simply cannot try to go anywhere outside the specified X and Y bounds), I'm guessing this just means the fact that they'll sometimes leave the visible area before turning and swimming back.  To that end I pulled in the left and right edges of their range by about 10%, so they shouldn't leave the edge of the visible area as much.

Thursday, July 29, 2010

North American Flags v1.0

Been working on this one the last couple weeks, and it's finally just about set.  This is an animated wallpaper showing a hanging flag blowing in the wind, with a bunch of customization options.  It includes flags of the United States, Canada, and all 50 US states.  There's seven backgrounds -- Five of places in North America, plus black and white.  You can select the state of the flag (solid pristine, translucent, or solid tattered) and the animation speed.  In landscape mode you get a more stylized angled close-up of the flag.  It's quite pretty!

Check out the YouTube video!  The wallpaper itself will go live tomorrow morning, and we're really excited about this one, the motion turned out really great and it's fun to watch!

Tuesday, July 27, 2010

Checklist

Things to get done on various projects:

* Fix Generala text color bug (Droid X issue)  ?????
* Enable SD card loading for Generala
* Mipmapping disabled by default for Aquarium
* Multitexture Aquarium overhead light, make it awesomer
* Look into water caustics style effect on Aquarium background images
* Wider treatment for Silhouette, scroll more on 7-screen phones
* Find source images for clown triggerfish
* Investigate usage rights on this image of clown triggerfish

Saturday, July 24, 2010

Aquarium v1.75

- New Feature: Shark
- Update: More active fish behaviors

I've seen some comments that the fish aren't active enough, so focused on improving this.  Fish will now change destination sometimes when swimming, they turn and move faster, and they have more drift when doing so.  In general the whole thing feels more lively, I think.

I also finally added a shark model, though I think he's a bit cartoony.  I'll see if I can get him a bit more in the photo-real direction everything else is next update.  When you feed the fish, the sharks get a steak instead of fish flakes.

Sunday, July 11, 2010

Aquarium Live Wallpaper v1.7

- New Feature: Interested fish!
- New Feature: Mipmapping w/ prefs
- New Feature: Roman Column prop!
- Update: Adjusted clownfish & triggerfish sizes

Fish have a new behavior!  When you tap on the screen, there's a chance (20% per fish) that they'll stop and look at the glass for a few seconds before continuing on.  This got a good reaction from test audiences  :P

Mipmapping is a rendering technique that reduces noise patterns in edge-on faces.  It also allows a texture to be rendered at a lower resolution when the higher-res version isn't needed.  It's generally a good thing both for framerate and rendering quality, and I had it enabled some time ago originally, but took it out when I discovered that some phones don't support OpenGL ES 1.1 style mipmap generation correctly... and there doesn't seem to be any way to tell the difference.  So, now it's re-enabled, and  if you have a problem it can be disabled on the customize screen.  Press menu and it's in the pop-up.

The implementation of the options pop-up itself should allow me to add in a few more options in the future, so it's useful having that groundwork out of the way.

There's a new prop available, it's a roman column sticking up out of the ground.  It seemed appropriate.

In response to feedback, the triggerfish is substantially larger and the clownfish a notch smaller.  This is a nod to their actual sizes in, you know, reality.

Saturday, July 10, 2010

City at Night v1.06

- Bug Fix: Light streaks should no longer pixelate

I got a couple bug reports about this... basically, after the wallpaper's been running for a while (several days?) eventually the light streaks and clouds would become pixelated looking.  I haven't seen this on my Incredible, but my guess is that the scrolling values simply got very, very high after a while... so I'm now rounding them down periodically.  Hopefully that does the trick.

Next Aquarium update

This update is going to be something of a grab bag of changes.  Firstly, I'm re-enabling mipmapping by default, and have added an options menu to the customization screen that allows disabling it if there's problems.  This should give a bit of a performance boost but still allow problematic phones to disable it.

I've added a new fish behavior -- when you tap the screen there's a small chance the fish will stop and look at you for a few seconds before continuing on.

The overhead light got an improvement.  It now has three modes, the third of which is more active and better looking than the current 'on' does.  It's also a touch more expensive, so pick your favorite.

The clownfish were reduced in size a bit, and the triggerfish enlarged.

Thursday, July 1, 2010

City at Night v1.05

- Bug Fix: Camera zoomed in too far after certain applications are run
- Bug Fix: Rendering stops too soon on the far left/right home screens
- New Feature: Pulsing lights on background building
- Update: Removed uses-feature:live_wallpaper from the manifest (please fix your bug, Motorola!)

I've got a bit of time to kill, so here's an explanation:

Running a forced-landscape application (The camera app, for example), then returning to the home screen, results in the camera being zoomed in too far.

When the OpenGL viewport is created, I'm handed a width and height by the operating system.  I divide the height by the width to calculate the ratio, which I then use to make sure field of view is correct on the in-engine camera.  Right after that I set a flag called IS_LANDSCAPE, which a few things here and there key off of (landscape requires less horizontal scrolling, for example, because the camera view is wider).  The place I set IS_LANDSCAPE looked like this:

if( screenRatio > 1.0 )
     IS_LANDSCAPE = true;

So what's the problem?  Well, if you switch to a landscape desktop, IS_LANDSCAPE gets set to true.  Then, if you switch back to portrait... well, nothing happens then, because those two lines of code don't ever try to set it to false, so it stays set to true.  Yes, this was a totally stupid bug.  This now looks like so, which sets the value at all times:

IS_LANDSCAPE = (screenRatio > 1.0);


On some phones the far left and right edges of the city image end about a tenth of the way from the edge of the screen.

This one was a little more interesting, though it wasn't complicated.  Basically, the way home-screen switching works is that when you swipe from one to another, a function called onOffsetChanged gets called.  It gets passed a 0-1 value.  The idea is, if you're on your far-left home screen, it's 0, if you're on your far-right home screen it's 1, and in-between it's whatever percentage across that space you're at.  Pretty simple.

What I do with this is set a value within my wallpaper renderer called desiredCameraPos.  Every frame, the actual camera position attempts to drift towards desiredCameraPos with some acceleration, so you get smoothly interpolated movement no matter what the offset changes to.

The person who reported this bug was using stock android, a Nexus One.  I've been testing on an HTC Incredible, which uses HTC's modified home screen.  HTC's home screens already try to do smooth interpolated movement, so their background parallaxes with the foreground icons.  On top of that, when you're on the far right home screen and try to swipe right again, the camera actually pushes a little further then springs back, like it's on a rubber band.  What does this mean?  It means that on an HTC Sense phone, the far left and right screens aren't 0 and 1, they're more like 0.05 and 0.95.  This means that when I was testing, I didn't see a gap, because the camera never got all the way to the end of the possible range.

So anybody testing Live Wallpapers on a phone running HTC Sense:  keep in mind that it doesn't go all the way to the end when scrolling, and make sure you test by forcing the value to 0 or 1 and make sure things still work okay.

The funny thing is, we did test this on a Motorola Droid, which runs stock Android, and didn't notice the problem there, either.  Why?  I'm guessing because the Droid has a 480x852 screen instead of 480x800, so its camera view ends up being a bit more tall and skinny.  Probably just barely enough that you don't see the edge.