Monday, February 23, 2009

More OpenGL

I've started coding up the OpenGL code for the animation viewer tool on the Mac. Oh brother, now I have to do stuff specifically for the Mac. I was afraid of this when I started out on this iPhone game journey.

The iPhone uses OpenGL ES on the PowerVR MBX chipset. So, the animation code I've written for the iPhone, doesn't translate, 1 to 1, over to the Mac OS. Fortunately, the NSOpenGLView, and NSOpenGLContext class help alleviate some of the setup headaches, but now I'm going to have to write some code specifically for the Mac OS.

I wish Apple would incorporate a PowerVR MBX emulator view object for the Mac OS, so that those of us writing code for the iPhone, but also have to write tools, and game editors on the Mac would be able to use the same code that is in our engines.

If anyone reading or stumbling across this blog, has been able to use the same code from OGL ES on iPhone, on the Mac OS, drop me a note, I would like to communicate with you.

Oh well, as my grandmother always said, "there's no rest for the weary." Actually, she would substitute "wicked," for "weary," when talking to me. LOL!

The Saturday train trip, deadline approaches.

"I hear that train a comin', comin' round the bend, I ain't seen sunshine, since I don't know when..."

Saturday, February 21, 2009

Oh yeah

I forgot to mention that I have the NSSpeechSynthesizer tied into the tool as well. I coded that up and have it working, although the selection to change to different type voices has a bug, and, well, I'm not going to waste time figuring that out. I don't want him wasting time playing with changing voices, and stuff.

So, when he enters the file name in wrong, he likes to add spaces to the sprite sheet files, it is going to parse the file name for spaces, and if it finds any, I have it say, "Dude, no spaces! I said, no spaces."

I know the first time it does that he's going to freak out. :)

More Hot Cocoa

As my boys plow down the slopes on their snowboards, I sit (uncomfortably) in the ski lodge, at a counter coding away on the sprite animation viewing tool, that I'm preparing for my artist to use. Using Cocoa I managed to get the OpenGL viewer, NSSlider (to allow him to step frame by frame), NSMatrix for the slider, NSTableView for the image files selection list, two NSButtons for start and stopping of the anims, and a couple of text entry fields, laid out, and the beginnings of the tool, completed.

I still have to connect some of the objects together so that the IBOutlets, and IBActions are tied together. So, I'm hoping that I will be way finished before my trip up to NYC on the train this coming Saturday.

This Cocoa, deep hands-on, learning is good (as mentioned before) because I'm learning things that I will be able to translate to the iPhone as well.

I'm tired of sitting here in this lodge and can't wait to get in the car, so we can get home!

Oh yeah, the Oscars are tomorrow...GO SLUMDOG MILLIONAIRE GO!!

"Computer-gi, movie, wallah, tell me who is the best picture?"
answer: Slumdog Millionaire
"Is that your final answer?"
answer: You're damn skippy!

Tuesday, February 17, 2009

A Taste of Cocoa

So, last night I started applying the Cocoa/Objective-C knowledge I gained early on in this journey. I am pleased to say, that Cocoa & Interface Builder are a pleasure to use. I can see why when John Carmack, first created the editor for Doom, he trekked miles through the snow to buy a Next machine. I can in seconds create the UI of my Animation Viewer tool, and tie the components together.

For anyone who doesn't know, Next machines and NextStep are the foundation of Cocoa and if you don't know John Carmack, then I guess you aren't into game development. It's like asking anyone who knows anything about religion, if they have ever heard of Christ, Muhammad, or Buddha. I'm not trying to single out anyone religion, pick any famous religious prophet you like, you get the idea...I am not trying to offend or have anyone putting a "crusade," "jihad", or whatever against me...I'm just a developer...just a developer! :)

As, I mentioned in earlier postings I'm bridging C++ and Objective-C, so the crux of my work is in C++ because I'm most familiar with it, and can go faster, but I know enough Objective-C to get myself in trouble. :)

I plan to do a bit more tinkering with Cocoa & IB, for the next 2-3 days, and then get onto coding up the Animation Viewer tool.

I haven't shown my status in a while, so here it is...

Key (red = task completed, green = in progress, black = not started)
Tasks/Status

1) Learn the iPhone Tech - always a work in progress
* Download/install iPhone SDK
* Upgrade Mac OS $130
* Join iPhone Dev $99
* Read iPhone Docs/Samples
** iPhone OS Technology Overview
** Cocoa Fundamentals Guide
** iPhone Application Programming Guide
** iPhone Human Interface Guidelines
** iPhone Development Guide

** The Objective-C 2.0 Programming Language
** Write little tests programs to learn the iPhone Capabilities (memory allocation, file I/O, iPhone audio, WiFi, graphics, etc...) - (sprite displayed by Dec. 15th)

2) Test my game concepts out on the iPhone
3) Build tool(s) if needed
4) Solidify Game Design
5) Architect the game code
6) Develop game w/ scratch art
7) Drop in real assets
8) Test/Debug
9) Ship It

In 73 days of learning/developing for the iPhone I've come a bit of a ways, but still a long, long road ahead. You know my mantra by now.

Sunday, February 15, 2009

As Always...

With just 2 weeks to have the animation viewer tool ready for use, I will have to push myself, and set small achievable milestones to get there. You can't get anywhere (fast that is) without knowing how to get there. So, these milestones, small but of course comprising of lots of work shall get me there.

The crux of the work will be getting Cocoa and Interface Builder down.

So, I will get some sleep now, since my weekend was long and had some emotional lows and highs. I will get some needed rest and begin the new quest tomorrow evening.

So, as always..."The journey, is the reward."

PS - Friday I watched the movie, "The Pixar Story." A very good, behind the scenes, movie of Pixar's beginning, and rise. I found the movie quite inspirational and it has fueled me more with the motivation to complete my game, no matter the road blocks, stumbling blocks, or jubilation's that pave the way.

Detour

I'm taking a step away from the "effects," learning/programming, that is going well. In dealing with the artist of the game, I've discovered that trying to explain things 300+ miles away (he's in NYC) is getting harder. So, I'm taking a step away from the effects programming and going to write an animation viewer tool for the Mac. So, this means I have to push ahead to something that was coming a bit later on my schedule. I have to learn Cocoa and implement the animation viewer tool, so that he can use it and see the animations (sprite sheet) he creates before sending them to me. This way he will know if they work or not before sending them to me.

So, 2 weekends from now I will travel to NYC, deliver the tool, and also the game doc along with the full list of assets needed for the game. We can discuss face to face how things should be formatted, labeled, and packaged. The animation tool writing for the Mac OS is good, because I was going to develop an editor for the game anyway, this just gives me a head start on that. Thus, the animation viewing tool will be expanded into the game editor a little later down the road, but in the meantime we will both be on the same page of what the game needs and he'll be able to sit back and crank things out. We can hash out the creative and technical stuff over that weekend and from there on out, we are both speaking the same language.

I have a game design doc and assets list already, I will put them in a more legible format. Now, where are all those napkins, and loose leaf papers...just kiddin'. :)

A train trip in 2 weeks, so I better get cranking on the tool.

All aboard!

Tuesday, February 10, 2009

Babbling On...

"I'm getting the Mac Mini, I'm getting the Mac Mini, I'm getting the Mac Mini..."

"That ditch is Steve Jobs ditch..."

Okay, my last posting I told you I was going to get my mind right, and get the Mac Mini. Well, I was told by a co-worker that the reason I could not change the permissions on the "codesign," file is because I had to login as Super User, "su." So, I packed that little Unix nugget away, went home and viola. I was able to change the permissions on the codesign file and thus replace it with the Tiku, perl script.

I compiled and built my code for the iPhone device, and it worked! I was on cloud 9. Life is a roller coaster, get used to it. My quick feelings of euphoria were soon replaced with dread, dispair, and lots and lots of frustration.

The certificate, ID provisioning on the iPhone in its current state is quite confusing. Once past the codesigning it doesn't matter if I'm on an Intel or PPC Mac. The problem is getting the provisioning IDs and xCode working properly. My problem was that I loaded the provision on to my iTouch wrong the first time (the wrong ID). The iPhone OS 2.2 I discovered has a bug that it only sees the first provision. Even though you are allowed like 100 on the iPhone/iTouch. Thus, when creating your ID you should name it, "com.yourcompanyname.*" The asterisk wild card, allows any app name to be tested on the device. I didn't do that the first time. So, now I have an ID on the phone I can't use.

The solutions were 3...the first two I wasn't going to even attempt out of not having the knowledge and the second out of fear.

Suggested solution 1 was to SSH into my iPhone, go to the directory where the provision ID was and delete it. Yeah, right...I wasn't going to waste time learning how to do that.

Suggested solution 2 was to reformat my iPhone. Yeah, right...and then find I might screw something up and render my iTouch useless.

Suggested solution 3 was to install the iPhone 2.2.1 OS on my iTouch. However, this means I would also have to upgrade to iPhone SDK 2.2.1. Which my fears were that Apple would have come up with a block for us PPC developers. Well, they did. The key iPhone packages wouldn't install and the previous hacks to get around that no longer worked. Fortunately, the 2.2 SDK and simulator still work...whew! So, I can still develop with my PPC.

So...

"That ditch is Boss Job's ditch. And I told him that dirt in it's your dirt. What's your dirt doin' in his ditch"

"I don't know, Boss."

"You better get in there and get it out, boy."

So, my mind is RIGHT now! I promise boss, I'm shakin' it! :)

I will get the Mac Mini, and go straight. So, all told, that was 5 days wasted trying to hack this thing. I just want to write code!

Thursday, February 5, 2009

Biting The Bullet

Arrrgghhh!!

I'm going to bite the bullet. I'm going to go on an purchase a Mac Mini. I'm tired of looking at the messed up colors of the PPC iPhone Simulator, and now trying to hack the "codesign," file. I've wasted 2.5 hours with this back door approach. First, I don't know Perl, so I have no idea what the script by someone, that goes by the name of, Tiku, provided on a forum last year. Second, I can't modify the "codesign," file anyway. The permissions locked me out. I've tried "chmod" -ing the permissions, but no go. Also, my Unix knowledge evaporated 20 years ago. So, if there is a way to change the permissions, so that I can modify the "codesign," file I wouldn't know.

I avoided upgrading to the latest iPhone SDK in fear that it would shut down my ability to develop on the PPC. Sheesh...it is a shame, outrage, mockery, and just plain, greedy on Apples part, to make you have to develop on an Intel Mac, when it is obvious that you don't have to.

Oh well, really Rod, what the hell are you gripping about, do you know what the development cost is if you were to try to develop on a PSP? So, shut your trap and get the damn Mac Mini.

The time has come to just pony up the bucks (Steve Job's you win) and get the Mac Mini so that I can code in comfort, and yes, have that warm and fuzzy, "I'm no longer a sinner," feeling. "Come brother, come into the light." (Congregation chimes in, "Praise the Lord.") :)

Now, I just hope there will not be any problem getting my codesign certificate, and keys onto the Mac Mini...now their shouldn't be since it is a provisional license, and the iTouch has a unique ID. We'll see, stay tuned...

Wednesday, February 4, 2009

I'm Official

I'm now officially, a registered iPhone developer. I activated my code. I will fool with the registering of my iTouch, and code signing tomorrow to see if I can run my code on the iTouch. The reason I say, *if* is because (see way early postings) I'm actually developing on a GS Mac, not the sanctioned Intel based Macs.

I've got some forum notes from some sites that describe how to code sign to get the GS Macs to work, but some folks claimed success and others did not. Anyway, I will tackle that tomorrow, and will see.

So, I will spend another hour or two, working on the effects I wish to use in the game, which will incorporate some decal texturing, blending, procedural textures, particles, and some dynamic fluids. I suspect I'll be working on these for a few weeks.

Working real job in the day, regular obligations, and then working on the game late into the night, and early mornings means something gets sacrificed, and that something is my body. My regular gym workouts have crashed to the side. Now, I just have to make sure I watch what I eat so that I don't become fat (or the politically correct saying, "weight challenged,"...call it what you want people you're still BIG).

Till next time...

A Winner

Gyuri will get the first "free," copy of my completed game...okay, I really have to finish this thing. Hopefully, Gyuri you will be able to play before Christmas. :) The reference was to Allen Iverson's "Practice rant."

Also, another thanks to Gyuri for letting me know about the iPhone Meetup group in our area. I don't do Twitter, MySpace, or FaceBook because, well, ahhh...I would rather be working to complete my game, than talking constantly about completing my game, this blog is bad enough. However, I blog about it, to make sure I complete it. Weird logic I know. However, the group meet up is good, because I can meet like minds, and share some coding gems.

By joining the meet up I also bumped into a former developer at a previous game company we worked at together. The former game company had so many war stories that everyone of us that survived that place when ever we bump into each other the first words, we usually utter, are "Oh my God! That place!" We all have a bond, forged in stone, for life. I could write 3 volumes on "that place." I'll just say this about it, and you will get the idea, "do you want to find your a$$ on the un-employment line!?"
Tahhhhhahhhhhaaaa! "Welcome to our quaint little company." :)

Less Than An Hour

Wow! Stealing another companies pitch phrase, "That was easy!" I just received my iPhone certificate, activation code. The elapsed time, 52 minutes.

This evening, the next challenge will be using the activation code, and running my code on my iTouch.

As Slick Rick "The Ruler," said, (okay...preface, going back to old school hip-hop), "wish me luck, 'cause I'm scared and I'm nervous." :)

On a side note, I read where if you do develop a paid app for the iPhone, and you make money, you are responsible for declaring you earnings with the IRS. Apple is not sending developers 1099 forms, even though you have to fill out tax info, and give your SSN when you place your paid app on the iStore.

Thus, you are responsible for keeping track of your earnings, and filing with the IRS.

"Taxes, we talkin' 'bout taxes, not a game, but taxes!" (said in another venue, in another vein, if you know the answer, the first responder will get a free copy of my game, when it is finished).

Signed Up

I just purchased my "Individual Developer," iPhone Certificate. I will detail the process here as I go. The date and time is, Wednesday, February 4th, 2009, 12:06pm. I will see how long it takes to get the certificate, and blog my progress of getting my iTouch signed to see my code run on it.

I am working on the "effects," of my game (not now, I'm at my real job...lunch break), that's where I currently am in my development.

Anyway, we'll see how the certificate signing goes.

Stay tuned...

Monday, February 2, 2009

Ground Hog Day

I peered out of my hole, saw my shadow, and have crawled back in...this means a few more months of work still needed before my dream is a reality.

I have completed the animation work. I am using texture, sprite sheet, pages...multiple textures, embedded in one large texture. Instead of loading and having to bind multiple textures for animations, I load one large texture, and calculate the texture coordinates based on the animation frame count, and use the texture matrix to shift to the image I desire in the texture. This saves on the load time, and also on the binding of textures when I go to render.

I will now began coding up the graphic effects I would like to have in the game. I will be researching "procedural," textures. For those who do not know what "procedural," textures are, they are textures generated from mathematical calculations. So, instead of using a canned image, I will generate the image via math.

So, that's the update. Until next time, I'm back in my hole, working away.