Wednesday, April 27, 2011

When will i find my portal 2 soulmate?

I finished the Portal 2 single player. I found it to be an incredible experience. Like the first game, I judged it early then was blown away by how much deeper and more clever it became as time went on. I'm eager to share the experience in the co-op mode.

It occurs to me that who you choose as your Portal 2 partner is important. I don't want to miss out on the wonder and surprise with someone who's been through it all before. How fun can it be if the person you are playing with has already solved all the puzzles? How entertaining is it for them having heard all of GlaDOS' chiding and sardonic comments? Wouldn't it be wonderful to experience this for the first time together? That's a magical moment. It can forge a bond that can never be equaled.

I need someone whose experience in Portal 2 is pure and untainted. I want to experience the rush of a perfectly executed plan knowing we both did this together. I don't want to feel rushed through a map because the other person knows just where to go. I want to savor the experience.

I don't want the lingering doubt, the uncertainty that my partner might be sizing me up either. Did i place that orange portal as well as the last person you played this map with? Just how many people have you played this map with? How many people have been through your blue portal anyway?

I know it's a lot to ask. There's a lot of pressure in our society to just beat the game. Each day that goes by, it becomes harder for me to resist the temptation to play. I might end up playing co-op with someone who's done it before. I hope that they are a good player.

I fear I'll probably get drunk one night and end up beating the co-op with a complete stranger. I'll probably wake up the next morning with little to no recollection of any of the subtle jokes; no memory of the tender chatter of turrets. I might even end up with achievements. That would be something i'd have to live with for the rest of my life.

For now, I remain strong. I'm waiting for that pure and virtuous player. The one i will play Portal 2 with until the end of co-op. I yearn for you Portal 2 co-op virgin.

Wednesday, March 30, 2011

I'm a programmer and i can't play SpaceChem


I often wonder. What if I made some programing tool that behaved more like a game than a text editor? What if it was animated and challenged you to complete tasks? What if it rewarded you, not just for completing tasks, but how well you completed them. In short, I wonder if I could create a programing game. Would that game have such well defined goals that i would be driven to wire up data sources to data consumers ad nauseum? While inefficient, would my productivity skyrocket because i simply could not stop doing my work and doing it well?

I think SpaceChem has answered that question for me. The answer is no.

It's not that SpaceChem isn't brilliant. It is. I highly recommend everyone try it. It's a great puzzle game that puts you in control of advanced machinery constructing required compounds on an atomic scale. Along the way you learn a little something about chemical bonds and molecular structure. It's actually quite commendable as the game is practically overflowing with actual real world information.

Playing the game involves composing instructions for your machine using a finite set of operations organized in order on a timeline. This, the main mechanic of the game, is a visual programing language. The player is essentially ordering operations in a looping thread. As the game progresses, the player must manage more than one thread and synchronize operations between them.

My experience with the game went something like this:
"Wow, this is a weird and trippy interface."
"WTF is a waldo?"
"oh! i get it!"
"Hey, this is cool, but if i'm going to be programming, I could just be writing programs."

After discussing the game with some friends, I've come to the conclusion that this progression is not uncommon. You will recognize it as requiring the same thought process and midset as programming. You will have a moment of glee when you realize your skills will make you better at this game. You will realize that you either could be putting that thought process towards something more constructive, or you are not being given the escape from the stresses of the day that you were seeking.

So if it's so engaging, why wouldn't it work as a gamification tool? If SpaceChem was actually wiring up my data model, would it be more compelling? It's true that one of the reasons I can't get into SpaceChem is I am painfully aware that I am working and accomplishing nothing. That might not be true for everyone.

Myself, I have a plate of tasks that need to get done. I have projects at work. I have projects at home. Had I applied myself to them in the same way i play SpaceChem, i would be moving towards finishing those projects. I like my gaming time to be a mental escape. I'd like to solve problems using different thought processes than i get paid to use. In short I'd like a new kind of challenge presented to me.

Even if a SpaceChem like gamified tool were actually getting my work done, I still think i would end up shying away from it. I think it wouldn't take much before i realized that a good old fashioned text file of instructions would be a far more efficient means of coding. It's the same reason I prefer command lines over gui tools. Did you know that to this day, guis provide no way to move a directory to a new location while simultaneously renaming it? Even Interface Builder's little drag and drop lines to wire up actions and outlets seem a little overwrought to me. Sometimes i prefer to just write those designations write into the text files.

So thanks SpaceChem for teaching me some valuable lessons. I don't think i can be fooled into doing my job with a game interface. I don't feel like i need to experiment with a game interface to do my job.

By the way, if you are not a programmer and like puzzle games, i can't recommend SpaceChem enough. Really, it's a phenomenal game. If you are a programmer, try the demo. let me know if you feel similarly.


Friday, November 12, 2010

Quantifying Your Importance

David Kernell, the young man who broke into Sarah Palin's email in 2008 was sentenced to 1 year in prison today. You can read more about it here.

Regardless of how closely our political views align to Palin, I think most of us agree that what Kernell did was wrong. I think most of us also agree that any transgressions on Palin's part wouldn't excuse his actions. As a society, we have created countless laws that govern just how illegal actions can be investigated by law enforcement. We tend to react passionately when we perceive law enforcement as overstepping it's bounds even when we know a crime has been committed.

What I find interesting about this story is the reaction most of us have. Breaking into someone's email is illegal. We wonder, "If this happened to me, would the culprit be prosecuted and sent to prison for 1 year?"

I think we know the sobering answer. No.

Sara Palin gets special treatment because she's important. Her importance to society isn't a measure of worth. It's just the result of celebrity and charisma. I think we can rattle off plenty of other "Important" people who would also receive this special treatment. The rest of us just have to buckle down and make sure our email accounts have strong passwords. I'm sure if someone broke into my email, law enforcement would agree it was wrong, but they probably wouldn't feel like expending any energy to pursue the perpetrator. Life is not fair.

However, there are some crimes of which i can be the victim and law enforcement will care! That's a thought that'll make you feel all warm and fuzzy inside. If you or I were murdered, there would be an investigation. Hopefully someone would go to jail, or worse if it's in Texas.

Clearly some crimes carry an importance that outweighs the unimportance of the victim. I wondered if this behavior could be represented in a simple mathematical model. The following equation jumped into my head.

N = (I^2) * T

Where N is the notoriety of the crime, I is the importance of the person to society, and T is the importance of the transgression.

I think for most people, I would start at 1/(the population of society). According to Wikipedia the US population is 310,688,000. Crazy that it's rounded to the thousands, but i guess at some point all populations go through round numbers. So my I would be 0.00000000321866 ish. Maybe it went up some because of my blog and a couple people have played my games. 0.00000000321868 is my I. I only factor in the US population because for the majority of society, people in other countries might as well not exist.

Now we assume that for people to pay attention to a crime, it's notoriety has to have a score over 5. that doesn't seem like much, but if you plug my score into the formula, you can see that the importance of the transgression has to be really big before people start caring. The fact that i square the person's importance makes it even harder for us people of fractional importance to ever get justice. Why did i square it? Well, then you get a nice curve where the closer you get to a whole number of importance the more notoriety crimes against you create. I like nice curves.

I would think a person's importance is modified by fame, money, looks, etc. Someone like Palin probably has an importance of 1. I think a Snookie could potentially have an importance greater than 1! Both are higher than Conan O'Brien.

I think we intuitively know this principal even though we don't quantify it in this way. I think we also understand that the reason people will rise up and fight for an important person who is the victim of a minor transgression is that the act raises their own importance. Are you a DA who prosecuted David Kernell? Your I just went up. Are you David Kernell? Your I went up too. I'm pretty sure the increase to a person's I is a function of the notoriety of a given transgression.

I don't know if this musing is enlightening. Now that i think about it, it's kind of disheartening, but it would be interesting to employ it in some kind of game.

Tuesday, October 19, 2010

Objective-C, you crazy.

I defined a class similar to this

@interface ProgressiveOperation : NSOperation{
ProgressiveOperationStatus operationStatus;
}

//some methods, etc
@end


it's just a handy little asynchronous operation to plug into the NSOperationQueue. It expects a delegate of a certain protocol to notify the UI that stuff is happening. It seems to work nice. Here's an example of a class that extends it for some trackable asynchronous functionality.


@interface WebRequestWrapper : ProgressiveOperation{

}

@property(readonly, getter=responseBufferType) WebRequestResponseBufferType responseBufferType;
//some methods, etc
@end


There's a lot more to this class, but it runs an NSURLConnection, updates progress as data comes in, and other nice things. One piece of functionality surrounds that mysterious property. WebRequestResponseBufferType is an enum that defines either file or memory. You see, i have a need to stream the response data directly to a file when my app receives lengthy ammounts of data from the server. This request wrapper can either save the response data to a memory buffer (as recommended by apple) or directly to a file. If you are curious, in the connection: didReceiveData: method, i write the data directly to an NSFileHandle instance. It's very fast and minimizes memory impact. I'm not really sure why Apple doesn't want you to do this as IOS devices are generally memory starved and I find this useful. That's another topic though.

I further extend this class to provide wrappers for specific urls that my app requests. some of these are small requests that go to memory, some are large data updates that go to a file. Because the getter is not synthesized, an subclass can just implement the getter to return the value that makes sense for it. I felt that the memory buffer model should be the default, so my implementation for WebRequestWrapper looked something like this.


@implementation WebRequestWrapper

@synthesize responseBufferType;

-(WebRequestResponseBufferType) responseBufferType{
return WEbRequestResponseBufferTypeMemory;
}

//methods and stuff
@end



Now, if you are an obj-c programmer, I'm sure you see what I did wrong. There's no need to synthesize a readonly property with a user supplied getter. Let me assure you, there is a fair bit more code in this class that masks this. Also my use of the user supplied getter was added after the class had worked with a member variable that was sometimes fiddled with by subclasses. Maybe it's the .NET speaking, but I rather like the pattern of defining an abstract property to provide these kind of configuration values to superclasses.

What happened when I tried to compile this code is where things got really weird. I expect it was generating 2 identical responseBufferType signatures in the class, but the compilation error I received said that operationStatus didn't exist. WTF? it didn't tell me that any other member from the superclass was missing. It didn't complain about a redefinition of the method. The compiler appears to have cherry picked a member at random and said it didn't exist.

This was harder to figure out than the time i wrote

#define NumTableSections 2;

Thursday, October 14, 2010

Why isn't 3D TV "worth it"?

It turns out 3D tvs are not selling very well. This isn't really a surprise to anyone since nobody wants one. If you ask people why they don't want a 3D tv they will give some general excuses about how it's just not worth it. It's the reason why it's not worth it that i find interesting.

People liked HD. People looked at HD content and saw that it was better. Our eyes are higher resolution than a tv screen (probably even higher than a retina screen depending on the individual) and a higher resolution image appeals imediately to us. People also like the wider aspect ratio. Humans have a field of view that is wider than it is tall. A widescreen display fills more of our field of view with what we are interested in.

People also have depth perception. We live in a three dimensional world. We should see 3D as another step closer to reproducing a vivid immersive experience. Obviously, people don't think it's a step worth thousands of dollars. I don't think it's just the economy though. I think there is a deep rooted reason why 3D just isn't that compelling.

Our brains are very good at extrapolating depth information from a 2D image. When we watch TV, we don't need to analyze the image to determine the spatial relation between everything in the scene. We know Knight Rider is driving right at us. We know Don Draper is standing right next to his secretary. We get 99.9% of the information in a scene from a 2D image. The third dimension adds so little extra information that it's not worth having.

I think our brains don't even like consuming 3D content. Technically, they don't. Our retinas are essentially 2D. They are spheroid in shape, but covered with a 2D array of sensors. Essentially our brains recieve a 2D image from each eye. We rapidly compare differences in the images and deduce depth information from it, or do we?

It's actually really easy to fool our depth perception. A room with one end slightly wider than the other will appear longer or shorther than it actually is. In an Ames room, it's often impossible for us to tell what's going on. If our brain comparing 2 images was all that gave us depth perception, we wouldn't be tricked. Someone at the other end would generate the same delta in the two images as someone standing 20 feet from you. it would require the same focal length as someone standing 20 feet from you, but your brain will tell you that they are a tiny person standing 10 feet from you. The trick works because lines you expect to be parallel are not. Data from the 2D projection of the scene overrules the 3D information.

It's just as easy to trick your brain into thinking it's seeing 3D content when looking at a 2D plane. Essentially TV does this all the time, but certain works really take advantage of our brain's extrapolation of depth. Again, the information coming from two eyes should overrule the illusion, but it's almost impossible to not be fooled. Most people have to concentrate to see a flat image.

Under certain situations people find it advantageous to force a 2D view of the world. Weapons are far easier to aim with one eye. landmarks are easier to line up when surveying. If you close one eye and try to walk around the room chances are you will be more bothered by the loss in your field of view than a lack of depth perception. In fact, the only time i ever hear people complain about not having depth perception (i have friends with bad astigmatism) is in regards to 3D movies and how they can't see the effect.

So how much of this is learned and how much of this is instinctual? In school, some of my teachers would recant stories of people in primitive cultures being unable to make sense of photographs and drawings because they never learned to see in 2D. That would point to our preference for 2D television being more a learned behavior than an inborn view of the world. Those stories are at odds with some other evidence though. There are numerous conflicting anecdotes of primitive people fearing a camera stole part of the subject's soul. Clearly those people recognized what the photograph was.

We know people represented the world in 2D long before there was television. Cave paintings are good evidence that people who never watched tv could work out how to project items onto a 2D plane. People have made paintings for a long long time. Prior to the advent of vanishing points and a mathematical understanding of perspective, painters made crude attempts at reproducing it. They seemed to understand that it was possible to represent the depth of a scene in a 2D plane. The instinct was there if the technique was not.

Maps are another very interesting 2D projection. People find them easier to use because they discard a useless third dimension. Even in 3D video games, players are often provided a 2D map to navigate by. It's almost like it's easier to consume the 2D content.

I really think our brains are wired to store and recall the world in 2D. How many of our memories can we zoom around in and reconstruct the scene from any angle? It's REALLY hard. I think 2D content on tv is more than just convenient. I think it appeals to our brain as it comes in the tasty form of instant memory. It's like a window into the world the way our brain likes to think of it.

Of course maybe we just like 2D content because we grow up watching TV. I don't really know. It sounds like the people making 3D TV's should be asking if 3D content can ever really be compelling.

Tuesday, October 12, 2010

Foursquare Saves The Day

I have never been what would be considered a strong supporter of social media. I regularly denounce facebook. My blog has a pathetic number of posts. I was slow to take up twitter. Even my ICQ number is 7 digits. Yet social media continues to drag me kicking and screaming into it's embrace.

It's not that i'm a naysayer or a doubter. I believe that communicating with people is a powerful tool. It's just that I am a cynic and a skeptic. When someone says, "You have to try this new way of talking to people by only using 140 characters! It will change your life forever!", I am skeptical.

Because people I respect are telling me this, I have developed a social networking attack plan. When enough of my peers are urging me to try some new social network, I will sign up and resolve to give it at least 2 weeks of regular usage. In the case of Twitter, I found a lot of value. After a couple weeks, I made new contacts. I discovered people with my interests, and i found a way to get information from people who i was interested in.

It was with that strategy that i approached Foursquare. After a couple weeks my feelings were as follows:

  • Foursquare is painful to use. The gps accuracy was spotty, it seemed slow.
  • It forces me through needless clicks. why do i have to click check in, then check in again?
  • It's too chaotic. The same place may be entered more than once.
  • People seemed to resent foursquare messages on twitter so i didn't connect it. It didn't feel social.
  • When i did have fun with it (adding a bathroom in our building and competing for mayor of it) people would delete the place.


After my 2 weeks, I felt secure in declaring Foursquare stupid. Then, something happened. I checked in at a local bar and found out i could get a free beer for my first checkin. Suddenly Foursquare looked different. Regardless of accuracy or if the system could or could not be gamed, I could get a free beer. Maybe I'm not going to make Foursquare friends or feel like i'm part of a community, but a free beer is a pretty tangible benefit.

I decided to stick with it. I gained a couple mayorships. I aquired some coveted badges. I earned my swarm badge naturally. I didn't have to attend some geeky nerd party where everyone agreed to check-in for the expressed purpose of getting a swarm badge (ok, I got the swarm badge at the Game Developers Conference. It's probably the ultimate nerd party). Yet I still felt like Foursquare was a pointless exercise.

After months, I hadn't gotten any more free beer, and I still didn't feel like Foursquare was doing anything for me. Facebook places came into existence and has, for me at least, seemed faster, more accurate, more social, and more streamlined than Foursquare. I can't even believe that I am praising a facebook feature as more streamlined than something else, but there you have it. I view that as even more evidence that Foursquare just isn't cutting it for me.

My wife called to alert me to some suspicious charges on one of our cards. We have experienced credit card theft in the past. It's hard to describe the agonizing sinking feeling you get when you see your money diverted for mysterious and nefarious purposes. The charge in question was for $38.70 at Popeye's. I don't even like Popeye's. It seems like it might be hard to buy $40 of food at Popeye's. The thought that some glutton was running around clogging their arteries on our dime was even more sickening.

We all know that it's important to keep good financial records. In fact, because of our credit card theft experiences in the past we REALLY feel it's important to keep reciepts and records of all our transactions. HA! That lasted a couple months before we realized that it's just not practical. If you can keep all that information handy, good for you. I can't. My wife can't either and she's WAY more organized than I am.

At this point, we are pretty certain that we didn't spend $40 at Popeye's, but there is a tiny nagging doubt in the back of my head. Before we call the credit card company and dispute the charges and cancel our cards, I want to quell that doubt. I think that if I knew what I was doing around the day the charge was placed, maybe it will jog my memory and I'll recall something that will prove I couldn't possibly have been to Popeye's, and i will feel confident in disputing the charge.

It occurred to me to check Foursquare. I bring it up on my iPhone. I start scrolling down the list and lo and behold! I checked in at Popeye's!

For a second, I imagine an incredibly sophisticated criminal who can steal my credit card, and check me in on Foursquare. This is the first thing that pops into my head. It's possible my friends are right when they say I think like a criminal. However I see that Popeye's is NOT Popeye's famous fried chicken, but a nautically themed restaurant on the picturesque shores of Lake Geneva, WI. I recall that my wife and I DID enjoy a nice, but pricey $40 lunch there.

Foursquare actually provided a beneficial service to me. It wasn't social, but it was useful. Facebook, while easier to check in on, doesn't provide a nice list of check-ins. at least the Facebook iphone app doesn't provide that. And Facebook is notoriously abysmal at providing historical data. Foursquare had a nice list. Thankfully it looks like the two are integrating and maybe in the future I can enjoy the convenience of the Facebook checkin with the organized reporting of the Foursquare history list. All that and I can feel like pulling out my iPhone at dinner is just being responsible with my financial records!

Foursquare, you've proven yourself to me once again. I'll continue to use you (for now).

If you work on a crime show or movie and would like to hire me as a consultant about how criminals could mask their tracks through Foursquare, I think I have some good ideas.

Monday, July 19, 2010

The real problem with iPhone4


I am an Apple developer. I've ridden the roller coaster of AppStore deployment and always come off the ride ready for the next one. I cherished my 3G. I've experienced the rush of WWDC, and I've stood in awe on the grounds of the mother ship. I openly mocked the iPad, then fell in love with it when i actually came into possession of one.


You could say I am a fan of Apple.


I fought through the reservation system issues when the iPhone4 was announced. I stood in line 5 hours on the day of the launch. Looking back, it was all a little silly. I don't regret it in the least. The past few weeks with my iPhone4 have been great. The camera is incredible. The screen is incredible. I've felt in almost every way it's delivered on Steve Jobs' promises.




Last night, the honeymoon ended.




My problem is not with the antenna. In all honesty, i don't care about how easy it is to choke the signal from the phone. I understand that some people may want a phone that they can hold in whatever fashion they want to make long uninterrupted phone calls with. The iPhone4 may not be for those people.


The phone functionality is the functionality i care least about. It's true. I like apps and games. I like the email client. I like the calendar. I like safari. I like the camera. I like using my phone as a garage door opener. The phone aspect is a distant last in the things i like to do with my iPhone.


Because i don't care about the phone part, i don't particularly care about the antenna issues. I figure that no product is perfect. When one buys a car, there is usually some compromise. You can't get the sports car AND haul a lot of luggage around. You can't have a serious off road machine and a wonderful silky ride. The best you can do is find a product that excels at what you like to do, and pools it's weaknesses in areas that you don't care about.


That's exactly how i feel about the antenna issue. I know it's there. It's a valid critique if that's what you want an iPhone4 for, but it's a non issue to me.


So what happened last night that brought my world crashing down?

I dropped my phone.


I was seated on my patio. I reached to pull my phone from my cargo shorts pocket. When i unbuttoned the flap, gravity beat me to my phone and pulled it two feet down to the patio surface. My heart skipped. A series of clacks arose below me and were swallowed by the darkness. It only took a second.


I carefully retrieved the phone from the ground. I didn't know what to expect. My 3G had certainly taken worse spills than this. I prepared myself for scratches or a ding in the metal casing.


As I brought my phone back into the light i felt some relief. The face was bright and free of any marks. It didn't take long for the true nature of the phone's injury to reveal itself though. I could feel pockmarks in the back. Turning the phone over revealed the horrific spiderweb of cracks that now infused the surface. This seemed bad.


At this point There wasn't much i could do. I made an appointment with the genius bar as soon as i could and hoped that the genius would look upon my plight with mercy.


The brand of mercy offered at the genius bar wasn't quite as benevolent as i had hopped. They told me standard phone replacement is $200, but, because they felt bad, they would replace it for $100.


I thought this over a bit. $100 seemed steep. I considered a couple of other options.


I had looked online during the day and found rear glass panels available from china for $11. I consider myself a handy guy and i feel i could easily dismantle and reassemble the phone. I could replace the panel myself.


I could also just own the damage. Maybe if i put some duct tape over the back it would prevent the glass from slowly splintering away. Maybe it would look cool too. Anyone can have a sleek iPhone, but none would have the time tested character of my duct tape encased monstrosity. In time something that is legitimately covered by my AppleCare might turn up, and i could be eligible for a nice trade in then.

I asked about the likely outcomes of my two options. Surprisingly the genius said if i replaced the back competently, it was likely nobody would ever know and my warranty would remain intact. He did caution that if i were to fail, i would be in a worse situation. What really surprised me though was his answer to my second proposal. If i were to simply mask the cracks, i would not be covered for any other phone defect in the future. That's right. Because the cracks look bad, they would simply assume my phone was heavily damaged.


Let me expound upon this situation. My iPhone4 suffered a fall that i have never seen a phone not handle. Indeed, nothing major seemed to happen to my phone. It still works fine. I don't believe the damage is anything but cosmetic. I'd like it to be fixed because it seems as though the glass will continue to splinter and break off in dangerous shards, but it certainly seems like the internals of the phone are perfectly fine. However, because the cosmetic damage looks far worse than what one would expect to see on the previous phone models, even a minor fall will prevent them from honoring AppleCare.


This doesn't seem right. It almost seems like a racket. Create a phone with one exceedingly fragile part, then refuse to honor consumer's extended warranties unless they shell out $100 for every little bump the phone takes.


I doubt the structural integrity of the phone is a calculated scheme to milk consumers for repair money. However, Apple has created a fragile product that can not withstand the normal wear and tear expected of a phone. If i could choose to only drop my phone onto surfaces that ranged in the very low end of the mohs scale of hardness i would. Unfortunately we don't often get those choices. I would expect that this phone could handle the same kind of falls that my older model could. Clearly it can't. One small fall shouldn't result in damage that puts your extended warranty into question.


I used to and still feel the antenna issue is overblown. I would have recommended the phone to anyone but the most die hard phone callers. Now, I don't know if i can really recommend the phone to anyone who lives where there is gravity.