Sunday, March 6, 2011

An Open Source Mobile Tongits Game

I finally found the source code of the mobile Java Tongits game I sold back in 2006. And as promised I have released the code under an MIT open source license. This code is a direct port of the very first Tong-its game I released back in late 2003 which was written in C++. It contains similar code for basic AI, displaying the cards, shuffling, controlling turns, validating moves, and processing inputs from the handset. I'm not sure how much relevance this code has today, it probably has none anymore except maybe educational and historical value. Feel free to do whatever you want with the code.

I tried selling this mobile game for $1 and it made a few sales but it was generally a flop. You could say this was a forerunner of the current $.99 cent pricing trend in today's mobile games. The biggest problem during those times was, you guessed it right, device fragmentation. Developers had to deal with different screen resolutions (176x208, 128x128, 240x320, 352x416, 176x220, 208x208, 800x352, etc. etc.), inconsistent Java runtime and foundation versions and even operating system editions (Symbian Series 40/60, UIQ, etc). Imagine how application testing was such a nightmare before.

jTongits at Google Project Hosting

Saturday, March 5, 2011

Drac - The Most Famous Solitaire Game on the Least Famous Platforms

One of the major improvements that I want to happen in this website is to revive, discuss and enhance my old open source software as well as contribute new and better ones. Let's start with Drac, an old C++ framework I created more than 7 years ago. According to my old self:
Drac is a completely free, open-source, portable card game library that uses SDL (Simple DirectMedia Layer). It provides almost everything you need to create your very own card games. Drac is a set of C++ classes and functions that help simplify the development of card games. Any simple game specially solitaire games can be created using Drac with minimal effort. It can also be extended to accommodate more elaborate games.
Now who uses Drac? I'm afraid not too many. We can maybe blame the lack of updates on my part. I apologize for that. I just worked on it non-stop back then without the help of version control systems and when I felt it was finished on some arbitrary level, I hurriedly uploaded it to Sourceforge.net without any plans of updating it. Again I apologize for that. Nonetheless it was still a useable and working version. And as a proof of concept of its viability, it was used to power the very first incarnation of Tongits (spelled as Tong-its back then) which was also open source.

People from the not so mainstream crowd also agreed it has value so they decided to port the framework together with the sample solitaire game to different esoteric platforms. So aside from the common Windows, Linux and Mac platforms, Drac is also available in the following:

MaemoDrac

A port of the Klondike sample app to the Nokia Maemo platform (now part of MeeGo). Learn more about MaemoDrac.

KlondikeDC

Another port of the sample app to the Sega Dreamcast game console. Learn more about KlondikeDC.

Drac on Popcorn Hour

Drac powers the solitaire game on your favorite network media player. Learn more about Popcorn Hour with Drac.

BeOS and Haiku

The old open source Tong-its game together with Drac was also ported to BeOS and Haiku operating systems. You can learn more about them here and here.

Seeing your old creations being embraced and appreciated by other platforms really feels good. And to thank all those who appreciated my old work, I will be releasing soon an updated framework based on Drac and the engine that powers the current Tongits game. This time it will be written in ActionScript 3.0 instead of C++. Watch out for it on Google Code.

Friday, November 5, 2010

Celebrating 15,000+ Tongits Fans!

The Tongits Facebook page was launched almost a couple of years ago to serve as a venue for discussions and foster community among Tongits players around the world. Now we’re 15,000 strong and continuously growing. Thank you very much for all your support!

Monday, October 25, 2010

A Healthy Dose of Tongits AI Analysis from Deuts.net

Tongits was recently featured on Deuts.net and the author has provided some very interesting points on the game’s AI. Here’s an excerpt from the article:
  • It’s very much predictable when it calls draw. It doesn’t bluff. I believe it calls draw anytime its cards point total less than 20 at any stage of the game;
  • It calls chow even when what at his hand is already a set. For example, you throw a queen at it, it calls chow with three other queens from its hand, ignoring opportunities to form more sets from the “undrawn” stock of cards;
  • It calls “draw” even if the other player has only one card left. This is I guess the effect of it calling draw anytime its hand’s point totals less than 20. Think about it, the fact that the other player has only one remaining card and the last card it/he/she threw or discarded was a three, then the remaining could only more likely be an ace or a two. Yet, it calls draw even if its point total is, say, nine;
To read more you have to go to the entire post. I have to say I was very impressed by the analysis and it really hit the nail right on the head. Thank you very much Jorelle for writing such an insightful post on Tongits AI!

Image from atariarchives.org

Sunday, October 17, 2010

How To Properly Apply Promo Codes on Name.com

Name.com is my domain registrar of choice for the past 4 years and I can’t recommend it enough, their customer service is excellent. However, their domain purchasing process has a few quirks that might dissuade first time buyers and even a few existing customers. Here’s a way you can easily get around with this.

Currently (this month only) they’re running an $8.49 .com/.net registration promo with the catchy OMGZOMBIES code. But how do you take advantage of this discount and at the same time, avail of the FREEWHOIS promo code to save on Whois privacy fees which normally costs an extra $1.99?

The trick is to not select the Whois Privacy checkbox, just use the main promo code first, OMGZOMBIES in this case. Then after you have registered the domain and have taken advantage of the discount, go to your Account page and open your new domain’s management page. Look for the Whois Privacy entry and tick the renew checkbox. Finally, go to your shopping cart and apply the FREEWHOIS promo code.

You can actually perform this “whois privacy trick” repeatedly for any number of years you want. I like to believe this oddity is an easter egg on Name.com’s website and not a bug since this has been going on for quite some time now. It was actually fun to discover and I really do think the Name.com staff put it in there for their loyal customers to discover and have fun with. Still, I would’ve preferred them to just make the whois privacy another free value added service on top of their already impressive list of features and great service.

Tuesday, October 5, 2010

Tongits Sales Report

It’s been almost 3 years since Tongits shipped and it continues to sell well despite little to no marketing. Here’s a graph showing a steady growth in sales. It reached a peak during the 2nd quarter of 2009, the height of my advertising and promotion phase. I don’t place ads anymore and just let the game spread virally through the more than 14,000 fans of the game on Facebook and good old Google search. Which reminds me to take this opportunity to thank the thousands who registered the game and all the fans, thank you very much!

Wednesday, November 25, 2009

Vibrant Ink Theme in Flex Builder 3

I wanted to change the color scheme of Flex Builder to something more pleasing to the eyes. I’m used to coding with the default color scheme but I wanted to try something new and perhaps as a bonus help me code longer by reducing eye strain and conserving battery by replacing the power hungry white background.

So I started looking for a nice color scheme and found a lot of really good ones. I settled with the Vibrant Ink theme. I thought the process would be as straightforward as downloading a color scheme preferences file and importing it in Flex, similar to the theme pack in TextMate. But most of the preferences files I downloaded apparently only works with the vanilla version of Eclipse with Java, only some colors are being changed in Flex Builder producing an ugly combination of uncoordinated colors.

I ended up doing everything manually, changing each syntax element’s color in the Flex Builder Preferences window. I also needed to know the exact color of each of the elements in the theme so I inspected the source of the theme preferences file and used a handy color picker tool as well to grab the colors from screenshots of the theme.

Here are the colors for each of the syntax elements. I couldn’t find exact counterparts from the theme for some of the Flex related elements so I picked my own colors for them. You can use this as reference for your own customization. It will only take you a few minutes to change everything.

ActionScript ElementColorProperties
ASDoc#772CB7
Bracket/Brace#FFFFFF
Comment#9933CCI
Default Text#FFFFFF
Keyword: class#CC7733B, U
Keyword: function#FFCC00B
Keyword: interface#AF912BB
Keyword: package#FFCC00B
Keyword: trace#CC6666B
Keyword: var#6699CCB
Metadata#66FF00B
Operator#FFFFFF
Reserved#CC7733B
String#CCCC33B
CSS ElementColorProperties
@font-face#FFCC00B
@import#339999B
@media#663333B
Comment#9933CC
Default Text#FFFFFF
Delimiters#FFFFFF
Property Name#999966
Property Value#FFFFFF
Selector#FF6600
String#CCCC33
MXML ElementColorProperties
Comment#9933CC
Component Tag#FF6600
Default Text#99CC99I
Processing Instruction#FFFFFF
Special Tag#FFCC00
String#CCCC33
Editor ElementColor
Line number foreground#787878
Current line highlight#333300
Print Margin#4C4C4C
Find Scope#191919
Selection foreground colorDefault
Selection background color#3399FF
Background color#1C1C1C
Foreground color#FFFFFF
Hyperlink#0000FF