Tuesday, October 25, 2011

Mad Pig Klondike version 1.1 in development. Update 2

Finished working on the next release of Mad Pig Klondike Solitaire.
Added Facebook posting and implemented analytics for the new features.

--- Version 1.1 - Testing Pre-release.

  • Post App Store link, info and player comments to Facebook. You can now tell your friends about Mad Pig Klondike.
  • Post Screenshot of results page to Facebook. You can now post your awesome scores.
  • Bottom corner buttons for Options and New Game only work when touch starts on them. Drag release over them will no longer envoke the buttons.
  • Separated touch areas for New Game and Yes dialog so a quick double tap will not start a new game.
  • Added Game mode to Results Screen. Now your screen shots will show the game type! 

I implemented two buttons for posting to Facebook. One on the menu to post user comment, with App Store link to Mad Pig Klondike Solitaire. The second button is on the end game score results page for posting a screen shot of the results to Facebook. 

I had to implement each type of post differently. 

Facebook Post from the menu:
When the button is touched, it calls a method that first checks for internet reachability. I've used Apple's reachability code here. Any app that doesn't have some testing of internet connection and handling of issues will be rejected by Apple. So any time Klondike tries to connect to the internet, the app checks first. 

If Klondike can reach the internet, it then checks to see if there is a previously saved Facebook session. Klondike saves a session after a successful log in to Facebook. The saving of the session allows SSO (single sign on). I'm using the newer Facebook SDK. With the old one, the user would have to log in each time they post. Not very user friendly. If there is a saved session, Klondike calls a method to post a dialog to Facebook. The dialog will post an icon, app link, description, and any text the user wants to add.

The tricky part is if there isn't a saved session. If there isn't, Klondike sends the user to log in to Facebook and requests permissions to post to the feed. Then the Facebook app returns to Klondike. Originally, I had the post method being called right after the authorization. This caused problems because the post would get called before Facebook was done. The post would fail and sometimes it would cause odd things to happen.  To get around this, I set a flag that a dialog type post needs to be posted. Then when Facebook is done with the login, Facebook calls it's delegate method for didLogin. In didLogin, I check the flag for dialog post and if it's YES, I call the post method. This solved the failed posts and odd behaviors. 

I had to do a similar thing for the other Facebook button. For posting a screen shot, I bring up an Alert dialog to ask the user if they want to post a screen shot to Facebook. This teaches the user what the button does and let's them back out of it if they want. The alert is using a delegate to handle the user selecting YES. If the user selects YES, the corresponding delegate method gets fired off. This method is in my AppDelegate. I couldn't get it to work in my Facebook class.  The method sets a flag for posting a screen shot to YES and calls a method to check reachability and then if the session is valid. Also, the Facebook button on the screen is disabled do the user can't post duplicate images. If the session is valid, it will post an image to the user's feed using a Post request. If the session is not valid, it will send the user to login and asks for permissions to post to the feed. Once again, it will return and call the didLogin method. 

In the didLogin method, I check to see if the post screen shot  flag is YES. If it is, I then call the method that does a screenshot and posts it to Facebook. I call this method with a .2 second delay because if I call it immediately, the screenshot is really messed up. It's a double image, cropped. I'm guessing it didn't have time to draw properly before the method was called. Adding the small delay fixed it. 

For the first time a user posts to Facebook from the menu page, it fails on the first post after the user gives the app permissions. I can't figure out why it fails or how to truly fix it. Instead I try to post on the error/fail and this works. It's a really odd behavior, but only happens the first time. 

Originally, I was able to get the posting of both types to work nicely once a user is logged in and thought everything was working great. Then I tested having the user not logged in and then I tested removing the app from Facebook and basically having the initial experience of the user. The initial experience was rough and had issues. Even though it would only rarely affect the user, we want our user experience to be smooth. Therefore, I had to jump through all the above mentioned coding hoops to get this stuff to work nicely. 

The good news, I'm learning about delegates. The bad, is it took much more time that I had wanted it to and I'm kinda hacking the solution.

Looking to the future, it looks like I might have an easier time when I implement Twitter, due to Apple including a nice library in iOS 5. Hopefully it will be. 

Mad Pig Klondike versino 1.1 in development. Update 1

Working on the next release of Mad Pig Klondike Solitaire.

--- Version 1.1 - In Development

  • Post App Store link, info and player comments to Facebook. You can now tell your firends about Mad Pig Klondike.
  • Post Screenshot of results page to Facebook. You can now post your awesome scores.
  • Bottom corner buttons for Options and New Game only work when touch starts on them. Drag release over them will no longer envoke the buttons.
  • Separated touch areas for New Game and Yes dialog so a quick double tap will not start a new game.
  • Added Game mode to Results Screen. Now your screen shots will show the game type! 
Feel like I have a little better understanding of delegates. Implemented UIAlerts to ask the user before posting an image to Facebook. Also added post completion and error alerts. Locked out the Facebook button after the screen shot is posted so the user can't post duplicate images.

For screen shots, if it needs to check the login or login, Klondike will send the screen shot again after getting a valid login response from Facebook. Previously, if a login was required, it would drop the post and the user would need to click the button again. 

I still need to implement this re-sending capability when sending a standard post from the menu screen when a login check or login is required. 


Sunday, October 23, 2011

Mad Pig Klondike version 1.1 in development.

Working on the next release of Mad Pig Klondike Solitaire.

--- Version 1.1 - In Development

  • Post App Store link, info and player comments to Facebook. You can now tell your firends about Mad Pig Klondike.
  • Post Screenshot of results page to Facebook. You can now post your awesome scores.
  • Bottom corner buttons for Options and New Game only work when touch starts on them. Drag release over them will no longer envoke the buttons.
  • Separated touch areas for New Game and Yes dialog so a quick double tap will not start a new game.
Implemented Facebook posting and tweaked some interface items. We'll start testing now. 

The Facebook stuff was pretty challenging. At first I used ShareKit. ShareKit can share with several services. It was pretty easy to implement, but didn't post exactly how I want. The posts with a link couldn't have an image with them. It uses the old Facebook sdk. I decided to try out the newer Facebook sdk. This required me writing a bunch more code, pretty much implementing everything myself. The Facebook  sample app was helpful, but much too complicated. 

I've learned a lot about delegates, but I still feel I don't have a full handle of them. I had trouble getting the delegate methods to be called after the Facebook posts. I was eventually able to get them working. The Facebook stuff isn't perfect yet, but it's working. It seems to have some rough edges during the log in process. Sometimes requiring an extra click on the button. When I'm able to understand more about it, I'll likely want to rewrite the code. 

I wasn't able to get a UIAlertViewDelegate working in a class I made. I've got a workaround for now, but I'll need to figure out how to implement it properly at some point. I'm sure I could get it working in a new project. I'm having trouble getting it to work with the structure of the current project. 


Wednesday, October 19, 2011

Mad Pig Klondike is live!!!

It's been a long time coming, but the day has finally arrived!  Our first game, Mad Pig Klondike Solitaire, is available on the App store for the iPhone/iPod (works on the iPad, too).  Go check out Mad Pig Klondike!

Our trailer video is also up on Youtube.

Make sure to tell your friends, family, co-workers, and enemies! (they want to play Solitaire, too)   And "like us" on Facebook to keep up-to-date with us as we add new features, as well as info about upcoming games.


Wednesday, October 5, 2011

Goodbye Steve

Thanks for making our lives better.

We will miss you.


Saturday, October 1, 2011

History, Part 3 - Early tests. Finding our way.

Here I'm going to include some ugly things. Early tests and concept drawings.

Here is the first card test. I scanned a real card and made a vector based version of it using Illustrator. Love the card back, but we can't use it in the game because of copyright.
Perhaps someday we'll try to get permission from Kem. By the way, Kem makes the best plastic playing cards. They last a very long time and are flexible. Buy them!

Here are some early table felt tests. They were painted in Photoshop. I quickly realized I didn't have the skill to paint something I'd be happy with so I ended up rendering the table top in 3d to get the final look for our table.

We ended up with something like this

Our final look has shading that goes over the table and the cards. Some people may not notice while playing, but wow, does it look worse when we turn it off. 

Perhaps the pig can hold the table? We are trying to find our design...

Here we were trying to find the look for the table. Perhaps having the pig hold the deck. In the end, it just takes up space, gets in the way and throws the balance off.

Now we've included the first card back design.

You can check out our final results in History, Part 2

Here are some of the awards drawings:


History, Part 2

To continue from History, Part 1.

Originally we developed Mad Pig Klondike for Facebook. The Facebook version is much further along than the first version we'll be releasing on the iPhone. There were awards and card backs that are unlocked with achievements. We'll get those into the iPhone version in time, but we decided to ship the game as soon as it was playable and then keep adding more features. We've even got some really cool ideas we are keeping for a surprise.

Mad Pig Klondike pretty much sat on the shelf for a year when we were waiting for the server-side, backend stuff to be written. At that point, we decided to ship on the iPhone, as I was interested in learning how to code for iOS. I wasn't  (and am not) too interested in server backend programming. If you know a super-genius client/server, Facebook programmer that has some free time, let us know! We are still going to release on Facebook eventually, but for now, we are focusing on iOS.

The Facebook version was done completely in Flash. One thing I've noticed is, I can get much smoother animation on the iPhone. We also changed the interface and design some as we reformatted for the iPhone.

Here are examples of some of the differences in the design and art...

Facebook version:

iPhone Version:

With the iPhone version, we wanted to simplify the interface on the game board. There are only two buttons and they can be hidden. Well, actually there are three... you can tap the score area to zoom in and out a bit.

Mad Pig Klondike is programmed in Objective C and uses the incredible Cocos2d for iPhone framework. Cocos2d is free, actively developed and awesome! When I was researching and deciding whether to use one of many frameworks, or to build my own, I found Cocos2d to be very similar to Flash's AS3. Another big plus is it's all written in Objective C, so I would be using the same language as if I were programming from scratch.  Cocos 2d also has an excellent support community with forums and Riq, the developer of Cocos2d for iPhone, is very active on the forums. I have to say, the framework really is nice and saved me a lot of time.

Some other cool products I'm using that are worth a mention, and a purchase, are...

Texture Packer - sprite sheet creation tool.
Glyph Designer - a bitmap font creation tool.
Particle Designer - a particle system editor.

These tools help immensely and are reasonably priced.

It's been slow going, but we are finally getting close to launch. Our day-jobs are very demanding, we've had some false starts and a bit of a learning curve. Many times, the day jobs become day and night jobs, so free time for working on the game can be hard to come by. There is also family, a dog, a girlfriend, friends and other real life stuff getting squeezed in there. We have a lot of ideas for Klondike, and even more for other games. We hope you bear with us and enjoy the fruits of our hard work. We also love to hear feedback, so contact on www.madpiggames.com if you like.

One more thing...

We've had beta testers for awhile now and the good news is, we don't seem to have to keep asking them to play the game! I'm thinking that's a good sign.

Next history post, I'll bring out some early concepts, tests and drawings.


So close we can taste it!

Two days ago we received our papers back from the State of California. It only took 52 days!

Yesterday we opened up the Mad Pig Games bank account and also started the sign up process with Apple.

We are getting closer to launch. We've got analytics all setup. The game is ready for launch. We just have to finish setup with Apple, finish the web site, and create marketing materials. So close, but still so much to do.

Oh, and I need to write the second part of our history.

Woo Hoo! Here we go!


Wednesday, August 10, 2011

Wrong Green. New Icon.

Some friends mentioned the iPhone icon for our upcoming game would be better if the letters popped out more. They suggested darkening the background. Here is the before and after...

The new one really isn't the correct green, but on the phone, it actually does make the text pop out better.

Tuesday, August 9, 2011

History, Part 1

I thought I'd post some history....

Early 2008 or late 2007, B and I decided we wanted to make games. I started teaching myself Flash and AS3 (Action Script 3, an object-oriented programming language). I'm not really a programmer (I'm an animator), but I was learning programming. It was pretty hard at first, but I really got to like AS3. I also really grew a hatred of Flash, but it was pretty much the only game in town for making small web games. Flash is such a clunky and buggy piece of software.

I decided to pick something that I would enjoy learning and might be easier to do. I started with an old school 2d shooter-style game.


Here are a few different versions and experiments I tried out..
(click once on the flash area and use the arrow keys to move around and the spacebar to fire)

Furthest along:

I experimented with different blur effects. The CPU overhead is high on these:

Here are a couple of star tests:

All the motion in Glactin was done in code.
I learned a lot working on Glactin. I learned how to move objects in angles. It's easy to move things straight up, down, right or left, but you have to use math to move them at an angle. I also learned how to draw everything in an off-screen buffer and show the image after drawing. This improves quality and performance.

Once I'd learned enough programming to feel like I could tackle something more complex, B and I decided to work on a game with more appeal than a 2d shooter. Perhaps someday, I'll go back and make a 2d shooter. I do like them and we've got lots of ideas on how to make a fun one.

We decided to work on a Tower Defense-style game.

Here you can see the work we did on Robot Attack! Advanced Tower Defense.


This is a programmer's testing version. That's why you'll see buttons to the side. When you hit Play and go to the game playfield, you'll see very rough programmer art. We would have replaced everything with higher quality artwork.

I learned how to work with sound effects and music in Flash on this one. I also learned how to do pathfinding so the bad guys can walk around and find a path through the game board. Oh, and let's not forget isometric game design, collisions and a matrix for the movements. The 2d board to the right would not be visible to the player. I used it to calculate the movements. Like I said, I'm not a programmer, so I had no experience in any of this stuff.

You might notice the web link at the bottom is www.fatpiggames.com. We originally considered Fat Pig Games, but felt some of our players might not like that name, so we made our pig CRAZY! We really are much happier with Mad Pig Games.

In the game board page, you can send bad guys and place units on the board. The bad guys currently collide.

I'm writing this and bringing out the old, unfinished work so you can see how projects evolve, change and sometimes get dropped. For us, each project was worth the time and effort as it helped us learn and refine what we were after.

While we were working on the Tower Defense game, and realizing how much work the game we had planned would become, a friend of ours suggested we do a less complex and more popular game. A solitaire game.

We decided to work on a Klondike Solitaire game.  More about Mad Pig Klondike Solitaire (our first game on the iPhone) later...

After we finished the first version of Klondike, we started experimenting with another game idea with a couple partners. We ultimately decided to not finish it, but here you'll find our test:

You'll need to click on it and then you can use the corner navigator, or arrows, to navigate. You can also click and hit the spacebar to center on whatever is selected or where you clicked. The planets are random every time you refresh the page

The rectangular buttons on the right: First one does nothing. Second shows a prototype list view. Third one shows a radar view prototype. The bottom two show a possible effect when you lose some equipment during game play. 


B did most of the planets and I did the programming and star field graphics/programming.

We will post more in-progress art and tell more of the story of Mad Pig Klondike Solitaire in future posts. 


New Twitter Page


We now have a Twitter page. Hard to believe, but this is the first time I've used Twitter. Please follow us. I'm sure we'll figure out how to use it. ;)

It's Alive!!!! Mad Pig Games is born.

Today at lunch, in the city of San Francisco, two men signed some papers and a company was born. Mad Pig Games is now official!

I was going to write a much more interesting and humorous post, but there is just too much to do and too much else I'd like to post. 


Friday, July 8, 2011

Look at me!

This was our first ever test post to see how things looked against different backgrounds.