Tuesday, June 2, 2009

Poker vs Girls

Coming Soon...hopefully any day now.

Saturday, April 25, 2009

Programming Poker AI

Peter has done great updates (one, two, three) about how the user interface for our iPhone poker game has evolved.

Since it's looking so good for 2 players with chips, we knew that the one big request we would get is to have an AI so you could play one player against your iPhone.  I really didn't think I could do a good one--not even knowing where to start.

This post really helped get me started, with some methods to do the hand strength and some basic play.  I'd thought there would be some crazy mathematical formulas, but it was simpler than that--simulate a bunch of hands and see the percent it would win made sense.  Brute force I could do :)

I'm sure I could have found some existing poker AI to just plug something in.  But for any feature that's a core thing in a program I am making, I really don't feel I've solved the problem if I use some library to do it.  It's a Poker App--I wouldn't feel right using somebody elses AI.


I'd already done my own thing to detect which is a winning hand for the 2 player game--and while pretty  inefficient compared to the ones I've read about--it works.  And is fast enough it can do all the AI's calculations in a second or two.  Good enough for our 2 player poker game (since only has to do it for one player instead of a full table of players!)  It just took running that hand comparison with the AIs hand against a bunch of random hands.  It can do 100 or so in a second.  Which by my tests, gets it within a few % of the right hand strength.  Any errors where it's off will just make it more unpredictable. 

Interestingly, since the cards haven't changed, we tried having later actions in the turn play quicker...and it was too quick and didn't seem right.  So if it has to decide again (it bet, you raised, so it has to decide what to do), it does more calculations to improve its hand strength estimate--and to take enough time to really seem to be thinking about what it will do.

Starting with the basic strength percent, it also does many checks to play-down or play-up various hand types.  A few examples:
  • If it has a pair but there's at least one card showing on the board that is higher than my pair subtracts a bit from the strength.
  • Big flush draws when I don't have a flush are scary.
  • There's a bunch more...
Another thing we've worked on is so it knows some more advanced poker strategies.  Things I've probably done in a game, but Peter has done and knows the reason and names :)

Sometimes, it will slow-play really good hands.  But also knows when to stop slow playing them too.  (AA pre-flop is one it might slow play, but if the board comes 678 suited, it likely will stop slow playing its cards.)

We'll leave other strategies it does as a surprize for when it does them.

It's turning out to be a very competent player!  I'd worked for several days doing many strategy improvements, and the first game, it beat Peter (a good player who's won a nice bit of money in tournaments.) 

Wednesday, April 15, 2009

Hey Apple...

Another idea for you Apple.

As a developer, we have the iPhone Simulator and can run the iPhone programs right on a Mac for testing.  Couldn't you package the same code so any Mac (and maybe even Windows) user could buy and run any iPhone app directly on their computer too?  As part of iTunes or something, launching them in separate windows so you could have a couple running at once.

There are many that would be pointless (ooh, a flashlight!)...but might be kinda cool for others.  And would give anybody with a Mac a taste of what they could be running on an iPhone or iPod touch.

Monday, March 30, 2009

Great Gifts for Wifey

My wife has been sick for far too long. (Stage 4 Endometriosis. Very painful, but thankfully surgery next month to fix the problem.)

I got her two presents as she's been spending far too much time stuck in bed.

Nintendo DS. She'll probably never let me play it. She found several good word/crossword games, along with some "hidden object" sorts and she plays it a lot.

And I just got her a Kindle. She reads a ton even when not sick, and after doing a little math, we're better off. She'll reread the earlier books in a series when the next one is out, so doesn't want to ever get rid of books. With the Kindle, we save a few dollars per paperback (and closer to $20 per hardback). Plus saving on shipping or driving to the store, plus bookcases ($100 each just going to Ikea--and running out of space to put them.)

Even decided that we'll save if I get one too...since she's never going to share.

Sunday, March 8, 2009

Thank You!

To the mystery Apple employee who chose iCatchall Tools as their Staff Favorite.

Thanks to you, iCatchall Tools got to the #1 sales spot in the Business category in iTunes! I like to think we'd have gotten there ourselves eventually...but you saved us a ton of time and advertising. Our slow climbing got a huge boost starting the day the pick showed on the iTunes App Store first page.

And it's dragging iCatchall up as well, not quite the huge 20x sales increase, but still getting close to the top 20 in the Utility category. (And that's a much harder category to reach the top--the top spot there gets close to the top 100 overall...hopefully!!)


And our next app is submitted, I couldn't write a better description of how it came to be than Peter did... Six Days from Idea to App.

Monday, March 2, 2009

App Adds Own Ads...

Our free app, iHourglass Free previously used AdMob to show ads. Made a few $ per day--about enough to cover the company coffee addiction. And if they'd let us fill the 60% extra unsold ads with our own, we probably would have stayed with them. We thought the ability to show a bunch of ads for our own programs was too good an opportunity to miss.

So we made out own ad system. iHourglass Free has been in the top set of free Utilities for a really long time, so there's lots of people using. All ads we'll show for now will be for our other iPhone programs! If it works well, we will see how to open it up...


With a brand new ad system, it's easy to pick out the hits. Since until something is approved, if it's not me or my brother, it must be Apple reviewing :)

Sunday @ about 4:30pm. Hits from an iPhone that ran it a few times so saw a couple ads. Can't tell if they ran it on any without a network connection of course.

Monday @ about 3:30pm, got the notification it had been approved. Within 1/2 hour, started to see hits from people who were getting the new version! It will be very interesting to see, within a few days we should have a good idea what percent of people are using iPhones vs iPod touches; as well as what OS versions too.


(Update, the stats we got ended up in a nice article on ArsTechnica!)

Tuesday, February 3, 2009

App Approval 2

We did an update to the FTP Picture Upload iPhone app, so once again I get to see what the testers at Apple uploaded to our server when reviewing the program.  

These are even more awesome.
    
Wow.