Thursday, November 21, 2013

Photoshop Scripting: Quick Start Resources for Developers

This morning I took my first dive into Photoshop scripting. It was less hairy than expected but I wanted to share the resources I found that gave me the info I needed.

To start, I chose Javascript (or "ExtendScript") as my language. I don't see why you'd use anything else.

It is best to use the "ExtendScript Toolkit". Think of it as your mini IDE for Photoshop (Adobe) scripts. If you have Photoshop, you should have this toolkit. It makes it quite easy to run and debug your scripts. Auto-complete is present as well, but rather weak/slow.

As a developer, my biggest frustration with Photoshop comes in the form of opening and saving files. This is why simply recording actions just wasn't cutting it.

The best documentation I found for files and folders was this PDF:
Javascript Tools Guide

For general Photoshop scripting reference, this PDF:
Photoshop JS Reference 

You will notice that scripting does not have nice API's for everything you might want to do. For that there is a very handy plugin called the Scripting Listener. This plugin simply dumps the raw "executeAction()" code to a log on your desktop as you work in photoshop. It can be found here (along with many other references included, some already mentioned):
Scripting Listener Plugin & More.

The above plugin is absolutely necessary for doing things from HDR Tone mapping to simply adjusting brightness and contrast using the legacy setting.

Monday, January 7, 2013

Auxbrain 2012 Holiday Sales Index

It was Christmas again and app developers know: It's a merry time of year.

However, this Christmas was very different for Auxbrain as instead of being on just the App Store, Zombie Highway was also on Google Play and the Amazon App Store.

The big surprise was who the "winner" was. Not in terms of total revenue, but revenue growth: Amazon.

Apple pulls off its usual impressive leap, nearly 7x this year (much more than that if you take the low of December), but still can't touch Amazon.

To be clear: the Amazon figure wasn't small. It made nearly 50% of what iOS pulled in!

Once the Apple App Store charts unfroze, Zombie Highway was ranked 62 iPhone/133 iPad, 38 on Amazon, and 149 on Play. Those ranks explain discrepancies in revenue, but not growth.

I could write 10,000 words about why this may be. Android ecosystem problems, weak gifting of Android devices, Zombie Highway specific things, but I'll leave that for another time. The likely truth is it is all of the above, but that doesn't change the fact that Google is doing something wrong.


Play is still a mystery to me. Amazon is a wonderful surprise. Apple continues to dominate.

What tempers my excitement about Amazon is that it is dominated by 'old' tech. While on Play most downloads are coming from Nexus 7s, Galaxy S3's & 2's, the newest Kindle Fire 7" is on iPhone 4ish hardware. Worse yet, the Fire HD has the same fill rate as the non HD making it a worse performer with its higher resolution screen! For an old game like Zombie Highway, this is not an issue, but for working titles, I'm holding my breath.

I really hope Amazon makes a phone with equivalent or better performance to the 4S.

Tuesday, December 11, 2012

Speed up your Android NDK build

Because of a bug in the recent NDK-r8c release which effectively causes all builds to be clean builds, my frustrations with our Android build time reached a tipping point.

First the fix to the r8c build bug: (one character change (how does this crap get shipped?))

Second, I noticed my iMac was all to quiet after these build sessions, leading me to investigate and discover the somewhat obvious fact that g++ was only running on one core.

The way a typical Android build stack with ndk works is:
Ant  »  ndk-build  »  gnu Make  »  g++/gcc
Anything you pass to ndk-build in the form of command like args gets passed to Make. so the trick was a quick search for where to put some Make concurrency args in the ant build files.

I'm using the "jobs" flag to parallelize Make. -j4 for 4 jobs, -j8 for 8 and so on.

Typically you will have a build.xml in your Android directory which may contain everything or likely is a standard build.xml which imports custom rules (custom_rules.xml in our case). Wherever your ant files describe executing ndk-build you want to add:
<arg value="-j8">
To zoom out a little:
<target name="-pre-build">
  <exec executable="${ndk.dir}/ndk-build"..>
    <arg value="-j8"/>
Can't wait to see how fast it builds on the new iMac!

Friday, October 12, 2012


When I first played Re-Volt I had just started high school. From when I was about 12 I had an unhealthy obsession with remote controlled cars.  Not your Toys-'R'-Us variety, but the highly priced, extremely fast, parent's-worst nightmare variety. It is no surprise then that I was in love.

Fast forward 13 years and I'm a game developer myself. Re-Volt enters my life again. Was I to be disappointed with my lessened love for RC cars? No. The game is excellent. With the same too-many-clicks UI in the way, the core experience pushes the same buttons. The difference now, is that I more clearly understand why.

Re-Volt is not your typical racing game, and certainly not your typical racing sim. It's about track memorization, and razor fast reaction time. If you tried to play this game with a racing wheel, you'd pull a muscle. It also takes some advantage of its car selection as a strategic element. Some tracks require different car characteristics, namely drive train.

But the big reason I love this game is clear now: It is tuned to perfection.

Almost no matter where you are in the game there is something to do that is right on the edge of your ability with the cars you have. As you (sometimes barely) mark off items in the progress table, you unlock new cars that allow you to repeat the same process but requiring you to lower your reaction times to suit your faster car.

I should be clear: The vs computer races are not where this shines the most. They provide a welcome and more casual experience (the power ups are highly diverse and creative). The real magic is in the time trials.  This is also where you discover how awesome some of these levels are in reverse (by design). Mirrored tracks serve as a wonderful mental exercise to take what you memorized beating it un-mirrored, and reversing all the turns in your head (You can't play mirrored until you beat all the time trails for the tracks in that cup).

Today, I strive for this in my own games. Tuning difficulty constantly to match the player where they should be at that point in the game. Taking a piece of the game and doing a low work modification to double its value to the player (like mirroring a track). Providing a carrot for the user to chase after that doesn't just reward you by making the game easier when you get it, it makes the game more fun, and more challenging.

There are few games that get my heart pumping: Starcraft, Battlezone (and Battlezone 2), and Re-Volt.

Comments on the Touch Arcade Review
I was saddened this morning to read a luke-warm review on Re-Volt over at Touch Arcade. I get that Re-Volt is not for everyone, but implying Real Racing is a competitor for this game misses the value proposition of this game. If anything Re-Volt could have aptly be called: Unreal Racing. Not to say it's small world physics aren't impressive, but that the challenge is reaction, memorization, and even strategy.

The other element that I could understand complaining about is the default control setup: having acceleration be automatic, and only having controls for left/right with both activating reverse. Luckily you can change the control scheme to a game pad style or a joystick style (game pad worked best for me). I really do feel this is an omission that limits the scope of this review. Doing well in this game requires a different control setup (braking is mandatory in the 2nd half of the game). I can then deduce that Mr. Spencer never did well in this game, and it shows when he says that making one mistake in a race requires a restart later in the game. If you were using the default control scheme, I can see agreeing with this statement.

The review ponders why this game was chosen to port to iOS in an infinite sea of choices. I think the reason is clear to me: Whoever worked on this game, loved this game, and it shows.

Saturday, July 14, 2012

Awesome Twitter Status Bar

While every graphic designer and UX aficionado is threatening to leave twitter if they can't use Tweetbot or Twittelator Neueueue after the great 3rd party client purge, Twitter has updated its client with the coolest UI feature I have seen this year.

Behold, the repurposed status bar:

Beautiful, isn't it? Apple gives developers full control over the inclusion/exclusion of the status bar. Twitter is taking advantage of this, not to grab an extra 20 points of screen space, but to display its own statuses!

They cleverly show their own status bar when it needs showing, and display the standard bar at all other times. It is so well integrated, I bet most users think it's stock iOS behavior.

Just wonderful.

Too sexy! too sexy!

Mark my words.  In 12 months, every app with a status will. have. this.

P.S. Be sure to let me know if Twitter didn't popularize this so I can properly gush over the person who did.

Thursday, June 7, 2012

Whale Trail 2.0: Developer Analysis

Note: If you haven't played Whale Trail, go do so, it will make this post far more understandable and it's awesome (and free). iTunes Link.

Ustwo co-founder and wigged evangelist, Mills, has been hyping a reboot of Whale Trail with tweets like, "I can't wait to Free Willy", making it quite obvious that Whale Trail was about to get a freemium makeover.

As an avid Whale Trail fan, and a developer, I awaited with great anticipation for what this AAA developer's take would be on the always evolving "collect & spend".

As evidenced by this very post, it was a gold mine.

First Impression

WOW!  So many things are done right.  Simple and easy (albeit familiar) methods to purchase and spend in-app currency (Krill - awesome).  Most currency will be spent upgrading Willow's main attributes:

  • Frenzy Length
  • Frenzy Blast
  • Cloud Resistance
  • Max Trail Length
  • Max Multiplier

Additionally you can purchase one time use power-ups:

  • The extra life: Respawn
  • The "fast-forward": 8x multiplier
  • Whale Trail specific powerups: Trail Fill & Insta Frenzy

There are a slew of cosmetic upgrades that are irrelevant to the scope of this post, but they are entertaining to say the least.

Pricing of early upgrades is near perfect, and in the beginning, upgrades come after almost every play.  This is essential to getting users hooked.  Failure to achieve this leaves them feeling lost and unmotivated: "Why am I collecting [currency] again?".  

This early euphoria continues...

I truly can't believe I haven't seen more of this: in-app currency reward is bound to the core game metric: points.  More often than not you will see independence, like Limbic's Nuts! or Imangi's Temple Run, where you are trying to accomplish one thing with currency collection being somewhat tangential.  While doing this creates an additional challenge (and an additional upgradeable), I always find it more chore like and frustrating because I'm not being rewarded for surmounting the core challenge.

In Whale Trail, at the end of a game, your points are divided by 500, and that is your krill reward.  500,000 points?  Here is 1000 krill. Love it.  In addition, you get krill bonuses for various achievements or "Missions" as they call them.  Another step in the right direction, but the reward amounts are far too flat, and far too low to be interesting.  You end up accomplishing most of them by accident.  

One mechanic I've been obsessing over recently, and is prevalent in Whale Trail, is the slot machine.  Simultaniously, I've been interested to see how certain games "grease the gears" to get users in the habit of using consumables (See any NimbleBit title, or the new Mega Run).  

Whale Trail nails both with one hammer, well, almost nails both.

On your journey, you'll encounter mystery pick-ups.  You don't get to find out what they are until the end of the game.  They can be a krill bonus (25, 50, 100), or very frequently, one of the consumable power-ups (but never an extra life). 

Nice, an awesome slot machine that dispenses loads of gear grease. Take notes, devs.

However, once again the krill bonus is too flat. Later in the game a +25 krill bonus is like getting a rotten egg. What if one in a hundred was a +1000 krill or even +5000?  Like any good slot machine, the chance of an epic win makes for true addiction.

Euphoria still intact, I continue.

Whale Trail is a difficult game, and it got more difficult with this update.  This by itself is not a problem, in fact, I think it's great!  When I'm playing Whale Trail this time around, games feel more concise, and when they last, it's a rush.  The level design is great and more varied than version 1.

I Hit a Wall

Right around the time you start occasionally getting 500,000 points it seems almost impossible to do much better.  Worse yet, you often will score < 200k points with full upgrades.  You think to yourself, "Man, I got that score with half the upgrades I have now, wtf!".

There are many reasons for this, and I've been thinking all morning how to properly explain them.

Double threat.

The game faces the problem of having two (seemingly) linearly increasing difficulties which combine to create an exponential difficulty.  As you progress, the cloud mazes become more difficult to navigate, and the scattered colored bubbles become more sparse.  These two difficulties also interact.  Having fewer bubbles makes it harder to spot the best path and harder to recover from an increasingly likely collision with a cloud.

Many games have multiple increasing difficulties, but in Whale Trail they form an all too steep exponential difficulty experience.

Don't double punish me bro!

The point multiplier is the heart of progress and replay-ability in many mega hits.  Think Tiny Wings and Temple Run.  Whale Trail's approach is great: You can upgrade you maximum multiplier, but you have to re-earn your multiplier each game.  

Higher multipliers are reached sequentially, so it takes a long time in each game (even with the 8x head start) to collect enough colored bubbles to get the multiplier to your allowable max.

The extreme challenge comes with the fact that getting zapped by clouds not only drains your flight fuel, it also drains your multiplier!

So even if you manage to get that 32x multiplier, then hit a patch of clouds and manage to survive, you're left with a 4x or 8x multiplier. What is the point in continuing?  There is no way with sparse bubbles and crazy cloud mazes you are going to be able to regain the previous glory that was only possible with accumulated success from the easier beginning. At this point dying actually becomes desirable when Krill farming.


Here is how I visualize the difficulty variables previously mentioned:

I then multiplied these variables and some logical weight values and graphed the result - a very crude way of approximating overall difficulty.

I also graphed two examples for aggregate Krill collected in a run: one when making few/no mistakes, and one when making an early, harsh, but survivable one (Maybe you use a Trail Fill power-up to recover).

I want to see krill collection correlate somewhat closely with difficulty, but it doesn't:

Things that are wrong to me:
  1. Difficulty seems Exponential.  Obviously my numbers are made up here, but i'm just trying to quantify/visualize my experience.
  2. A mistake will end you.  If the mistake doesn't take your life, it will lead you to the next issue...
  3. No way to recover Krill/Point collection. As is reflected in my graph, with the low amount of bubbles in the late game, it is just not possible to get your multiplier back up when it takes a hit.
  4. End of your life sucks.  Except in the case of sudden death, your last moments in Whale Trail feel like a pointless struggle as you aren't earning many points/krill. Instead, these moments should be the most profitable.
  5. Trail is too elastic. It grows and shrinks too quickly

  • Adjust difficulty so that the late game is very slightly more survivable/recoverable. Addresses problems 1, 2
    • Show the paths of moving clouds
    • Increase the number of bubbles in the late game - no need to make consistently more, but add occasional dense pockets/strings. (also see trail suggestions to see how this won't be a big deal).
    • Don't make the camera zoom in so much when you are down low
  • Remove the multiplier cloud penalty Addresses problems 2, 3, 4
    • It's hard enough to get the multiplier maxed, no need to take it away
    • To manage high scores take control over length of play
  • Make the trail less 'elastic' Addresses problems 1, 5
    • Increase the max trail 'length' (not visually)
    • Make each bubble grow the trail less
    • Don't change how the multiplier grows
  • Use a more complex/fair cloud zapping scheme than ~2 zaps per second - goal: avoid punishing small mistakes. Addresses problem 2
    • Reduce cloud collision area by 10%-20% (perhaps make a function of cloud resistance)
    • Modulate collision damage by direction of travel relative to cloud.  1 - (Dot product of direction of travel and vector to center of cloud) = forgiveness factor when grazing
    • enter cloud from sky: zap
    • enter cloud from another cloud: no zap
    • zap 1 per 1-1.5 seconds after first zap while still in cloud
    • If finger is pressed (you are changing direction) zap twice per second
  • Ask for a review after the player's first 200k/300k/500k point run - there is no reason this game should have anything less than 4 stars.
  • Increase Upgrade Pricing. Many of these changes will naturally lead to more krill earnings.  No need to try to scale down scores.  Just increase higher end upgrade pricing.
    • Throwing a number out there, but just raise current prices to the power of 1.2 (eg 10 -> 16)
    • Consider making the top multiplier upgrade even more elastic say raise to the power of 1.3
  • Minor Suggestions
    • Make mission rewards larger
    • Make wildcard reward krill bonuses more elastic

I hope this analysis gives other devs some insight as to how I look at certain game attributes. In general, I'd love to see more devs sharing their technical perspective on mechanics.

I love Whale Trail, but more importantly, I love how Ustwo strives for excellence and embraces change.  

UPDATE: 7/2/2012
Whale trail was update with a few changes to ease difficulty and promote fun. The late game is more survivable/recoverable (both in terms of trail and multiplier) and there is a temporary +500 krill slot machine reward - all steps in the right direction - but missing the key element of making the late game the most profitable by removing the cloud multiplier penalty.

Friday, May 11, 2012

Hello, Old Friend

I awoke this morning with Diablo III on the brain. Blizzard always releases for Mac & PC, but for whatever reason, it reminded me of the prematurely defunct PC sitting under a desk in my den.

The OS hard drive was dying.  The video card really never did work right.

"So be it", I said, "let's get this puppy running."  It behooves me to mention that this was the machine where I did all my 3D work for Zombie Highway along with a good deal of the 2D work.  As of late I had been attempting to accomplish those tasks on the Mac via a "cross-grade" for CS5 (up yours, Adobe) and running 3ds max via Win 7 on Parallels.

It wasn't working out as well as I'd hoped.

After some quick Google searches I was ready.  I was going to plop a ~200GB SSD in the thing and a new video card (nVidia GTX 570).  The one tricky part was figuring out whether my motherboard supported SATA 2 or 3.  The confusion came in that SATA 2 supports 3.0 Gbps - so most spec. pages say SATA 3.0.  In any case...

SATA 2 -> 3.0 Gbps (If you bought your computer before mid 2011, it is probably SATA 2).
SATA 3 -> 6.0 Gbps.

After a quick trip to Fry's and some work with a phillips head, the thing was booting from a Win 7 install DVD.  With some driver installs and some Google searches (I had an existing RAID 1 I had to get explorer to see), she was in 100% working order.

I love it. No more HD clicking. Incredible performance. Better yet, I have my PC back.  A flawed and ugly creature next to the iMac, but charming none the less.

For me, the PC is where it all started, which maybe is why it feels so damn good to have this thing running again.