Galcon Games
Phil Hassey - game dev blog
Phil Hassey as Syndrome
"Look, stores don't sell
costumes like this to just anyone."

Transitioning to Xcode 4.0.x

April 26th, 2011

I’m working on a new game project that I’m hoping to release sometime in the next month or so! I’m taking a break from Dynamite to do something a bit more wacky :) For these posts I’m going to be referring to my project as “mygame” since I’m not ready to announce the name of this super-amazing project yet.

Anyway, I downloaded Xcode 4.0.2 the other day so I could get going with the latest iOS tools. I’m going to be using more iOS features in this game than ever before, so I want to be sure I’m up to date with how things are supposed to be done. Xcode, however, has quite a few changes, so here’s the documentation of some of the common things I do as an Xcode user that changed.

1. Adding CFLAGS to my project “-DMYGAME_IOS_BUILD, etc”

- Click on “mygame” at the top left of the project tree hierarchy.
- Click on the “Build Settings” tab in the main frame.
- Click on the “All” button to reveal all settings.

From there you can find the “Other C Flags” setting. Apparently Xcode 4 has “Schemes” (the name of your project) as well as “Builds” (Debug / Release) as well as “Destinations” (iPhone / iPad / Simulator).

2. Adding more Frameworks to the project

I always have a handful of frameworks I need to add. In Xcode 3, you could right-click and click on “Add Existing Frameworks” to pick from a list. This is no longer the case. But doing the same is pretty easy:

- Expand the “Frameworks” from the project tree.
- Right-click on one of the frameworks.
- Select “Show in Finder”
- Finder will open, and will show the folder where all the frameworks are.
- Drag and drop a framework from Finder to the Frameworks in your project

3. Working with the new OpenGLES iOS template

Every few releases of Xcode, Apple changes up the OpenGLES template. I do wonder if I should just copy over it with my own stuff? Maybe, but I figure Apple knows best or whatever, and I always adapt to the latest template for new projects. This one has me a bit more confused than usual since it seems to use more Interface Builder type stuff and has a mygameViewController object in it as well (and corresponding .m and .h files.)

- At this point I knew since I was going to be using GameCenter and IAP in this game I might as well learn a bit more ObjectiveC. I’ve thus far managed to NOT learn it in the 3 years of iOS coding I’ve been doing. So, to kick things off I figured I’d check out what the iOS development videos might have for me. Unfortunately, the newest videos are from Apple’s 2009 tour. Kind of sad, I mean, 2009 was back before iPads even existed. So those videos are certainly not going to help me deal with the new fancy in Xcode 4 and building Universal apps.

- Instead I found that the typed documentation was much more helpful. I clicked into “Tools for iOS Development” to see what they’d have to say about Xcode 4.

- From perusing a few documents I got the feeling that to use GameCenter, etc, I was going to need a ViewController. Since the new OpenGLES template includes one, I guess that is good. If there are any iOS devs reading this who want to point me towards some helpful tutorials so I can understand what I’m doing better, that would be great. As-is, I am sort of continuing in my usual blind-cut-and-paste-and-hope type stupor with this stuff.

- I hacked out all the GLES2 code, I still write all my code using GLES1 .. the advantage that gives me is that my code will work simply on pretty much any platform. And I finally after 3 years understand GLES1 pretty well. I suppose I might get into ES2 eventually, but not yet :) I also like that GLES1 code can work on the desktop with almost no changes. I hear shaders can add complication to my life on the desktop. Again, if anyone wants to link me to useful commentary on that, I wouldn’t mind!

4. Hacking my game onto the iOS app

I always code my games in C/C++. What I’ve found is the easiest way to get it to work with iOS is to rename all the .m files to .mm so that they are C++ aware ObjectiveC. Then I have a set of wrapper functions for my game that the ObjectiveC code can call.

Okay, so this is really cool, Xcode 4 now detects if you type in an invalid function name, and suggests a replacement function name :) And it worked!

5. Making the game Universal

Xcode 4 seems to make this pretty easy. I just went into the Summary tab and switched mygame over to Universal and it all seemed to work pretty well. I only had to add these lines to the top of my drawFrame method in my ViewController:

CGRect screenFrame = [[UIScreen mainScreen] applicationFrame];
game_resize(screenFrame.size.width,screenFrame.size.height);

Here’s the blog post that helped me with that.

6. Making the game Retina enabled

I just used this code snippet at the end of my EAGLView initWithCoder (I believe I got it from the Fargoal folks):

      float scale = 1;

      if([[UIScreen mainScreen] respondsToSelector:
              NSSelectorFromString(@"scale")])
      {
              if([self respondsToSelector:
                      NSSelectorFromString(@"contentScaleFactor")])
              {
                      scale = [[UIScreen mainScreen] scale];
                      self.contentScaleFactor = scale;
              }
      }

Towards the end of the day I spent some time mucking with orientation stuff. That always confuses me! And that’s all for today!

-Phil

P.S. Changing where the builds are made:

By default the builds are put in ~/Library/Developer/Xcode/DerivedData .. they used to be placed within my project which is what I prefer. This can be changed by going into Xcode > Preferences > Locations > Build Location > Place build products in locations specified by targets

Galcon Android bugfix update & sale

March 31st, 2011

So I’ve been working on an Android tuneup for Galcon over the past couple days. Here’s what’s been going on:

- Some users were having the game hang on them when the phone went to sleep. There were two issues here, one was a deadlock situation because I had onPause “synchronized” and I wasn’t using the wakelock to keep the device from falling asleep. I fixed the deadlock and I added the wakelock feature so that the device does not fall asleep while you are waiting for a round to end or whatever. To sleep your device you have to press the sleep button now.

- In Android 2.3.3 the ability to scroll up and down the server list was somehow broken. It seems that the ability to track motion was somehow changed in the new version. Also, my code in the previous version didn’t handle things well anyways. So I’m just tracking motion manually and that seems to have fixed the issues in the game.

- I’ve also tested Galcon on the Xoom and it works pretty well!

I hope you enjoy the update! Please tell me if there are any odd side-effect issues that result from the fixes I’ve put in.

… And to celebrate, Galcon for Android is on sale for $0.99! So now would be a good time to spread the word about Galcon on the Android!

-Phil

P.S. A special thanks to Google for giving me a Xoom tablet at GDC! It’s great having the whole gamut of Android devices to test on now :) The devices I have are the G1, Droid, Nexus One, and Xoom.

Robot Wants Kitty for iPhone (and other news!)

March 29th, 2011

Hey, so a friend of mine made this awesome flash game called Robot Wants Kitty .. and then that game got ported to the iPhone / iPod touch. And the port is even BETTER than the original!

I’m going to say right here right now that you should buy this iPhone game immediately! It’s $0.99, so it won’t break the bank. It’s a killer fun side-scroller which has gotten all 5-star reviews (except from people who have iOS 3.x on their device). If you want a second opinion, touchArcade really liked it too. So, yeah, support the awesome independent developer, hamumu.com (who I might mention appears in the credits of every single Galcon game as “Mike Hommel.”)

Anyway, again, you can get it HERE.

Cheers!
-Phil

P.S. There’s a Galcon Fusion tournament on April 1st!
P.S.S. If you like Galcon Flash, you might want to keep an eye on this blog.

Galcon Fusion comes to Mac App Store and Mega-Sale!!

March 16th, 2011

Hey,

Galcon Fusion is available now on the Mac App Store at the amazing launch price of 99c – that’s 90% off the regular desktop price!

I’m also doing a Mega-Sale across many of the other versions of Galcon! Be part of the “Galcon Community Rejuvenation Project” and help get the word out about this Mega-Sale:

Galcon Fusion for the Mac – 99c – Regularly $9.99

Galcon Fusion for the iPad – 99c – Regularly $4.99

Galcon for the iPhone – 99c – Regularly $2.99

Galcon Labs for the iPhone – 99c – Regularly $2.99

Galcon for Android – 99c – Regularly $2.99

Have fun playing!
-Phil

Porting Galcon Fusion to the Mac App Store

February 11th, 2011

So, I’m whipping through the Mac App Store port of Galcon Fusion today. Most of the documentation on the Apple site is pretty clear, but I’ll document the few stumbles I had in case it helps anyone else. Thankfully a few web searches found the answers to most of my questions pretty quickly.

1. The Certificate file selected is invalid

While using the App Store Developer Certificate Utility I got this error message “The Certificate file selected is invalid” .. The problem was I was using Chrome. By switching back to Safari to finish the web-wizard, I got past this error in a few moments. Original article.

2. Unable to copy dSYM file into archive

While attempting to Build and Archive my app I got the error “Unable to copy dSYM file into archive.” with the suggestion that I “Please make sure that your application has set the “Debug Information Format” build setting to “DWARF with dSYM File”.” I also confirmed that “Generate Debug Symbols” was checked.

I had already made this change, and I double checked it via Project > Edit Project Settings > Build > .. However, this didn’t seem to fix it, so I did a search and found this article. I found it to be somewhat cryptic, but I went and tried Project > Edit Active Target > instead. I found the “Generate Debug Symbols” was unchecked from this view. If anyone knows the difference I’d appreciate understanding what I was doing right / wrong here. Anyway it now “Build and Archive” without any trouble.

3. The use of non-public APIs is not permissible, as documented in section 2.5 of the App Store Review Guidelines.

“Using private APIs can lead to a poor user experience should these APIs change in the future. The non-public API (CPSEnableForegroundOperation, CPSGetCurrentProcess, CPSSetFrontProcess) that is included in your application comes from the following private Apple frameworks – ApplicationServices.framework.”

Okay, this hasn’t actually happened to me, it happened to Mike Kasprzak. He found that SDL had an #ifdef in its SDLMain.m which enabled some undocumented APIs being used. By commenting out “#define SDL_USE_CPS” he was able to resubmit and avoid the rejection notice. Mike also mentioned that SDL 1.3 doesn’t have this issue, but it’s still in beta and somewhat incomplete.

4. After trying to manually install my app, it didn’t appear in /Applications

After using the Organizer to Share > Save As .. > my app, I used the command line “install” command to try and install it. My app didn’t appear in /Applications. It didn’t seem to go anywhere sensible. I found that to force it to go to /Applications you just have to manually delete all the other places it tries to install it, and eventually when it can’t find your app anywhere to overwrite it, it’ll install into /Applications properly.

5. Adding support for CMD-Q and CMD-F

One thing I had to do was add support for standard Apple command keys. I guess it’s about time! Mike tipped me off that Apple checks for those and I’d best have them properly supported in my app.

6. Adding receipt validation

I implemented some receipt validation, but upon trying running my application I got this error:

“This is not a Test User account. / Please create a new account in the Sandbox environment. [Environment: Sandbox]”

I found this tip on a website: “(You can) create a test user in iTune connect by logging on iTune Connect –> Select Manage Users –> Test User –> Add New User –> Fill in the required data for your test user. We will be using this test users to see if our receipt validation code is working properly.”

Apple strongly encourages obfuscating your code for the receipt validation. I’m no expert on this, but I heard that using blocks helps. This article showed me the blocks syntax, which I found pretty easy to pick up. (Blocks are a sort of lambda for C code.)

7. Submitting the app

When submitting I got a variety of incoherent error messages. Bottom line is you can’t have spaces in your package name. Basically in Organizer you have to save to disk with a name with _’s instead of spaces then upload using the application loader. Here’s the thread that explains it.

Galcon newsletter and SF meetup info

February 4th, 2011

Hey,

Thanks for all the responses to my survey a few weeks ago! That is going to be a huge help in figuring out what I’m going to be doing this year.

The Galcon update I put out a few weeks ago with retina and multitasking support could use some reviews on the App Store :) It’d be swell if you could write something up:

Galcon | Galcon Labs | Galcon Fusion

Also, I’m going to GDC in San Francisco from Feb 28-March 4. If anyone is interested, it would be fun to get together for a Galcon meetup. I’ve put together a little survey to get a feel for who wants in on the fun!

The Galcon in SF Meetup survey

Thanks!
-Phil

Paid game betas aren’t for everyone

January 7th, 2011

So, I just sent out my “hey everyone, come get a refund” email to all the people who purchased the Stealth Target beta. There are a number of pretty high-profile indie games that have built an entire business upon being a paid beta. Minecraft, Wolfire’s Overgrowth, Data Realm’s Cortex Command are a few that come to mind.

Here’s some analysis on the subject, and why it didn’t work for Stealth Target .. and at the same time, the factors I think that would be important to having a successful paid-beta project.

  • Commitment to a larger vision. In the case of Stealth Target, I had a larger vision, but I eventually realized it was too grand for me to realize.  I’m more of a small-scale game kind of guy at this point.  Perhaps later in my game development career I’ll be doing larger projects, but right now, a “Galcon-sized” game is about as large as I can manage.  I think paid-beta games need to be larger to justify the whole “user-buy in to help fund an epic game” concept.
  • Commitment to regular updates. I’m only one dev, and when I take a month to work on Galcon updates, and then take another month to take a break, suddenly the beta users haven’t heard a peep from me about the game in 3 months.  Pretty weak “paid beta”.  If I had a team and I had someone always working on the beta so it kept living despite my other obligations / plans, it might have gone better.
  • Building a development team. Yeah, I just touched on that, but it really does make sense.  I could have a team, but my lifestyle doesn’t allow for it at the moment.  My hours are too random and my work schedule too unpredictable.  To have a team you have to have some consistency in your life, otherwise (I’m pretty sure) your team-members will get pretty tired of you.  I think having a team would help deliver the quantity and quality of content and updates to make a paid beta make sense.
  • You can’t change your mind and be crazy. I still plan on finishing Stealth Target, however, I’m no longer planning on doing a desktop release of the game.  The paid beta was for a desktop version of the game.  So changing to a iOS-only plan really isn’t possible.  The only way to cleanly resolve this was to terminate the entire beta and issue refunds.  Really, for a paid-beta to make sense, the users have to have something they can depend on, and changing platforms mid-stream is just asking too much.

Anyway, to wrap it all up, here’s the email I sent out to folks who already bought the game today:

Hi,

Turns out the business model of doing a pre-beta-sale really doesn’t make sense for me.  I’m more of a “do what I feel like” kind of guy, and committing to making some sort of super-great-game in some kind of pre-beta-sale promise just isn’t something I can really do.  I think in the case of “Stealth Target” I bit off way more than I can chew.

I’m hoping to finish Stealth Target this year, but I’m probably only going to release it to mobile platforms, so I don’t even think I’m going to be launching a desktop version.

Either way .. I’m offering refunds to anyone who wants one!  Just reply to this email and say so.

Thanks for coping with a crazy indie-dev :)  Your support is greatly appreciated and I hope I can churn out some cool games that you’ll enjoy in 2011!

Cheers!
-Phil

P.S. Also, thanks for all the feedback you have given me so far on Stealth Target.  I’ve been taking notes on just about everything! You’ve been a huge help!

And, who knows what the future will hold for Stealth Target.  If the mobile version comes out feeling really good, I might try and release it for the desktop.  But the important thing for me is to know that I’m not obligated to produce a “desktop-sized” title when I’m really making a “mobile-sized” game.  I’ve got a lot of things I want to do this year, and I want to do them in the order that I want them to.  A paid-beta project would have “cramped my style” so to speak, and I don’t want to subject my users to a shoddy paid-beta experience.

Thanks!
-Phil

The Galcon Survey

January 4th, 2011

Take the Galcon Survey, it should only take about 3 minutes and you’ll be helping me decide what will be best for Galcon in 2011!

Thanks!
-Phil

P.S. I added a few questions since last night, so if you already filled it out, you may want to edit your response.

2010: Phil’s picks

January 3rd, 2011

I’m a pretty avid toucharcade reader, and I got inspired by the staff picks posts to do one of my own. In the past decade I haven’t been much of a gamer, but I think in this past year I’ve really begun to game much more consistently. I think the introduction of the iPad was the biggest influence in that. The iPad is a gaming device that really works for me. For whatever it’s worth, I often game on my iPad using a pogo sketch stylus, which gives much better precision than a finger and makes it so my finger doesn’t obscure the action.

As for gaming, I’m a pretty tough customer and not many games truly strike my fancy. Personally I’ve always had a draw to side-scroller games and point-and-click adventure games, so you can see my bias towards those in my selection. I’m a rather casual gamer, so the games I like tend to work well as short-players. The gameplay does not require me to dedicated my life to mastering the game or enjoying it. That said, here are the few games that I really latched onto and played to death this year (in no particular order):

Babylon Twins

This is a side-scroller game and the best one I’ve played on the iPhone. The mechanic of having the two dependent characters really add that “difference” to make the game unique. I played this game on my iPod touch.

Robot Wants Kitty

This was a great series of flash games written by my friend Mike Hommel. These are mini Metroidvania games starring a robot who is seeking out various items (a kitty, a puppy, a gold fish, and finally some ice cream.) I had so much fun playing these games I dressed up as the character for Halloween this year.

Scarlett and the Spark of Life: Scarlett Adventures Episode 1

This is an adventure game and the writing in this game is hilarious. I’d say if you enjoyed Monkey Island you would enjoy this game. This is only the first chapter of the game, but I’m very eager to see the next. The game combines a very fun mix of characters and nonsense to build a very fun experience. I played this game on the iPad using a stylus.

Helsing’s Fire

This is a great game. The user interface was very touch oriented, which I always appreciated. The reverse-stealth mechanic really appealed to me since I’m working on a stealth game right now. And the main characters camaraderie was depicted in such a “mobile friendly” fashion that I just really enjoyed the whole game! I played it on my iPad using a stylus.

UFO on Tape

This game simulates a person in a car video taping a UFO sighting. It is a perfect simulation of the experience. I’m a huge X-Files fan, so getting to live out the attempt at videotaping a real UFO sighting from a car was a ton of fun. I played this game on my iPod touch.

There have been a TON of other really great games that came out this year. And in fact there were a few others that I invested some serious time into that I haven’t listed here. I wanted to keep my list to 5 apps, so I had to make some cuts! And if I were some kind of review site that was obligated to highlight all the best of the best, well, I’d have more to say. But really – those games are the ones I latched onto, and maybe you’ll like some of them too :)

-Phil

Galcon: now with retina display, multi-tasking, and bug fixes.

December 15th, 2010

I’ve updated Galcon, Galcon Labs, and Galcon Lite for the iPhone / iPod touch with retina display support and multi-tasking support. I’ve also updated Galcon Fusion on the iPad with multitasking support. Now you can play more than one game of Galcon at a time! I’ve also updated the desktop version of Galcon Fusion with a number of bug fixes. For those of you who don’t know the difference between non-retina and retina displays, this image will help you understand:

retina

Enjoy the update!
-Phil

P.S. Okay, that “before” image is a bit of an exaggeration, but you get the idea :-)


Galcon   Watermelons   Dynamite   The Hairy Chestival
All content of imitation pickles (c) 1999-2008 - Phil Hassey  "we care"