Sunday, April 21, 2013

Simple diversions

I've been working on my game for a bit over the past few weeks, but have run into something of a roadblock. I don't know whether I want to continue on this path - I'm having a hard time "finding the fun" in it. Plus, the "real job" has been a real Debbie Downer, so I've been in a bad mental state. Not sure if the problem I'm experiencing is general malaise or if it's indicative that the game really isn't that fun. I've been playing some Modern Warfare 3, Civilization V, and Skyrim (trying to level my blacksmithing to 100) trying to recharge my enthusiasm. Not really helping so far. Although I did get my blacksmithing to 100 and then made it "Legendary" which reset it. Not really sure what the benefit there is, yet...
I attended the Mile High Agile conference on Friday and one of the sessions was about "gamification" in the agile space. A lot of the context was "how do you insert game elements into your teams so that they stay engaged". He provided some examples like LinkedIn's profile completeness (you want to be at 100%, right?) and the Nike+ product (which I'd heard about in a different context) tracking/sharing/comparing against your friends. There are some game elements in there to be certain. I'm not sure what elements of gamification would work at the 9-5, but the jarring reminders about basic game design left me contemplating the game I'm writing. Some of the basic elements (progression of difficulty, activity loops, etc.) just really aren't there. Is this because I'm failing to write something of quality or is it because there are different elements? What is the "fun"? How hard/easy is it to "find the fun"? Will it end up being the same game over and over again (and therefore boring) or will people stay engaged? How might I make the game continually challenging?
All of this was swimming through my head all weekend and I wasn't really any closer to resolving it until actually writing it out in this blog. I have some ideas about progression now. I had already decided on some kind of "ranking" system, but that was just a rudimentary tracking system based on the number of games you'd played successfully. But the difficulty of the game never changed - until now. I think I know how the single-player game can be more dynamic and grow with the player. Nothing fancy, mind you - but enough to make it something someone might be able to start with and then get better at over time. Not counting the multi-player version, of course (which will be hot-seat only for now, I've decided - back-ends and me are just not working right now).
So for now I'm working on the fully-expanded version and will then winnow it down for the first time players. But the point is that I'm now feeling a little more energized about working on this. Sometimes all it takes is a conversation with yourself to get back on track. Owen Goss, the main guy at Streaming Colour Studios, tweeted me this morning (whilst I was in the depths of whining about my un-developed/un-released software) that I needed to just "ship it!". And he's absolutely right. Funk over - development restarting. Thanks Owen.
I thought I'd leave this here, though. It's my Xbox Gamer Card and shows how much (or how little) I'm playing. And if you have an Xbox live account and want to kick my ass (not a hard thing anymore), maybe I'll see you online.

Monday, January 21, 2013

UITableViewCells and Forgotten Wisdom

I've been playing around with a new game for my daughter based on an old game called Electronic Detective. I'm actually making a version of it for her to play (since my old solid state system, for some reason, only plays about half a game before crashing out). I had originally planned on making everything fit onto a single screen (which would have been better on iPad, but I'm a sucker for pain which is why I'm making it for iPhone), but decided to be considerate and moved from a single UIViewController view to a new UITableView layout. But the new version of Xcode makes creating UITableViewCells a little, um, wonkier than I remembered.
NB: I'm sure this is all 1,000,00% easier with storyboards, but I'm not using them as I'd like to target devices more than 6 months old. And yes, that was some slight sarcasm.
The first thing I ran into is that when you add a UITableViewCell .h/.m to your project, it doesn't allow you to create a .XIB with it. You need to create the .XIB separately. Then, the thing I've learned, is that you need to set the class for the VIEW to be the new .h/.m class name you selected. Do not set the File Owner to be the new class - leave it as UITableViewCell.
If you don't do that and leave the view as the UITableViewCell or if you set the File Owner to be the new class, you're likely to run into a dreaded "this class is not key value coding-compliant for the key XXXX" error. This is not terribly useful but some searching on slashdot and other places guided me in the right direction. If you've come here because you searched for that and you're using UITableViewCells, then here is likely what you're seeing as a problem.
This is one of those problems that I continue to stumble upon as I work through things only periodically. I forget some of the tricks and tips I've learned previously. But as my spousal unit and I have decided that she will not be returning to her job at Lockheed-Martin (as they have recently changed their leave-of-absence policies denying her the ability to take a second year off to watch our illness-prone son), I need to start getting some more titles in the App Store - and quickly. Given that, I will be working more feverishly to get things completed and released and will be sharing far more on this blog than I have been of late. And I will hopefully be retaining more of this forgotten wisdom.
Wish me luck!

Sunday, December 30, 2012

Care when posting from the web

I've been working on a new application (Electronic Detective for my daughter) which will be the basis for a longer-term game effort and ran into a strange thing. I decided that how I was going to be doing the UI for a particular portion of the game was just incredibly clunky. I had remembered a piece of information that needed to be included and rather than shoehorn it in, I decided to take a step back and see what made the most sense. In this case it was changing things from a static UIView to a UITableView. This opened up a lot of potential real estate and made it possible to do some things I was struggling to fit on the screen before.
I was searching to find the best way to get UITableViewCells working with the new Xcode (4.5) since they've sort of changed how they operate since last I'd done one (a long time ago - in a galaxy far, far away). I found a good sample from a blog post and decided to just copy/paste and modify the sample code. And things were fine - until I got a very strange build error - "unexpected '@' in program". Um, whiskey tango foxtrot was that? I searched a bit more and the answers proposed didn't seem to really address my particular error. Here was the offending code (from a code blog I found):

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
 static NSString *CustomTableCellIdentifier = @”CustomTableCellIdentifier”;

 UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CustomTableCellIdentifier];

 if(!cell)
 {
   NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@”CustomCell” owner:self options:nil];

 if(nib.count > 0)
 {
   cell = self.customCell;
 }
 else
 {
   NSLog(@”failed to load CustomCell nib file!”);
 }
 }
 
There didn't really seem to be anything wrong. The highlighted lines were the ones causing the problem and I couldn't really see a problem. Each of the literals was perfectly correct. What the hell was going on with this code? Then I stumbled upon a stackoverflow question and answer that provided a little insight. What was weird about the editor was that it wasn't showing the text formatted as "text" - it was just showing as black text, not the typical red you'd see. Then I read the part about the "smart quotes". I replaced the first "quote" with a regular "quote" and the text higlighted. That's when I realized I must have pasted in smart quotes and that's what was causing the problem.
I replaced all six quotes and things started working the way I expected. So, as a word of caution, Xcode apparently will maintain some special characters when you paste code from other sources. Make sure that if you're pasting that you double-check the characters. If things don't look correct to you, they probably aren't. It may be a bit weird, but it may be worth your effort to retype some of it manually in the editor to see if it's a problem with the paste or with the code. You could save yourself a little mental anguish by trying a couple of simple things. Good luck and happy coding.


Wednesday, December 19, 2012

Maya Long Count Updates

It has been a pretty busy couple of months. The first thing was that I ran into the problem with the glyphs. I got all of the new glyphs redrawn, scanned, cleaned up, and integrated into the application. That took about a month to sort out. I did get everything integrated and here's the screen shot from the main screen. Once that was done, I then submitted to the App Store. It was the first application that I've published into the App Store (link here). Given that it was a total "stealth launch"it's been doing a bit better than I expected. Last night I tweeted:
"This is cool. I've earned $3.50 US, $1.26 Australian, $0.70 Canadian, €1.08, and ¥60 from my app. Taxes should be interesting."
Overall there have been 17 sales in 6 countries. I'm interested to see what happens after the end of this b'ak'tun - whether there will be additional interest or if I'll see my sales drop to zero.
I decided to do a free, ad-supported version as well. Hooking up the iAd banner was surprisingly straight-forward. It took very little time to get the banners installed but when I started looking at doing the full-screen ads I've seen in other apps I found out quickly that the iAd network doesn't do it for iPhone - just iPad.
I've been playing with the idea of using Greystripe at one point and this provided the opportunity to get it integrated. With iAd's lack of full screen ad support on iPhone, Greystripe was the solution. The was a problem, though, in that the test ID that they provided failed to work properly. I "violated" the terms a little a turned on the ads while I was testing. Given that I had done most of the work already around the testing, going with "live" ads wasn't a gigantic hit on the volumes (I think I used 7 impressions for testing).
I did get the free (lite) version submitted to the App Store on December 12th and it sat in review for a few days. I did get a notification yesterday that it was being reviewed and very quickly went from "In Review" to "Ready for Sale". Here is the timing on that:
 I was amazed that it was less than 2 hours from start to finish. Overall it was pretty amazing to see how quickly they got it squared away. Admittedly there was already one there that was practically the same thing but it was a different application. My original app took almost 2 days in review. This was 2 hours.
Anyway, both apps are now officially available for sale and Otto Von Productions, Inc. has published and sold its first applications. Now I just need to get the other 41 ideas I've got swimming in my head completed and published. Maybe I'll end up making this whole thing work after all.

Friday, September 21, 2012

New glyphs are done!

So I spent a little time finishing off the glyphs for the app. I think they look "okay". At least "okay" enough to be in version 1.0. And, for me, they're "freakin' amazing". *sigh* As I said, my graphic artist skills leave MUCH to be desired. Anyway, without further ado, here are the glyphs I made for the app.
The glyphs for my app

Not bad, eh? Yeah, I think they'll suffice. I did spend quite a bit of time making them and hope that they'll be met with approval by the community. It was definitely not something I felt at all comfortable doing, but sometimes it helps to get out of your comfort zone.
I'll point out that these are the original drawings - I haven't cleaned them up at all. I will be extracting the individual glyphs and improving them before incorporating them into the application. From personal experience with other graphics exercises, this will take several hours. I just hope I'll be able to get enough time strung together to make it happen. I also need to get the description written for the application, so that's something else I need to get a block of time to accomplish.
So, there we are. Hope you like the preview here. Once I'm done and submit everything to the App Store, I'll post a link.

SLIGHT delay on Maya Calendar App

So as I was going through the submission process to get my Maya Calendar application onto the App Store (yes, that was actually happening!), I needed to create a description of my application. I decided to go see some of the other applications in the space to see what they had crafted for their descriptions - check for inspiration, really, not plagiarism. No, seriously - no plagiarism. I think I might just like typing that word...
Mine on left, theirs on the right
Anyway, as I was going through looking at "maya calendar" (as opposed to "mayan calendar") I stumbled upon an application - using the exact same graphics. In fact, their icon was the same idea (with a different glyph - see right for comparison). Well, *(^*&!@. And AS I WAS SUBMITTING MY APP! I found that the website I'd "borrowed" the glyphs from was the same site that had the application I found. *facepalm* O.M.G. Bad me for thinking they wouldn't be used somewhere else.
So what did this mean to my calendar app? It meant that I needed to have some new glyphs. I asked my daughter if she'd be inclined to draw them (there were 44 required) and she agreed. Then she drew the first one and decided "um, no thanks - that was HARD". So it fell to me to draw some new ones. I used some different sources to get ideas for what they looked like (including the ones that I can't use now), but I've redrawn all but five of them. Next will be scanning them in, then cleaning them up, then integrating them into the app. The nice thing is that integrating them is a piece of cake - I just need to replace the existing files with the new ones. Also, I'll have higher-quality ones to use for an iPad app (if I do that). While they will be similarities to other glyphs on the web, they're hand-drawn (by yours truly) and lacking the funding to fly to Central America to tromp around Maya ruins looking for samples, I have to do it virtually. Which means other peoples' pictures.
So I'm close to having that app in the store. I'm really hoping that I'll be able to get it done by the end of the weekend. We have a very busy time planned, but here's hoping that I'll have a little time during those two days to get this sorted out and submitted. In the meantime, I'm working on getting a description put together so I can just copy/paste it into the submission page and go from there.
Fingers crossed for a successful submission. Then it's the waiting game for approvals. I'll post more on that as we go through that process.

Wednesday, August 29, 2012

Nearing completion

Current launch screen for the app
So I've been working a few hours every night trying to get closure on the Maya Calendar application - and I'm almost there. Except for a marathon Bejeweled Diamond Mine session this evening (I didn't want to quit until I'd topped 200k) I've pretty much been working on finishing up the application. I've got the backgrounds all changed - they look very nice now - and am working on the final touches. I was going to do a universal application - both iPhone and iPad - but the size on the app was making it ridiculously large. Like 60 MB large. Wow. Um - no.
What's left you ask? Well, I've got some "about" kinds of things to finalize. Need to get the application version information in there as well as information about HOW to use the app. Plus I wanted to put in some text about the long count calendar - where did it come from, how was it used, etc. Once I get those things in and working as expected I think I'll be ready to build it for distribution. I don't have an iPad version yet at all. I think while I'm waiting for the App Store approval process to complete I'll work on the iPad version. I've got all of the graphics and logic - just need to change up the display. I think.
Things have been coming together over the past few days. I feel that I've been productive - moreso than in weeks past. In order to get things finished I need to do something I haven't ever done before, so I do still have a little more work to do, but I feel now that I'm closer than ever to having something completed that can be submitted to Apple. And that will be a huge boon to my self-esteem these days. I also made some adjustments to the graphics that, for a non-graphic artist, I feel pretty good about.
Anyway - just a quick update. Looks like things are getting close. Now to sprint to the finish line and be done with this.

Sunday, August 26, 2012

Oddness with the Maya Calendar

So I've been reading up a LOT on the Maya* calendar over the past few months. There are two different calendrical systems - the Long Count (which is what we hear about when people talk about the end of the world in 2012). The current date in Long Count (as of this post) is 12.19.19.12.0. There's another calendar is called the Sacred Round and uses what are called Tzolk'in and Haab dates. This calendar was more religious in nature and had a full cycle of about 52 years. When doing calculations for Long Count or Maya calendars it's common to include both the Long Count and the Sacred Round dates.
One thing that seems clear is the basic calculations to get the Sacred Round dates. The Wikipedia article describes pretty clearly the arithmetic required to derive these. The regular Sacred Round cycle is 360 days and there are 5 Wayeb days (that were considered unlucky) to make the calendar 365 days long. Close to the 365.2422 days our tropical calendar is, but it means that the Sacred Round shifts one day forward compared to the tropical year every 4 years.
One problem is that I would like for my application to work for dates all the way back to 9999 BCE (and forward to 9999 AD/CE). Most calculations are done using Julian days as a baseline, but the Julian dates start in 4730 BCE, a little later than my 9999 BCE desire. What's a developer to do? Well, one option is to try to address the negative values that come from going before the start of the Julian dating scheme, which is what I initially thought of doing. Then I realized that since there is a higher-order cycle above the currently accepted five values, I could add what's called a piktun worth of days to the count, in essence moving back the Julian calendar about seven thousand years. I did this and it worked great for the Long Count calculations - I just subtracted out a piktun if it was past the beginning of this cycle or not - it all worked out. The Sacred Round, however, was a different story.
The reason is that the Sacred Round starts at specific values for tzolk'in and haab. Moving back a whole piktun, though, means I needed to recalculate the tzolk'in and haab values. I figured out what the new offsets were and after resolving some oddness with displaying the correct glyph for the tzolk'in and haab I seem to have gotten everything working.
The only things I have left to do to get this thing out the door is finish the polish for iPhone and get the iPad version looking reasonable. All of the testing I've done to date is solid. I still have a few things left to validate, but I actually have a high confidence that it will work pretty well. Then two versions - one free and ad-supported and one for $0.99. Then I'll have broken my 3.5 year drought of getting apps into the App Store. Yay?

* You'll note that I'm not using "Mayan" anymore. I learned that Mayanists (scholars who study the Maya history) use "Mayan" for linguistic elements (the language) but use "Maya" as an adjective for "things that are from the Maya culture"). I will bow to their superior expertise and understanding in this particular matter. 

Sunday, August 19, 2012

More Mayan Madness and Inspiration

So it's been a while since I've posted. Unfortunately in the weeks since then I've had a hard drive "almost" fail, a Time Machine restore TOTALLY fail, the hard drive FINALLY fail, and lots of restore pain. In short, it's been a hell of a few weeks. But now I'm mostly back to normal (well, the laptop is) and running again.
19 Aug 2012 in Long Count
I've been working on the Long Calendar app for the past few days. So far I've added a lot of better graphics to it so it looks better than it did before (see picture to the right). I think it's starting to look a little better. I wasn't planning on working on the glyphs until I had completed everything else, but I'm actually really close now. I have two remaining bugs. For some reason the Haab and Tzolkin calculations are incorrect. I'm guessing I messed something up when I fixed some +1/-1 problems earlier. And BCE dates aren't working correctly right now. Again - I think I managed to break them at some point during development.
One thing I'm not doing much and need to be doing a lot more is the unit test. Xcode 4.2 integrated a unit testing framework into the system, which is awesome. I need to spend some time really beating it up and understanding it a lot. With this applet I feel that it could be beneficial (it would have caught the changes that broke the calculations), but I'm also pretty far down the path. I've got a set of tests that I do whenever I make changes, so I'm not totally out of sync with current development methodologies, but still feel that with all of the agile experience I have that I'm not being "true" to the methodology by not doing it for my own projects. Especially since Apple has done the "right" thing by encouraging developers to do it. Next project I must do it.
Regardless, things are starting to come together with this. I expect that I'll be able to get this completed this week, I hope, and get it into the AppStore next weekend. Earlier would be better, but there's a lot going on right now - lots of swirl and lots of stress.
On a good note, though, I spoke with a friend from my HP days - Cooper. He works at Microsoft right now and I was in Seattle last week and rang him up. He's one of the most talented engineers I know (perhaps the most talented). He's also one of those people who is completely committed to whatever it is that he's working on at the moment. He inspired me to work on things that made me happy when we worked together. We actually started talking about starting our own company before MS offered him riches that would make Solomon blush. But it's Coop who really encouraged me to dream bigger and work harder to achieve those dreams.
I've sort of lost sight of that in the doldrums that are everyday development. It's easy to forget the why of what you're doing in the day-to-day of doing. What do I want to have? The ability to be with my family when and where we want to be. To be able to provide for them while not being beholden to a time clock at a wage-slave job. To not be a sarariman. As you probably know, I have a 9-5 at Comcast. The "job" is good - challenging to be certain, but I'm well-compensated and enjoy working with my coworkers. But it's not what I want to do in the long-term. Before I got this job I told my wife that I wanted my next job to be my last one - that I would make this Otto Von thing work come hell or high water. And what's happened in the 2.5 years since I started at Comcast? Not a whole lot. I've managed to learn a lot but at same time waste a lot of effort not focusing on the end goal.
Talking with Cooper has really re-focused my energies on that end goal. I was reminded of the possibilities we had back at HP. Of the things we talked about doing and the places we'd go. Of the games we'd write and the lives we would change. Of the paradigms we'd create with our innovation. We'd be the Nintendos of the game world. And that's gotten lost.
So, here we are in August. What will the next few months bring? I don't know, but I do know that I'm reconnecting with those "halcyon days of my youth". I'm remembering WHY I'm doing this and why I need to make this more than just a hobby. It just takes a look at my family and a chat with an old friend to bring everything back into focus with a clarity I could scarcely recall. Almost like a haze that slowly dims your vision. Over the years it just seems fuzzier than it used to be. And then you clean the haze away. Now I just need to keep the haze away.

Wednesday, June 6, 2012

More Long Count Calendar Updates

I've been making some awesome progress on the long count calendar application. I've got all of the math working (although I still need to test all of the nasty edge cases to make sure it calculates things correctly), but for anything after 1582 (when the Gregorian calendar came about) it seems to be working just fine. To test the date calculations I'm working on the ability to convert ANY date into a long count. This is a nice feature to have (what was Jan 1, 1900, for instance?) and will be useful for people looking to compare against other date calculations. The other thing I'm going to provide is the ability to put in a long count date (13.17.5.2.1) and see what date that converts to in a Gregorian calendar.
Normally, the main issue about converting from these earlier dates to later ones is that not everyone transitioned to the Gregorian calendar at the same time.Most of Catholic Europe adopted it in/around 1582. The British empire didn't adopt it until 1752 and the Soviet Union was in 1918 (right after the Bolsheviks took power and Russia became the Soviet Union). The Wikipedia article on the calendar has a nice chart showing the adoption times for different countries. So depending on where you were you had a different calendar. I'm pretty sure that the date is the 1582 and using the default NSCalendar objects will fix it for that date, I believe.
I will say that Apple seems to have done a good job with the calendar objects. NSCalendar and NSCalendarComponents are very nice little objects that really do simplify the mathematics. I have to convert to Julian dating anyway, which makes the math about as easy as it can be, but having the system provide some of the common functionality is very handy, especially being able to extract out year, month, and day without any extra divs and mods on my part. It will even provide the day of the week if you need it (which I don't in this particular application). I still need to dig into the objects a little more, especially with the pre-1582 dating - just to make sure they work as expected.
I did get the T'zolkin and Haab calculations into the application, so not only does it show the long count form (12.19.19.8.2 for today) but also the "month" and "day" (5 Sotz' 1 Ok - also for today). So everything is present in the application now from an implementation perspective - all the math works, it grabs the right images, etc. I need to get some better quality glyphs for the application, though, because the ones I have are low-res and won't look good on the iPhone let alone an iPad. That could actually be a major pain in the butt - one I'm not concerned about right now (those two stories are last on my kanban board), but I recognize that I'm going to have to spend some time either finding some good quality ones or drawing them myself (shudder!).
Overall things are looking really good. I think I might be able to make some good progress this weekend during downtime for Yeomen of the Guard. I'm off-stage quite a bit and with 3 shows in 4 days, I've got a lot of potential time to move this forward. I'm setting a goal of having the Gregorian to Long Count conversion done around Saturday night, the Long Count to Gregorian conversion around Sunday afternoon, and the reckonings done by Monday night. Which means that all I'll have left to do is get some good graphics next week and then I could, in theory, put it out on the App Store by the end of June - the first such Otto Von product to be available. All in the course of 3 weeks. Wow.
So keep your fingers crossed - I need all the luck I can get on this rapid development path!