Monday, March 29, 2010

No, you can't break it into sections

Pretty much everyone who read my previous entry said "hey, can't you break the image into sections?"

No, you can't break it into sections.

The whole point of the algorithm is that it turns multiple images into one high quality image. To do this, it has to align images precisely. If you sacrifice any part of the image during alignment, you will not get a precise match.

Wednesday, March 24, 2010

super... project abandon!

Well, I have abandoned yet another project. Yay!

This time it was a super-resolution app. The idea was: you take several photos with your iPhone camera, it processes them, and returns one really high-quality photo. Turns out there is no way in hell that you will have enough ram to complete that task. Just allocating the floating point array to process photos took 36mb out of an allowed 24.

If someone is super interested, I still have the code laying around.

Time to work on the simplest game I can so I can finally get a project out.

Friday, March 19, 2010

Apple and Naming Conventions

For those not familiar with Cocoa (Mac OS, iPhone) development, Apple has strict naming schemes for their libraries. They actually have an entire document dedicated to this (seen here). Methods that return a boolean are "shouldPerformAction", actions which are about to happen will look like "willDoSomething", actions that just completed will look like "didDoSomething", etc. A lot of Cocoa criticism comes from the fact that this causes a lot of the method / variable names to be extremely verbose. "Can row x in a table be selected?" becomes

(NSIndexPath *)tableView:(UITableView *)tableView willSelectRowAtIndexPath:(NSIndexPath *)indexPath

"Trim this string" becomes:
[string stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]

I initially disliked this when first starting iPhone dev, however after a number of months it's really grown on me. Yeah some of the lengthy stuff is annoying, but it really makes a lot of the code REALLY CLEAR on what's happening and that is extremely valuable.

Anyways, sometimes this naming scheme breaks down and that's what I'm here to complain about. When the user taps a row on a table (like in the email or iPod app) the following method is called:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath

There's also others that follow this:
- (void)tableView:(UITableView *)tableView didDeselectRowAtIndexPath:(NSIndexPath *)indexPath
- (void)tableView:(UITableView *)tableView didEndEditingRowAtIndexPath:(NSIndexPath *)indexPath

Some cells have a little blue circle with a > inside of it, this is called a UITableViewCellAccessoryTypeDetailDisclosureIndicator (yeah). When tapped, the view slides over to a more detailed view of the data. For example you tap a row in the Recent Calls list and it calls the number back, tap the blue circle and it brings up contact information for that person. So what method is called when this is tapped?
- (void)tableView:(UITableView *)tableView accessoryButtonTappedForRowWithIndexPath:(NSIndexPath *)indexPath

Huh? Not at all what you'd expect. I figured I'd be looking for "didTapAccessoryButtonForRowAtIndexPath". There's no "did" in this. Instead of "...RowAtIndexPath..." we have "...RowWithIndexPath...". Why is this so different? I know this sounds like a tiny nitpicky thing, but Apple has put literally thousands of man hours into standardizing this shit. It makes no sense that this single method name is so different from the others.

Now, it didn't take me more than a few seconds to find the method name I was looking for, so I'm not complaining about it destroying my productivity or anything, but it just doesn't make any sense for this to be so deviant.

Saturday, March 13, 2010

new idea

I had an idea today:

Mechanical Turk is a great way to take a little bit of thinking from a lot of people and apply it to one big project. But what about *really* boring stuff, like recognizing whether a photo is of a mouse or not?

I give you Mousewheel v1.0. It features massive arrays of lab mice, tv screens, and buttons that dispense treats. Three mice are shown an image and trained to respond a certain way to it. For example: if we are searching for mice in photos, they push "yes" if there's a mouse, and "no" if not. The majority gets a food pellet each. Mice with low accuracy are ground up and fed to the other mice in order to serve them better.

The cost of running a single mousenode is far cheaper than a mechanical turker. Watch out Amazon, I'm coming for you!

+0600

We're saving multiple images, woo!

I am amazed at how complicated I made this problem. I had to keep track of some files, and what project they belong to. I realized I could just use folders, and just name everything the timestamp of when it was created. I guess I was so caught up in database-think, I thought everything had to have a magical uniqueid.

Monday, March 8, 2010

Things I have learned

It is hard to debug UI issues, because you can never tell if that white screen you're looking at is really the widget you think it is, or maybe it didn't load and that's the background, or maybe it loaded and it's just colored entirely white, or maybe something white is on top of it, or maybe your code is in an infinite loop and it erased the last UI element, but hasn't loaded the new one.

Argh.

I got the phone taking a picture without any of the camera interface crap, and saved it to memory. Now to take a million photos and save them all.

Saturday, February 27, 2010

Virtual Currency

What's the difference between real currency and virtual currency?

The only thing I can really come up with is that there are laws pertaining to real currency.

I keep waiting for someone to make a decent virtual currency exchange. I think all you would have to do is get some VC funding and get a few major players onboard with you. As soon as a large enough currency allows you to trade for real money or goods, you'll be able to do all your business government tax-free. You'll still have to pay Facebook or Microsoft or Apple or whoever, but not your local or federal government.

It is a brave new world we live in where every company is trying to build their own money system.

Switch!

I have switched to primarily developing an app that will let people share sketches in a more... asynchronous way. I now have an app that I can scribble a white line on. Woo!

Hilton has agreed to work with me on our iSketch clone, and I think we'll get a lot accomplished, I'll be doing server dev, marketing, support, and some client-side, and he will do the majority of client-size.

I think that a major mistake many app developers make is to follow these three steps:
1) produce quality app
2) ???
3) profit!

Except when 3 never materializes, they blame anything and anyone for it. "The app store is broken!" "Apple is fucking us again!" "The users don't appreciate quality apps!" "Rargh!" Step 2 is actually marketing. If you took the best product in the world and stuck it on a random shelf at Wal-Mart, you could expect only a handful of sales, at best. This is what you're doing on the App Store.

Friday, January 29, 2010

Threading woo!

Fixed an annoying UI bug where UI updates done outside the main thread fail to update until an event propagates into the main thread. Now a user can "login" to the game.

Wednesday, January 27, 2010

Woo ski trip!

I finally got back into development after a long bunch of trips and wedding planning.

Now my app has the beginnings of a UI. All I have to write is 50 other things and it will be working!

Sunday, November 29, 2009

Happy T-GIV

Boy, writing a client-server game is hard. You have to simultaneously develop a protocol, write a server, and write a client to prove that each of the other two components are doing what you expect them to.

I feel like I haven't gotten enough done lately on this project. I need to get more done.

Wednesday, November 25, 2009

Technical Debt

I decided that I was designing my game entirely wrong, and I have since decided to work on a different project. For those who cared, I was working on a Tetris Attack clone, which seems to be conspicuously absent from the App Store.

This new project will require me to write a server for the game, which should make this an interesting (and more difficult) task.

Saturday, November 21, 2009

See glass

Turns out you can do callbacks with Cocos2d. Nice job hiding one of your most powerful features! Maybe they felt it was:
  1. Too difficult for new programmers
  2. Error prone, even for experienced programmers
  3. Just didn't really feel like documenting things that day
Today my main competitor set their price on the App Store to free! Thanks guys!

I really think devs are 100% shooting themselves in the foot by setting their price to free in an effort to gain popularity and convert that to sales. You can look at it as extremely low conversion rate advertising.

Friday, November 20, 2009

Stupid Errors

Today I got a fucking deadlock because a filename was blank. Sometimes Objective-C errors go way beyond cryptic, to where they make harder to debug the program than if it just said "ERROR: Something broke."

Now I have gravity animations woo.

I found Pinch Analytics the other day, does anyone know if it's any good?

Thursday, November 19, 2009

Gravity

Well, now I have gravity and matching implemented.

The hardest part of making a puzzle game that is a nice to look at and play is making everything not happen instantly.

Today I was reading the SA iPhone apps thread and iPhone games thread. To quote Ted, "100 pages isn't a thread, it's a fucking research project", but I'm finding it quite informative.

They pointed me to the AppShopper Blog and Touch Arcade (yes, I hadn't heard of this yet).
I thought it was pretty interesting to see the number of apps approved per day in the store.

Wednesday, November 18, 2009

Cocococos2d

Today I fixed the bug with Cocos apparently projecting my 2d game with a 3d OpenGL flag that was causing my tiles to have random gaps between them ranging from 0 to 1 pixels. Argh. Here's the code for people who care:
[[Director sharedDirector] attachInView:window];
[[Director sharedDirector] setProjection:CCDirectorProjection2D];

I probably lost the ability to make my game wave-y, but whatever, now it looks right.

I also finally found the Cocos2d iPhone docs Now I can have some idea of what the hell I'm doing.

Monday, November 16, 2009

Big whiny crybabies throw a tempy tantrum

I got pieces moving around interactively with touches today, woo!

Some guy and some other guy quit iPhone development a few days ago.

I'm sure Apple is totally scared the iPhone is going to fail now. "Oh no! We've lost two high profile iPhone developers! Wherever are we going to find several thousand more to replace them?"

Ask the average iPhone user to name one iPhone developer. They'll say "uh... the guy who made Paper Toss?"

No one gives a shit about individual developers. Get over it.

Friday, November 13, 2009

Coordinates locked in

Argh I still don't like Objective-C. This is like a painful lesson in why Python is such a great language. Explicitly setting pointers to point to things, allocating memory for objects, declaring things twice in .h and .m files. All Gay.

I got my developer certificate thing from Apple. Boy, did they bury the instructions to get everything set up. I was expecting an email that said "click this link, 1, 2, 3, 4, now you're done!" But I had to go dig for it.

My app is reporting coordinates that were clicked on. It's a small step, but I'm making progress.

I bought geoDefense Swarm. It's definitely been worth my $2. I recommend it to anyone who likes tower defense games.

Tuesday, November 10, 2009

Apple logo glowing brightly

Well I came to Dallas to work on iPhone stuff with Ted, got next to nothing done, but he convinced me to use Cocos2d-iPhone as a framework for my game. I think I will end up saving way more time by using this than I lost from sitting around doing nothing for 4 days.

I also found the OpenFeint dev page. Even though I hate the name, it seems like it might be useful for adding multiplayer with low effort.

Random plug: geoDefense Swarm has to be one of the best tower defense games I've ever seen, and it's for iPhone! Screenshot:

Sunday, November 8, 2009

NS means NeXTstep

Working on iPhone dev with Ted. I just manage to draw two separate objects with OpenGL. It's too bad none of the Obj-C examples show how to do this. They mostly seem to focus on cramming all your geometry into a single triangle strip for efficiency.

Optimize-first design isn't really a development practice I want to adopt.

I guess Zen Bondage finally made a port to iPhone: Zen Bound.