Category Archives: iphone

Every size you need to know when designing for iOS

References

Building an app, the basics

iPhone launchimage/splash

Default.png Default-568@2x.png
Model Size Model Size
3 + 3GS 320×480
4 + 4S 640×960
5 640×1136

iPad launchimage/splash

Default.png Default@2x.png
Model Size Model Size
1 + 2 768×1004
or 1024×748
3 + 4 1536×2008
or 2048×1496

iPhone fullscreen

No status bar with status bar with status bar + navbar
Model Size Model Size Model Size
3 + 3GS 320×480 3 + 3GS 320×460
or 480×300
3 + 3GS 320×416
or 480×268
4 + 4S 640×960 4 + 4S 640×920
or 960×600
4S 640×832
or 960×536
5 640×1136 5 640×1096
or 1136×600
5 640×1008
or 1136×512

iPad fullscreen

No status bar with status bar with status bar + navbar
Model Size Model Size Model Size
1 + 2 768×1024 1 + 2 768×1004
or 1024×748
1 + 2 768×960
or 1024×704
3 + 4 1536×2048 3 + 4 1536×2008
or 2048×1496
3 + 4 1536×1920
or 2048×1408

iPhone app icons

App iTunes Spotlight
Model Size Model Size Model Size
3 + 3GS 57×57 3 + 3GS 512×512 3 + 3GS 29×29
4 + 4S + 5 114×114 4 + 4S + 5 1024×1024 4 + 4S + 5 58×58

iPad app icons

REQUIRED
App iTunes NewsStand (if Newsstand app)
Model Size Model Size Model Size
1 + 2 72×72 1 + 2 512×512 1 + 2 >= 512
3 + 4 144×144 3 + 4 1024×1024 3 + 4 >= 1024
OPTIONAL
Spotlight Settings
Model Size Model Size
1 + 2 50×50 1 + 2 29×29
3 + 4 100×100 1 + 2 58×58

Touch interfaces: Help for new users (any app)

I’m writing an iPad game that’s designed to be self-evident and trivial to use.

Today, I made a re-usable “tell the user how many fingers to use” animation that would work well with any app. So, I decided to open-source it and stick it on github.

Screenshot from my current app (NB: you need to photo YOUR fingers – not mine! – if you want it to look like this)

Usage

Instructions are in the source code, but my intention is for this to be ULTRA SIMPLE for you to use, so here goes:


// Add this to the main UIViewController for your app - the one that displays
//   when you're ready for user interaction
-(void)viewDidAppear:(BOOL)animated
{
	VFingersHelp* helpView = [[[VFingersHelp alloc] init] autorelease];
	/** This will position the helpview in bottom-left corner. Bottom left/right corners are where 
	users prefer to "touch" (c.f. Disney's style guide for toddlers).
	While they're watching the help, we don't want them touching, so we deliberately place in bottom corner.
	(feel free to move to top corner if you prefer).
	NB: it's easy to take a photo of your fingers and display at bottom of screen...
	*/
	helpView.autoresizingMask = UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleRightMargin;
	helpView.center = CGPointMake( 0 + helpView.bounds.size.width/2.0, 2.0 + self.view.bounds.size.height - helpView.bounds.size.height + helpView.bounds.size.height/2.0);
	[self.view addSubview:helpView];
}

Teenagers learn to program, write own 3D game, in 3 weeks

Background

Last year, Pearson ran the first ever Innov8 competition, giving tech startups a chance to make their own innovative new product/project. The grand prize was £5,000 towards building the product.

Most of the teams were adults (even: real companies), but a team of students from Blatchington Mill School won, with their idea for an iPhone/iPad app: “My Science Lab”.

Team: Quantum Games

The three students named themselves “Quantum Games”: Jon, Nick, and Oli. All three of them have been studying for their GCSE’s in parallel with this project.

They’ve been supported by Mark Leighton, Assistant Head / ICT Director at the school.

For mentoring and game-development expertise, they had me – Adam Martin – previously CTO at MindCandy and NCsoft Europe, now an iPhone/Android developer

Previously

The students chose to focus on a game that would help other students revise the “Momentum” part of GCSE Physics.

In summer/autumn 2012, they learnt the basics of game design and development. We didn’t do any formal teaching – they simply had to pick up the skills they needed as we went along. YouTube videos, and “trial and error”, were our primary techniques…

In particular, they learnt 3D-modelling and texturing (using Wings3D and Photoshop) and game-programming (using Unity3D and Javascript).

By the end of 2012, they’d written their own physics engine, some basic gameplay, and a simple simulation of an exercise/problem in Momentum.

Last month

The big thing this month has been BETT. Pearson had a large stand, and asked the students along to talk about the project. They gave an excellent presentation to an audience of approx 30 people at BETT, covering the background and some of the things that went well, that didn’t, and what they’d learnt from it.

Leading up to BETT, they worked hard to squeeze in a new build of the game, with a rethink on the interactive sections and how they hang together. Unfortunately, we hit what seemed to be a major bug in Unity’s camera-handling, and none of us could fix it in time (nor could we get an answer from Unity support in time). But the students managed to invent a workaround at the last minute which worked fine for demoing at BETT.

The game isn’t finished yet – GCSE’s and schoolwork left too little time to complete it before BETT – but we’re very close now. The students are aiming to finish it off this month and next, and I’m hoping I might even be able to take a copy to the GDC conference in March (taking place in San Francisco, GDC is the commercial games industry’s main annual conference).

In the meantime … you can sign up now on the Quantum Games website (http://quantumgames.co.uk), and we’ll email you as soon as the game is ready – or sooner, with a private beta-test!

London … from VERY high up

Courtesy of Gareth, I got a surprise trip to the Shard on opening day, just after sunset.

Tragically, I had my DSLR with me and *left it behind* 10 mins before Gareth phoned me, so all this is from an iPhone 4 (gasp!). Even so, it’s impressive. The Shard is so tall that you get a view of London without the typical “squashing” from perspective. Even from airplanes, flying in to Heathrow for many years, I’ve never seen quite such a decompressed view of London at night…

IMG_3417

IMG_3427

IMG_3448

IMG_3452

IMG_3456

4 reasons NOT to install iOS 6

As a developer, I’ve been using iPhone’s since they first came out. I have to test my apps on every version!

iOS 6 is the first version of iOS “post Steve Jobs”. But it’s terrible – it seems to be a 2nd-rate product rushed out by a small team of startup programmers, working from their garage.

As a developer … I’m dismayed. Consumers are famously slow to change (en masse) – but they are neither stupid nor indifferent. Their tolerance is high, but not infinite. The iOS 6 experience is going to force a lot of people away from iPhones. Looks like we’ll be doing a lot more Android development in 2013 than I was expecting …

1. It will DELETE your photos

Yes, really. You can recover them (from what I’ve seen so far: all of them) if you use backup recovery tools. But seriously: WTF?

Many google hits for this, plenty on Apple’s own support forums, with no response from Apple.

Or … it will randomly delete half your photos (happened to a phone I saw).

Or … it will REDUCE the quality of all your photos until they become tiny pixellated blobs.

AND … photos taken after you upgrade iOS 6? Forget it – they’ll be inaccessible too.

Deleting people’s photos is – commercially – unforgivable. I was amazed the first time I saw this happen.

2. It crashes. A LOT.

Until iOS 6, Apple’s OS was getting better and better with each release. I don’t *try* to crash phones, but it happens accidentally when you use the phone a lot. But iOS 6 is a total disaster.

  • iOS 2: took me 3 days to crash it
  • iOS 3: took me 3 weeks to crash it
  • iOS 4: took me 3 months to crash it
  • iOS 5: …never managed to crash it…
  • iOS 6: took me 3 seconds to crash it

    To be clear: this is through normal usage, nothing special, nothing “developer-y”.

    The iOS 6 crash was 100% reproducible, triggered by simply moving an icon on Springboard to a differnt screen, and then hitting the home button. Wow.

    3. It removes GPS and Maps from your phone

    Apple’s “Maps” app simply Does. Not. Work.

    iOS 6 REMOVES Google Maps, and there is NO WAY to get it back.

    So, now … unless you buy an additional “mapping app” (and there are none that are as good as Google Maps, unless you spend a huge amount of money), then … that GPS chip in your phone, that’s part of the cost of the phone? For most people it’s now a hunk of useless metal.

    In the last 10 years, very little in mobile phones has changed the way people live their lives quite so much as the instant availability of detailed, accurate, maps with GPS no matter where you are on the planet.

    Apple says you can “use Google or Nokia maps by going to their websites and creating an icon on your home screen to their web app.”. Wow.

    4. You cannot return to iOS 5

    iOS 5 worked. It was stable. It had a GPS! and Maps!

    …but Apple forbids you from running it if you ever install iOS 6.

    As a developer, this has been a recurring nightmare: we had to make sure no-one ever upgraded a phone – even by accident. (as a developer: you test your app on every old version of iOS that you can. Not just on a simulator, but on each physical phone)

    Now consumers get to find out quite how (unnecessarily and unfairly) painful that process is…

Made an iPhone game in 2hrs 15mins (native code)

How slow is making iPhone apps using native code?

You have to write HTML5, right, if you want FAST app development on iPhone? Or Unity? Or cocos2d?

Right?

Or … write it in Objective-C … a beginner-friendly “native” language: 2 hrs and 15 mins to create the artwork, design the game, code it in native Objective-C, debug it, and push to iPhone devices

NB: first half shows: “Collect the fish, avoid the dynamite, grow bigger!”
Second half shows: “if you hit dynamite, you shrink; when you’re tiny, if you hit dynamite, you’re fishfood :(”

For the love of … WHY?

Because I entered a voluntary “48-hour game jam” (you have one weekend to make a game), and last time I went to the Apple shop for a repair, they dislodged my network card. It fell out, internally, and it’s not user-fixable (believe me, I tried – even specialist screwdrivers aren’t enough :( ).

So I did something else with my weekend. But a few hours before the competition deadline, I figured “what the heck; what could I do in a couple of hours?” … with some encouragement from The Mighty Git.

The code?

222 lines of code, including comments, blank lines – and code that I commented out because I replaced it with other code.

That’s all it takes for a working, playable, iPhone game.

…and the art?

You can’t see it from the video, but the art is resolution-independent – as your whale gets bigger, it re-renders, so that all the curves ALWAYS have razor-sharp edges. No effort required on my part.

I did all the artwork in Inkscape (free image editor for vector images), and saved as SVG (web-standard for vector images).

Then, courtesy of the open-source SVGKit project (renders vector images on iOS, because Apple doesn’t add support to their libaries – shame), and the following few lines of code:

	self.sivWhale = [[SVGKImageView alloc] initWithSVGKImage:[SVGKImage imageNamed:@"whale-1.svg"]];
	sivWhale.frame = CGRectMake( 0, 0, sivWhale.frame.size.width * sivWhale.scaleMultiplier.width, sivWhale.frame.size.height * sivWhale.scaleMultiplier.height );
	sivWhale.center = CGPointMake( self.view.frame.size.width/2.0f, 0.75f * self.view.frame.size.height );
	[self.view addSubview:sivWhale];

If that looks rather like using a built-in UIImage and UIImageView … it’s because it’s intended to. SVGKit adds a new type of image – SVGKImage – that’s almost the same as an Apple UIImage, except it’s better (it’s resolution independent). And the SVGKImageView does for SVGKImage what UIImageView does for UIImage…

Want the code?

Sadly, the version of SVGKit I used here has some bugs in it – it’s live at: https://github.com/adamgit/SVGKit/tree/transforms – but until it’s been tested and fixed by the SVGKit maintainers, it won’t appear on the main SVGKit project page.

So, feel free to use that link and play with it – but be warned: it’s NOT as stable as the main SVGKit. Yet.

Updated: Static library for iOS – automatically cross-platform

I’ve just updated my script that adds a missing feature to Xcode – making your libraries automatically work on Simulator and on Devices, with no manual intervention:

http://stackoverflow.com/questions/3520977/build-fat-static-library-device-simulator-using-xcode-and-sdk-4

…and I’ve also put the script itself into GitHub as a gist you can easily copy/paste:

https://gist.github.com/3705459

Rise and fall of Microsoft’s hegemony over Apple

Building and Dismantling the Windows Advantage – a great article, telling the story in a mix of words and graphs.

“The consequences are dire for Microsoft. The wiping out of any platform advantage around Windows will render it vulnerable to direct competition. This is not something it had to worry about before. Windows will have to compete not only for users, but for developer talent, investment by enterprises and the implicit goodwill it has had for more than a decade.”

Exquisite drawing of London – exhibition in Ealing this Summer

Matteo Pericoli spent 3 years drawing central London from the Thames. His artwork is a 30-foot-long tapestry (that you can buy as a fold-out book).

There’s an exhibition just opened today with the original artwork at Ealing Gallery. What’s amazing is when you see it up close just how tiny some of the hand-drawn details are.

e.g. look at the horizontal lines in the middle of this photo:

(that’s my finger at the bottom – the artwork is under a thick layer of glass, so it’s safe to touch!)

Also, if you go to the gallery, there’s an interactive projection of the artwork onto the walls. It’s running an iPad app we made last year (to complement the paper edition). The app lets you tap each of the buildings on the skyline and read about history, architecture, etc.

AAA iPhone games more profitable than AAA Xbox/PlayStation games

Tim Sweeney, Epic Games (owners of Unreal Engine, and deelopers of AAA games on 360/PS3/iOS):

“The most profitable game we’ve ever made, in terms of man years invested versus revenue, is actually Infinity Blade. It’s more profitable than Gears of War.”

Touch Arcade has some terrible analysis (don’t listen to a word of it), but I quite liked their summary:

“Just let that sink in for a minute. Infinity Blade, an iOS exclusive title that has been priced anywhere between $5.99 and 99¢ over the years, is more profitable than a $60 AAA title that enjoyed all the glitz and glamor that comes along side a multi-million dollar game launch marketing blitz. We’re talking major network TV commercials, prime shelf space in nationwide retailers like Wal-Mart, and everything else …and Infinity Blade wins.”

…although *ouch* at that last 4 words, where they show some stunning foolishness. Console games make *more overall profit* than iOS games – Tim’s words clearly only covered the profit *margin* – making it very stupid to say “Infinity Blade wins”.

And we have to factor in (again, GAH! TouchArcade … do you really have so little idea what goes on in your own area of news?) that InfinityBlade *did indeed* get major TV exposure etc – it’s just that Epic didn’t provide it, Apple did.

What we really want to know is … what’s the ratio of profit margins between the two games – Gears of War 1/2 (their premier console AAA title), and Infiity Blade 1/2 (their premier iOS AAA title)?

My pure guess is that it’s a fairly small multiple – maybe only 1.2 x margin – so that if you have a LOT of money to invest, console is still a good target. Meanwhile, Epic will use this as justification that “everyone should license Unreal Engine v4 – because otherwise your dev costs are too high on console, compared to other platforms”

(as I hope we all realise … Epic stopped being “an independent game developer” many years ago; Epic in the 21st century is “a middleware company, that sometimes makes games on the side”)

Toshiba’s “failed vs. Apple” marketing

I feel sorry for Toshiba; they make good products, but their marketing
seems to belong to a much smaller, poorer company.

Take this advert, from April 2012, when Apple is already far along with shifting their whole laptop lineup to “ultra thin” MacBook airs (rumour suggests the non-thin models will continue to be phased out next cycle – doesn’t matter so much for this post, but if true, it adds extra emphasis to the post):

…and compare it with Apple’s photo from the same period:

Apple’s problems

The iPad 3 is considerably heavier and thicker than the iPad 2. This is a pain for users, but for Apple Marketing it’s a disaster. They’ve been fighting to prevent people equating “iPad” with “low power, low utility, inferior Laptop”. The iPad 1 had a fair go, but struggled. The iPad 2 went a long way to achieve it with it’s ultra slim/light/long battery life.

With other companies (e.g. Google) we’d assume that Apple did intensive market research on iPad 1 vs iPad 2, and found that weight didn’t factor into the purchase decision much. Given this is Apple … I expect it was an internal decision instead. They decided that the sheer awesomeness of the Retina display meant the pain of the weight + thickness would just have to be accepted. Personally, I agree: the Retina makes such a huge difference that it’s a no-brainer to buy an iPad 3.

(NB: even with the considerable increase in weight, and in battery quality, the iPad 3 has a considerably shorter battery life than previous iterations)

So, what does Apple do?

It’s not a bug, it’s a feature: Apple redefines Reality

All previous Apple marketing for iPad/iPhone has included side-on photos on the front page. iPad 3 is the first to use an isometric view – not just on the front page, but *everywhere*.

APPLE LESSON 1: If it’s bad, hide it.

The photo they use is EXTREMELY poorly positioned. The iPad 3 is contorted, the image is squished by perspective, the flower image looks terrible.

But you won’t notice any of that (unless you’re a product-photographer). No, you’ll notice HOW THIN IT LOOKS!

Apple carefully chose the angle to use perspective to hide the actual width of the product. It’s just shallow enough an angle to make it appear that you’re seeing the width – but just deep enough an angle to hide most of the width. (recall that the iPad 2 and iPad 3 both have a very deep bevel on the underside).

Apple also carefully chose the lighting: white iPad 3, ultra bright lights (my gut feel is these are even brighter than normal in Apple ads, which is very bright to start with), even the photo of a delicate thin flower (see what they did there?) is itself over-exposed a little. The iPad itself seems to almost … disappear … on the advert.

APPLE LESSON 2: If it’s really bad, make a photo that lies.

Toshiba: Fat, dark, and ugly

Let’s revisit Toshiba’s photo:

  1. the angle TRIPLES the width of the lid
  2. the angle DOUBLES the width of the base (look at the extreme bottom right edge – the base appears to mirror around the white hilight stripe)
  3. the inside is DARK, with HEAVY, THICK, DIRTY lighting
  4. the shadow underneath the laptop is ALMOST AS THICK AS the laptop itself, and coloured DARK BLACK

OK, so I could forgive poor colour scheme – marketing had no choice in that.

You could (maybe) forgive the stupid choice of perspective – maybe the laptop just looks ugly at any other angle. Or maybe they “needed” to show the ports on the side (if so, they failed: the lighting is so bad you can’t see the important ones).

But … who in Toshiba Marketing approved a photo with a black shadow underneath that makes their “thin” laptop look considerably thicker than it is? There’s no excuse for this: it’s a terrible photo (should have been rejected during the photo-shoot) – but it’s a catastrophically bad piece of marketing.

TOSHIBA LESSON 1: ?

TCE iPhone Games by Indie (and mainstream) Game Professionals

TheChaosEngine – private forums hangout for games-industry professionals. There’s an epic thread on there where people post projects they / their team / their employer has published on iPhone. It’s currently 40 pages long, so I went through and pulled out the links to the iTunes pages for each game.

NB: these run the gamut from “my first iPhone app” to “large-team of developers working for multinational publisher”. Quality here will vary hugely – YMMV!

Also, interesting to note … these are listed in order of posting to the forums, so … as you go down the list, you’re seeing an evolution over time of personal/indie (and occasionally “big team / AAA”) games on the app store.

TCE games, in first-launched order (earliest first)

  1. http://toucharcade.com/2008/12/12/ivory-tiles-a-unique-iphone-puzzle-game/
  2. http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=298060143&mt=8
  3. http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=289208006&mt=8
  4. http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=303057162&mt=8
  5. http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=305889055&mt=8&s=143441
  6. http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=307740243&mt=8
  7. http://zenbound.com/itunes
  8. http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=307117698&mt=8
  9. http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=311115651&mt=8
  10. http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=318996099&mt=8&s=143441
  11. http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=317781445&mt=8
  12. http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=321510472&mt=8
  13. http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=323694495&mt=8
  14. http://bit.ly/ifistchaosengine
  15. http://appshopper.com/utilities/isundial-2
  16. http://bit.ly/qqq_iphone
  17. http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=333962577&mt=8
  18. http://itunes.com/app/Coretex
  19. http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=334682266&mt=8
  20. http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=334683021&mt=8
  21. http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=335955369&mt=8
  22. http://tinyurl.com/yc9bpr5
  23. http://itunes.apple.com/us/app/revz/id352513901?mt=8
  24. http://itunes.apple.com/gb/app/fm-2010/id352933624?mt=8
  25. http://itunes.apple.com/gb/app/koan/id366816832?mt=8
  26. http://itunes.apple.com/us/app/tiki-towers/id298127125?mt=8
  27. http://ultrablast.net/
  28. http://bit.ly/aurifi_itunes
  29. http://itunes.apple.com/gb/app/denki-blocks/id371685186?mt=8
  30. http://bit.ly/yatr_iphone
  31. http://bit.ly/qqq_worldfoot
  32. http://itunes.apple.com/au/app/gamebook-adventures-2-the/id375065935?mt=8
  33. http://itunes.apple.com/app/id356565414?mt=8
  34. http://itunes.apple.com/app/reckless-racing/id386234787?mt=8
  35. http://itunes.apple.com/gb/app/tiltstorm/id392545121?mt=8
  36. http://itunes.apple.com/us/app/awakening-the-dreamless-castle/id386161821?mt=8
  37. http://itunes.apple.com/au/app/gamebook-adventures-1-an-assassin/id352871101?mt=8
  38. http://itunes.apple.com/au/app/gamebook-adventures-4-revenant/id395652668?mt=8
  39. http://itunes.apple.com/gb/app/cricket-captain-2010/id406333955?mt=8
  40. http://itunes.apple.com/us/app/pocket-frogs/id386644958?mt=8&partnerId=30&siteID=0JkCNyaaKoo
  41. http://itunes.apple.com/us/app/sky-burger/id311972587?mt=8&partnerId=30&siteID=0JkCNyaaKoo
  42. http://itunes.apple.com/us/app/scoops-ice-cream-fun-for-everyone/id291591378?mt=8&partnerId=30&siteID=0JkCNyaaKoo
  43. http://itunes.apple.com/us/app/dizzypad-frog-jump-fun/id357104694?mt=8&partnerId=30&siteID=0JkCNyaaKoo
  44. http://itunes.apple.com/us/app/textropolis/id301643671?mt=8&partnerId=30&siteID=0JkCNyaaKoo
  45. http://itunes.apple.com/gb/app/kamicrazy/id299644692?mt=8
  46. http://itunes.apple.com/us/app/bubble-dreams/id400309976?mt=8&ls=1
  47. http://itunes.apple.com/au/app/gamebook-adventures-5-catacombs/id422246290?mt=8
  48. http://itunes.apple.com/gb/app/family-games/id417601428?mt=8
  49. http://itunes.apple.com/gb/app/moving-day/id395714931?mt=8&ign-mpt=uo%3D4
  50. http://itunes.apple.com/gb/app/to-fu-the-trials-of-chi/id436987555?mt=8
  51. http://itunes.apple.com/gb/app/bashi-blocks/id441051678?mt=8
  52. http://itunes.apple.com/gb/app/magnetic-billiards-blueprint/id432152950?mt=8
  53. http://itunes.apple.com/au/app/specky-mark-of-the-year/id458244379?mt=8
  54. http://itunes.apple.com/gb/app/quarrel-deluxe/id453203047?mt=8
  55. http://itunes.apple.com/us/app/death-at-fairing-point-a-dana/id445507820?mt=8
  56. http://itunes.apple.com/us/app/lap-uranus/id447548601?ls=1&mt=8
  57. http://itunes.apple.com/app/cutesy-the-quest-unicorn/id463920538?mt=8
  58. http://itunes.apple.com/app/funpark-friends/id444438531?mt=8
  59. http://itunes.apple.com/gb/app/myragdoll-3d/id444210353?mt=8
  60. http://itunes.apple.com/gb/app/puzzler-world-2/id465620717?mt=8
  61. http://itunes.apple.com/app/shark-jug/id473563382
  62. http://itunes.apple.com/au/app/mini-motor-racing/id426860241?mt=8
  63. http://itunes.apple.com/gb/app/grabatron/id481309065?mt=8
  64. http://itunes.apple.com/us/app/leapin-frogs/id487318065?mt=8
  65. http://itunes.com/apps/gravityrocks
  66. http://itunes.apple.com/app/puzzle-bonsai/id491318778?mt=8
  67. http://bit.ly/lighthousegame
  68. http://itunes.apple.com/us/app/my-coin-match/id472717295?mt=8
  69. http://itunes.apple.com/gb/app/froad/id469021974?mt=8
  70. http://j.mp/EufloriaHD
  71. http://itunes.apple.com/us/app/end-night-hd/id498102948?ls=1&mt=8
  72. http://smallgreenhill.com/ballonawall/index.php
  73. http://itunes.apple.com/us/app/rune-raiders/id497702195?mt=8

Non-chronological

These posters didn’t provide a real iTunes link – I had to hunt it down on their websites – so they’re out of order:

  1. http://itunes.apple.com/us/app/ax-raven-elite/id331999733?mt=8
  2. http://itunes.apple.com/us/app/red-card-rampage/id388957922?mt=8
  3. http://itunes.apple.com/us/app/wordsnap-contraption/id412453514?mt=8&ls=1
  4. http://bit.ly/zSf5vc

Firefox Auto-restore (after a crash): Impressive stuff

For a couple of years now, Firefox has had a nifty feature where if it crashes – for ANY reason – the next time you run it, it gives you a “menu” of the windows you had open, and lets you selectively re-open them. As a bonus, this menu is just a plain window – you can ignore it (if you’re too busy right now), and open some other windows in parallel.

(even if it’s not Firefox that crashed – e.g. a laptop battery ran out, or someone tripped over your power cable – you still get this window. This is a huge help on OS X, which crashes quite a lot if you’re running Apple’s dev tools :))

I’d wondered a few times “what happens if it crashes again, before you’ve selected which things from that menu you want to re-open?”

I just found out the hard way: actually, it gives you a new menu, where one of the items is … the previous menu. It nests, all the way down (I had a crash-of-a-crash-of-a-crash – and I got everything back perfectly. Very useful, too – one of the deeply nested open windows was an important form I’d forgotten I’d not yet sent).

On the downside, if you close Firefox, and re-open it normally, the menu gets blown away – but that’s probably to do with the “five-years-and-counting still unfixed” bugs in Firefox where “remember open windows on startup” doesn’t work properly (there’s some epic threads in their bug tracker, many complaints, but no fix yet).

Still, for the most part, this is a very nice approach to application-crashing. One to remember when designing your own document-based applications…

2 reasons to beware Apple’s NSDictionary, and CoreData

Ever seen this hard to notice bug in an iPhone / Mac project? Caused by a flaw (bug?) in Apple’s own API:

NSDictionary * map;

NSObject * key;
NSObject * value;

// NB: next line will frequently crash at runtime
// …but even if doesn’t crash, it probably won’t do
// what you’d expect it to:
[map setObject:value forKey:key];

if( value != [map objectForKey:key] ) // HA!
{
NSAssert( 1 == 0, @”What the **** just happened??” );
}

NSDictionary is one of the nastier things I’ve seen in a programming language: in an Object-Oriented Language, it’s a class that refuses to take Objects as arguments, *but pretends to*. If you attempt it, it either crashes, or it invalidates your objects, breaking contracts all over the place.

ObjC’s bizarre design

In the days pre-OOP, a “dictionary” was something that mapped:

“a string”
to
“anything” (usually: basic datatypes – e.g. strings, integers, floats, etc).

In the days of OOP, the same thing is usually called a “map” (which is a better term) – although the terms are synonymous – and maps:

“an object”
to
“another object”

What did Apple/NextStep/Crazy-Guys-Behind ObjC do?

NSDictionary: maps:

“STRINGS ONLY” (no objects allowed!)
to
“OBJECTS ONLY” (no core datatypes allowed!)

But … I can use an NSObject as key?

Yep – but Apple’s internal implementation takes a *copy* of the object, and uses that as a key – rather than using the object that you gave it. This is a common problem in OOP languages and implementations of Map – e.g. Java does the same thing.

Unfortunately, this means that you can call “setObject:forKey:”, and then “objectForKey:” will return nil *for the same key*.

In Java and other OOP languages, you are required to implement a custom “isObjectEqualToObject” method. In ObjC too – except that that method is ILLEGAL if you’re using CoreData.

And ObjC will crash too, as a bonus

I’ve never seen this in other OOP languages, but in ObjC *additionally*: if you don’t manually add to the object you pass-in … it crashes at runtime. Yay!

How come? AFAICT, Apple’s header file is wrong:

– (void)setObject:(id)anObject forKey:(id)aKey // You lie!

it seems the implementation of that method is:

– (void)setObject:(id)anObject forKey:(id<NSCopying>)aKey; // the correct signature?

Net result? Code that happily compiles … will crash. ARGH!

Two reasons to beware…

…so what’s the other one?

Ah, just the one we see again and again on live projects, wasting hours and hours of time:

NSDictionary* dictionary = [NSDictionary dictionaryWithObjectsAndKeys:
object1, key1,
object2, key2,
nil];

NSLog( @”dictionary = %@”, dictionary ); // but it only has one key/value pair. ?!?!?

Ah, well … that nil … what happens when object2 is nil? Oh, damn.

What about if key2 is nil? Now we’re really nasty … we’ve given it “half” of key/value pair. Nice!

Using Genetic Algorithms to playtest an iPad game

Looks like a “normal” KickStarter project for a new Tower Defence game.

Halfway through the demo video, it switches to “here’s how I’ve been using GA to detect game-design flaws, and to test ideas in tweaking game design”.

Something I’ve wanted to do for more than a decade, but could never find a company who’d take it seriously :). I really hope this iPad game does well – would be great to see a poster-child / real-world demonstration of a workable technique here.

New game (Risk clone) – need SVG maps!

As a free-time project, I’ve been writing a Risk clone (*) for iPad.

One of the bits I like best right now is that you can give it the URL of *any* SVG file on the web, and it automatically turns it into a Risk map.

(e.g. all the maps in Wikipedia articles are SVG files – it’s a common file format with good browser support)

This was one of those “interesting” technical challenges – I had to find an algorithm that would automatically work out which territories a human would “assume” were connected to each other.

I’m using an open-source SVG library which works fine for basic SVG files but has a lot of bugs with the more esoteric ones. I’ve already fixed a few of the major bugs (they’re now merged into the GitHub project) – but I’d like to get more SVG files to test with.

The one thing to bear in mind is that the colour-data gets wiped when it imports. So … SVG files that make heavy use of different colours or gradient-fills/pattern-fills lose detail when imported.

Also, files where none of the elements are close enough to be deemed “connected territories” … work poorly.

Everything else works fine.

So … if you’ve got any, please post a comment here with URL, or email them to me directly (address in the About link at top of this page).

(*) – I say “clone” because it’s the same genre – but the gameplay is “fixed” quite a lot. If you once loved Risk, but grew to hate it, you’ll see why I wanted to change the baic game design :).

Throw away the iPhone? or throw away Gmail? Decisions, decisions…

For the past week, my iPhone’s have been unable to use Gmail. After approximately 4 hours, gmail locks you out of IMAP completely, unless/until you force-kill Apple’s mail client. The problem is … if you force-kill the client, you lose all emails you wrote, and you lose all emails you filed into IMAP folders (Apple’s client refuses to save state – it requires the server to do it).

Nothing has changed on the phones – and Google has been putting up irritating “stop using gmail, use the new gmail” ads for the same period of time – so I’m going to go out on a limb and guess that someone at Google changed something on the IMAP protocol that makes it no longer work correctly with iPhone.

I just had to write the same email for the second time, and re-file 50+ emails for the third time – and I’m giving up. You just can’t use gmail on an iOS 4 iPhone right now (I’m guessing that iOS 5 works OK, or there’d be an internet rage fest going on.

So. What to do. Dump the iPhone (switch to Android as my main phone, perhaps?)?

Or decide that enough’s enough, gmail is just too damn annoying these days (e.g. the 3 week period earlier this year where “reply all” was disabled on my gmail account) … I’ve heard there’s an email-for-life system called … hotmail?

Hmm…

Google Street-View on iPhone: a lesson in UX design

Today I finally discovered that the iPhone has StreetView.

That means it’s only taken me THREE YEARS to find this secret feature that Google has worked very hard to make sure no-one ever uses.

The best bit? The top two Google results for “iPhone Streetview” were both incorrect, and useless – but claimed to “solve” the problem (one of them was a Yahoo answer, the other a blog).

Eventually, courtesy of this amusingly-titled (yet poor in terms of Google hits) blog post, I found the solution:

  1. There MUST be a pin on screen – either because:
    1. you did a search for a place, and Google has found it and created a pin
    2. you tapped the curled paper in bottom right, then pressed the “drop a pin” button (incidentally: instead of letting you “drop a pin”, that button arbitrarily sticks a non-moveable pin in the center of the (now-hidden) screen. Terrible UX and GUI design. Google’s designers: what were you thinking?)
  2. The popup that’s attached to the pin has a standard button, and a standard icon – BUT THAT ICON IS NOT AN ICON
    1. …it’s an invisible button…

When we’re building iPhone apps for clients, this comes up typically once on every project: if you want to do custom user-interfaces, do NOT make them look like Apple standard interfaces. Apple has trained 200 million (total number of i* devices) to expect that (in this case: ) “a map-popup has exactly one button”. You are fighting against the work of one of the richest companies on the planet, a company famous for its marketing, interface-design, and visual-obsessions.

Worse is if you then go and break all the standards on what a “button” should look like, so that (in Google’s case), they:

  1. Put something in the place that is reserved for a non-clickable icon
  2. Used an icon-image instead of a button-image
  3. Provided no other ways of triggering the feature…even though this is usually NOT the place the user would want to click to get that feature

I laughed out loud when I discovered this – 3 years it’s taken me to get this to work, and me a professional iPhone developer too! How long is it taking the average “normal” user? If nothing else had convinced me Google is fundamentally f***ed by their refusal to design for anything other than “engineers who are exactly like us (and the rest of you plebs don’t matter)”, this would have nailed it for me.

We don’t need no AAA console studios

Over the past couple of years, there’s been much coverage within the games-industry press about the fall and fall of the UK games industry. Nicholas Lovell has done a particularly good job of tracking studio closures. Many of the big companies, and the trade associations, seem to have spent most of their time trying to win tax breaks.

The argument has been: It’s impossible for AAA studios, with hundreds of employees, to stay “competitive” with Montreal, Vancouver, et al – unless the government gives them vast amounts of free profit. If they are not gifted this money, they will shut down, and make people jobless; witness NIcholas’s Job Loss Tracker above for evidence.

But the thing is … I really don’t care.

I really don’t believe we “need” those big studios.

(EDIT: NB: this post was sparked by Andy Wilson of Codemasters stating: “we need to start supporting the industry properly or the whole thing is going to melt into iPhone developers – and there’s only so many 4-man teams who are going to find success”. Of course, Codemasters is a great example of a badly-managed, has-been publisher that chews people up and spits them out)

If they cannot make the same high profit margins that those of us skilled and bold (foolish?) enough to do iOS are making, then they’re just getting in the way, and should sod off.

How many iOS studios were whining about the need for tax breaks?

How many were just being quietly profitable, and focussing on being “more profitable through good solid product and marketing”, rather than begging government to do it for them?

I welcome the demise of bloated, badly managed, unprofitable, second-rate console studios.

I also believe that console studios will return – but they’ll be offshoots of iOS studios, and they will be managed a million times better. Let’s forget the old studios, and their shitty business acumen, their mismanagement, and piss-poor leadership.

Good riddance, I say.

(unless they continue to be healthy – in which case: well done, and what a great asset to the community and industry! I judge them by their success, not by their ability to chew through people and resource as inefficiently as possible; it often seems in the press today as though the latter is the most important criteria :()

Apple UK Contact Email Address

…because Apple hates giving customer support, and buried this address deep in their website, in a tiny font where it’s almost impossible to find:

contactus.uk@euro.apple.com

…and they just screwed-up an order we’d made, but all their emails were sent from fake Apple email addresses (“You have replied to a confirmation-only address that cannot accept incoming email.”).

The only alternative they offered was an expensive pay-per-minute phone number. I’m obviously not one of the True Mac Faithful: I don’t agree that *I* should pay Apple to fix *their* mistakes :).