AVFoundation.framework / AVAudioPlayer problems

November 19, 2009

While adding audio support (using the AVAudioPlayer class, provided in iPhone OS 2.2+) I ran into three really strange problems and I thought I would share the solutions here. Adding the framework was not trivial, and apparently it will crash the simulator on many systems.

1) Base SDK might be wrong. First make sure your base SDK is set to 2.2. To do this ‘Get Info’ on your application name under ‘Groups & Files’ on the left and take a look at Base SDK. This framework doesn’t exist in earlier versions.

2) The framework doesn’t show up where you expect it. When you click to add the framework the usual way it doesn’t always show up in the list. To find the framework right-click on a framework you already have (ie: UIKit.framework) and then choose ‘Reveal in Finder’. This will show you were AVFoundation.framework lives. Just drag the folder into your xcode project.

3) AVAudioPlayer crashes in simulator!!!
After setting things up and testing on device I was puzzled to see the simulator just hang and a cryptic message emitted from the dev console.

=shlibs-removed,shlib-info=[num="53",name="Google Camera Adapter 0",kind="-",dyld-addr="0x5b51000",reason="dyld",requested-state="Y",state="Y",path="/Library/Components/Google Camera Adapter 0.component/Contents/MacOS/Google Camera Adapter 0",description="/Library/Components/Google Camera Adapter 0.component/Contents/MacOS/Google Camera Adapter 0",loaded_addr="0x5b51000",slide="0x5b51000",prefix=""]

The solution for me was to just navigate to /Library/Components/ and just delete the offending Google Camera Adapter components. (I don’t care what this camera thingamabob does, it crashes my simulator.)

Hopefully this can save you the time I already wasted.

Youtube as a research tool

November 18, 2009

As some of you know, my most recent iPhone project involves dinosaurs and claymation.

In order to establish a style google image search has been a valuable research tool. Google image search allows me to view a plethora of relevant but different artists conceptions in just seconds!

Naturally, when I decided to research how different dinosaurs moved I wanted to see different birds, reptiles, and other critters moving. The choice was clear, and I went to youtube. Good idea?

The dangerous related videos feature makes youtube an almost unusable research tool. Instant distraction is never more than a single click away. I am only human! As a result …

I present to you– my top 3 favorite dancing reptile videos.

The runner up in 4th place.

3rd place

2nd place

1st place

Now that those are out of the way I can go back to animating the dilophosaurus.

AppStore Keywords

October 12, 2009

I have been working on compiling a list of un-intuitive and unexpected ‘Gotchas‘ for app store rejections and I decided a short tangent was in order.

Getting an iPhone app or update approved is a crapshoot. There is no other way around it. The largest block in this seems to be the lack of clear policy. Much of the system seems to work on individual judgement calls. A ridiculous and arbitrary system becomes just a little more bearable if at least there is a set of consistent rules we can follow. So I am both happy to have discovered this, and frustrated with the decision Apple has recently made and posted. Apples policy on rejections based on keywords.

According to Apple “Improper use of keywords is the fourth most common reason for App Store rejections.” (requiring an entirely new binary to be submitted and processed, but thats an entirely different complaint) the document explains “The most common rejections are for keywords which are offensive, objectionable words or phrases; using trademarks, company or product names”

This is not only a 1) terrible idea, it also 2) contradicts US court decisions about trademark use.

First off, the little issue of keywords being a remnant from the 1990s that just won’t die.

1) When I think of searching I think of somewhat popular search engine that gives great results. How does this search engine employ keywords to search and rank results? It just doesn’t. Keywords are silly. Google knows this. Limiting search data to 100 characters alone is extra silly. Google threw keywords out for search results long long time ago.

2) And what about use of a trademarked keyword? As tech dirt neatly summarized ‘Court Says Keyword Advertising Isn’t A Trademark Violation‘ The key idea here is that it doesn’t cause consumer confusion so it’s not causing harm.

So it’s a terrible idea and it’s not consistent with US law. Surely it helps the user find what they are looking for?

As an example this is the result of searching for Tetris in google. 16,000,000 results, a tiny handful of which belong to copyright holders, but all are relevant.

What do we find on the app store? 20 results, 18 of which are EA titles (who have iPhone rights to Tetris), and 2 are random titles which somehow slipped through approval using the disallowed keyword.

Trism is a great falling blocks / match three puzzle game and is something that would instantly appeal to people who know Tetris. My game iso is another Tetris-like game people may like. These do not show up but Wolfenstein RPG does!

Since I am already rambling, lets slip a #3 in here.

3) Bedfellows. Tetris is just an irrelevant keyword when applied to Wolfenstein RPG as listed in the Apple doc. EAs healthy relationship with Apple shouldn’t give them special exemption from the rules. The results are too consistent to simply be a one-off oversight in the approval process, every single EA title is displayed.

So what can I conclude from all this?

1) Using trademarked names is officially disallowed, but still happens on the AppStore in some cases.

2) Using irrelevant keywords is officially disallowed but clearly done by EA games.

3) There is zero consistency in the AppStore and app approval/rejection process. When in doubt, resubmit it!

4) I am incapable of writing a short blog post.

I’m hoping the decision to use keywords and app title alone for search results will be corrected and the random inconsistencies will be cleared up. Search should be a way for users to find apps they want.

OpenFeint / Legal lulz

October 9, 2009

I have been considering integrating OpenFeint into my next project. If you haven’t seen OpenFeint before it’s quite impressive! It is essentially an API for adding extra social networking flash to an iPhone app. You can find out more on the official site.

The flash is in the form of highscores (local and global leaderboards) achievements, chat rooms, and of course friends / player profiles.

All this adds a whole sexy meta-layer to a game which has almost become a requirement (anyone having touched an xbox or modern console recently should agree!)

All this flash is nice of course, but the most tempting piece is how OpenFeint can allow people who have never heard of my game to discover it. Games using OpenFeint automatically get some exposure on the OF website and within gamers profiles etc. It doesnt take many clicks at all to go from posting your own high score to purchasing a game your friend is buying. OpenFeint makes 5% if they can sell someone a game. This is a good thing! They have a huge cash incentive to sell people playing other OF enabled games your game!

I am 98% sold on integrating this, the main hold ups now are:

  1. Learning another API
  2. Introducing bugs in code I don’t control
  3. Laughable legal agreements

#1 I can handle, I do have a lot of time on my hands lately and enjoy a challenge.

#2 I don’t believe to be too substantial of a problem. If the OpenFeint calls can be segregated cleanly and wrapped before being integrated this can be minimized. Not to mention a lot of very well known games (Knights Onrush and Stickwars) use OF already so they are more likely to discover these bugs first. Being a late adopter here is key.

#3 Is sadly becoming a fact of life. It seems to be the norm for developers or even customers to have to agree to contracts which in no way would hold up. I just wonder where they find these lawyers who write contracts that are the legal equivalent of using your one final wish from a genie to wish for more wishes.

Attached is the legal agreement for OpenFeint. The interesting section 5 is highlighted. If I am reading it right, it defines the contract to be a magical un-final, ever changing contract, to which they can modify at any point for any reason and you always implicitly agree.

Legal lulz aside, I think OpenFeint is a nice piece of software, and I will likely integrate it into future games.

[snip] 5. Amendment and Communication. Aurora Feint reserves the right, at its discretion, to modify this Agreement, including any rules and policies at any time. You will be responsible for reviewing and becoming familiar with any such modifications (including new terms, updates, revisions, supplements, modifications, and additional rules, policies, terms and conditions)(“Additional Terms”) communicated to you by Aurora Feint. All Additional Terms are hereby incorporated into this Agreement by this reference and your continued use of the Services will indicate your acceptance of any Additional Terms. In addition, Aurora Feint may be sending communications to you from time to time. Such communications may be in the form of phone calls and/or emails and may include, but not be limited to, marketing materials, technical information, and updates and/or changes regarding your participation as a Registered OpenFeint Developer. By agreeing to this Agreement, you agree that Aurora Feint may provide you with such communications. [/snip]

When I am not rambling incoherently or copying Joel Spolsky’s signature blog endings, I am working on great iPhone games like iso or modeling panda bears out of plasticine. Please leave a comment and let me know what you think of any of the above.

Taffy

September 29, 2009

I found myself wanting to make some candy over the last few weeks.

It’s really pretty amazing how sugar behaves if you just heat it up to different temperatures and then cool it!

So far the successes have been:

  • sugar covered hard candies
  • delicious and deadly sharp unsugared hard candies in the form glass sheets
  • sugary fine glass threads to put on things
  • melt in your mouth (but grainy) sort of chocolate-fudge-like-substance (really a failure at something else, but so delicious I have classed it as a success.)
  • a smooth, chewy, delicious batch of banana flavored salt water taffy.

Ok, so really it’s just dipping my toe into the ocean that is actual confectionary making. But it is a fun distraction.

The taffy is by far the most delicious and impressive imho. I will make it again!

The basic process for all candy making seems to be cooking sugar. The best guide to doing this without a thermometer (the simple ‘cold water test’) I found was here: http://www.exploratorium.edu/cooking/candy/sugar-stages.html

The taffy recipe I used with great success was: http://www.exploratorium.edu/cooking/candy/recipe-taffy.html

Though I halved the recipe, omitted the glycerin (cooking with non-edible by products doesn’t seem like a good idea), and used much less salt.

I don’t own a marble slab, and greasy pans don’t sound like fun, so I just used some parchment paper. Worked great!

It is nice to put down Xcode for an hour, and make some taffy. Mmm.

Code & Taffy

September 29, 2009

This my iPhone development blog. There are many like it, but this one is mine.

I have been considering clearing a space on the internets for me to put shiny things I find. I recently met with another developer who suggested I post some of the stuff I was talking about. So finally I will. This is that space. Best-story-ever.

Rather than try to convince anyone to be interested in what I am going to post (I don’t like undertaking impossible tasks) I will just list some things I would like to post here.

  • iPhone game development news / links / articles
  • Software development resources
  • Useful code snippets (C/C++, python, and other languages as needed)
  • Interesting applications / games / projects
  • Other “stuff” I find neat

First Post

September 28, 2009

First post!!11!11one


Follow

Get every new post delivered to your Inbox.