Neurotic Nerd Software development blog

NSKeyedArchivers are not as scary as once thought

by Jason on Mar.17, 2009, under Gin Rummy

After a good bit of progress setting up the multiplayer match-making code, I took a break by taking a look at how hard it would be to get the “continue game” button working as it was originally intended (allowing you to continue your game after quitting).  It turns out Objective-C includes some nice features I hadn’t yet explored that made the process extremely easy.  For each class, you just need to implement two methods (encodeUsingCoder: and initUsingCoder:) that save all of its member data.  From there, it’s pretty easy.

I already found one bug letting you cheat a bit (if you quit the game after drawing the discard card and then re-launch, you are allowed to re-discard that same card).  It’s been a surprisingly bug-free ordeal thus far.  That likes to change though.  Speaking of which, I haven’t done any leak checking on all this new code yet.  That’s often good for a headache or two.

edit: No leaks showed up in the new code :)

10 Comments :, , , , more...

Multiplayer is coming

by Jason on Mar.16, 2009, under Gin Rummy

Work on multiplayer has been coming along.  Unfortunately, the NAT-punching has hit a ton of stumbling blocks.  Most of them have dealt with me setting up a match-making server on my shared hosting.  It looks like I may have to use TCP instead of UDP for the phone-to-phone connection.  I’m a bit worried that it is going to cause problems with dropped games, but it looks like the last resort unless I am going to set up a server somewhere else.

I’ve read that Apple does not approve any apps/upgrades that mention features that are not fully implemented in that version.  I was planning on reducing the single-player cost some more and releasing a separate multiplayer version.  It looks like Apple will not approve any version of the single-player that mentions the multiplayer though.  Then again, there are definitely a few apps that make no bones about having missing features only available on more expensive versions.  Apple is a huge pain in the ass sometimes.

13 Comments :, , , , more...

Gin Rummy 1.1 on its way out

by Jason on Mar.05, 2009, under Gin Rummy

Before work could really start on multiplayer Gin Rummy, a quick update is being thrown out.

Changes:

  • four color deck option
  • added a status bar at the top to indicate opponent and difficulty
  • made the cards slightly less ugly

An attempt to speed up the AI a bit may or may not go through at the same time.

6 Comments :, , , more...

Gin Rummy officially released

by Jason on Mar.02, 2009, under Gin Rummy

Apparently Apple approved all the tax forms, and Gin Rummy was pushed out a few days ago.

After reading the first couple of reviews and comments on the YouTube video, I’ve decided to try to push out a multiplayer version before diving into the next project.  It shouldn’t be too terribly hard to do, although testing will be interesting.

9 Comments :, , , more...

Dot product LOL

by Jason on Feb.17, 2009, under Awesome game #2

The past couple of days have been really frustrating as I try to implement a very basic collision detection system using the separating axis theorem.  After more hours than I care to admit drawing coordinates and angles and writing out lots of convoluted trig, I learned the following:

All you have to do to project a 2d object onto an arbitrary axis is use find the dot product, you idiot.

I really need my new Rock Band drum pedal to show up so I can rock off some energy.  This week has been pretty crappy.

13 Comments :, , , more...

Next project underway

by Jason on Feb.13, 2009, under Awesome game #2

The next project is going to be a bit under wraps until things get further along, but I will say that it is a game and it will be awesome.  The reason I don’t want to mention it outright is because no one else has done it.  It would be pretty tragic for a big development team to jump on the idea.

I will say that it is going to involve some pretty simple 2-D physics, something I don’t have much experience with doing from the ground up.  I decided against using something like cocos2d-iPhone for a couple of reasons. The physics are going to be pretty simple for such a heavyweight library. I also want to get my feet wet with some basic collision detection, friction, and whatnot.  Even though the basic physics can be done in 2-D, a lot of thought has gone into doing a 3-D projection for less hands-on parts of the game.  We will see.

Most of the physics involves really simple rectangles, so I’m probably going to design a quick engine using the separating axis theorem.  My head isn’t completely around how I’m going to implement it exactly, but I’m getting there.  Time for some white board work.

6 Comments :, more...

Gin Rummy 1.0 submitted to Apple

by Jason on Feb.13, 2009, under Gin Rummy

Gin Rummy 1.0 was submitted for Apple’s approval last week.  The last few important bugs were ironed out nicely.  The AI now rarely cheats!  I did catch him once making an incorrect final discard that left his deadwood over ten, but getting a first version out was more important than having it 100%.  At least he now longer occasionally uses a card in multiple melds at the same time.

There are a couple of issues that weren’t completely ironed out, but they are certainly not game-breakers.  Back in the early betas, there was a problem with going to the menu and launching a new game while the AI was still thinking causing very odd things to happen.  Fixing the AI’s deadlock bugs made this bug relatively irrelevant.  Maybe if you are super fast you can still replicate this, but it is not a concern for a normal user.

I am very happy with the AI architecture overall.  The set of weights it uses can definitely use some tweaking.  (I didn’t realize that runs are slightly more valuable than sets because of the potential for runs extending past four cards for one thing.)  Most of the numbers were kind of fudged in a way that worked pretty darn well right off the bat.  I considered setting up a self-training genetic algorithm to find “optimal” weights, but decided it was unneeded; it would take quite a bit of code tweaking to get running anyway due to the current code layout.  I also harbor some worries about the “optimal” weights working well against the AI but not very well against a good human due to the design of the AI algorithms themselves.  Excuses or no, it just didn’t seem like it would be worth the trouble.  The AI also has a bit of a memory deficiency.  He tends to forget cards he discarded earlier, although he perfectly (on expert) remembers every card you’ve ever played or discarded.

A few improvements slated for the next update include a four color deck option, ability to review both players’ final hands while viewing the round summary, ability to view the current game scores from the menu at any time, making the popup tooltips less ugly, and some kind of visual indicator as to how many cards are left in the draw pile.

10 Comments :, , , , more...

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Visit our friends!

A few highly recommended friends...

Archives

All entries, chronologically...