No Magic Numbers

Action Solitaire 1.31 is now available for download.

After the last posting, we discovered a rather significant bug in Action Solitaire. It was fortunate that it was discovered in house, but unfortunate that it was not found during beta testing and, hence, required a public update. The problem caused two of the 65 games to behave incorrectly (or even crash) when large or huge card sizes were selected, either explicitly or implicitly through automatic sizing.

The problem turned out to be magic numbers in the code. We released the first version of Action Solitaire back in 2003, which was six years of coding experience ago and at a time when I felt under some (self-imposed) pressure to get the product finished. Unlike some of the other projects, the source code for this game has not been refactored, except to the extent necessary to make updates for Vista and add new games, so I never revisited these (working) games to see the problem.

For those who do not know, a magic number is an explicit and undocumented constant in the source code for a program, so named because the value works like magic, without any proper explanation. In this particular case, the width and height of an image buffer were set to constant values, calculated (manually) to accommodate an area based on the largest card sizes supported by the game at that time. Rather than actually letting the computer determine the necessary buffer size, based on named constant values (e.g., MaxCardWidth and MaxCardHeight), the code just used constant numbers directly. When the maximum card size increased, the buffer was too small and problems ensued. Such are the dangers of magic numbers.

It did not take long to find and fix the problem, but it should not have been necessary in the first place, especially since we had standards, even back then, that discouraged the use of magic numbers. I made an exception and got burned. Ouch.

Anyway, Action Solitaire can be downloaded here, and I guarantee ample opportunity to find other bugs in this product, but the game is fun (and addictive) as well.

Action Solitaire 1.30

Can you believe it? Another product release!

Goodsol Development has released Action Solitaire 1.30, continuing the string of product update releases in 2009. This latest version of Action Solitaire adds five more games and (belatedly) implements support for larger card sizes, including those provided in all of the newer downloadable cardsets. The new action games are:

  • Two Cells
  • Three Cells
  • Klondike Deal Three
  • Canfield Deal Three
  • Black Hole

One nice thing about these new games is that it creates 5 more opportunities for players to climb to the top of the standings (or ten, if one counts both tables for each game).

As this product was in beta testing, I noticed that, oddly, all of our Action Solitaire releases have been in odd years, starting in 2003:

  • Version 1.0 – December 9, 2003
  • Version 1.1 – April 18, 2005
  • Version 1.2 – May 24, 2007
  • Version 1.3 – June 16, 2009

Following this pattern, this would be the last update until the second part of July, 2011! However, a popular clambering for a Mac version would probably result in AS 2.0 well before that time.

Download and enjoy! [from here]

2009 People’s Choice Awards

Only two days left to vote!

This year, the leadership of the SIAF (Shareware Industry Awards Foundation), the group which produces the Software (nee Shareware) Industry Conference (SIC) each year, made the unfortunate decision not to present the Shareware Industry Awards this year. These premier awards were basically the Oscars of this industry, voted on by other industry members, and represented peer recognition. No SIA was presented for any standard game category last year (2008), so our own Pretty Good MahJongg was the last game to win one of these prestigious awards for the 2007 Best Non-Action Game.

In the absence of the Shareware Industry Awards, the People’s Choice Awards take center stage at the SIC banquet (presumably). With no nomination process, and voting open to anybody with an email address, there is no particular anticipation for these awards (and with no game PCA presented since 2006, even less for us). Nevertheless, I will support the awards process, so I submitted my ballot today.

The deadline is looming [Monday, June 15th], but if anybody has not yet voted and still has time to do so, we would certainly appreciate consideration of some of our products:

Although I certain could have done so, I did not fill all seven lines on my ballot with our games. I did an evaluation of the products that I use on a regular basis and which greatly aid my (development) productivity, and these products really stood out:

  • Beyond Compare is an absolutely indispensable part of my development toolkit, and I use it almost daily for code diffs, file syncing, single line editing, and even viewing of Japanese/Unicode resource files (which VC6 cannot handle).
  • Inno Setup is the easy choice for creating professional installers, and though it is not shareware, it is downloadable (free/donationware).
  • Help & Manual is simply the best help editor I have ever used (though I will admit to preferring version 4 without the ribbon interface).
  • PC-lint is critical to my C++ programming work and it is run, literally, alongside my compilations to guard against both silly mistakes and serious errors in order to help keep the quality of my code as high as possible (although there is no downloadable trial version, unfortunately).


To vote for the 2009 People’s Choice Awards, simply register to vote [Editor’s note: invalid link has been removed] (with just name and email address) and then follow the link that will be emailed to you and enter up to 7 software products. Easy.

A Tale of a Good Anti-spam Tool

Spam, spam, go away… You are not welcome ANY day.

My approach to my primary email address, from the very start (more than 13.5 years ago) was that potential clients and customers should be able to contact me without jumping through hoops, so I have never bothered to hide or obscure my address: seelhoff@sophsoft.com . I have always published it in plain view (and to do otherwise would now be closing the barn door long after the horse has bolted and gone on to live free and happy until dying of old age).

Of course, this also allows any spamming slimebag with an address harvester to easily add me to each and every email database on the planet, so I do get spam. Lots of spam. To be honest, though, the level of spam to my “open” account seemed to plateau fairly quickly, although I never really kept track. Over the years, it may have been slowly and steadily rising, but I know that my patience has been slowly and steadily declining, so a while ago, I added some tools to stem the tide.

Let’s talk numbers, first. Since the beginning of April, my primary email account has received 75,000 email messages. Of those, almost exactly 98% are spam. Of the other (legitimate) messages, 80% are business (1.6% of the total), and the remaining 20% (0.4% of the total) are personal. Both of these categories include active mailing lists, such as Carbon and DirectX development (business) and community events (personal). I set up my email client to automatically sort these (and marketing messages) into appropriate folders, and the number of messages specifically to me, from clients, customers, family, and friends, is just a handful per day. These are the only ones that actually hit my inbox and trigger a notification sound.

To be honest, not all Bayesian filtering is created equal, and my email client is probably about average. It handled much of the junk, but an annoying number of spams were being missed, and signalling me (incorrectly) that I had a legitimate message. When I finally had enough, I downloaded and installed POPFile upon a recommendation from somebody in the ASP. I had been leery about installing an interim mail server on my system simply for filtering email, but it turned out to be an excellent choice.

After several months of training, POPFile is 99.92% accurate selecting among business, personal, and spam classifications and, importantly, I have gone for more than a month without a false positive for spam. (Most of the classification “errors” are simply unclassified messages that need to be trained.) Used in series with my email client, I can review messages that either think may be legitimate (ideally, to never miss a valid email), but I am only notified of incoming mail if they both agree on the validity. This has greatly reduced interruptions and made my days more productive.

Of course, there is some training involved so POPFile can “learn” the difference between legitimate messages and spam, but the initial process goes pretty quickly (and when one averages more than 1000 messages per day, there is lots of data). If I were to start all over again, I would not have chosen to have business and personal messages separated, since that distinction is not particularly necessary for me (and not always clear, either, such as when a family member reports a server problem, or a business associate invites me to a party).

If you are looking for an anti-spam solution local to your own system, I strongly recommend POPFile.

Most Popular Solitaire 2.00

An update to yet another successful card solitaire game is released.

One week ago, Most Popular Solitaire 2.00 was published by Goodsol Development. This is a major upgrade to a product first released (for Windows) in 2003. Most Popular Solitaire is a collection of 30 of the most popular (surprise!) card solitaire games, including all of the favorites: Klondike (often known as simply Solitaire), FreeCell, Spider, and a number of (well, 27, obviously) others.

In terms of features, either the most important or least important, depending on ones system, is that Most Popular Solitaire 2.00 has equivalent versions for both Windows and Mac OS X available. This new version also includes Climb Mode and 13 bonus games in the full (purchased) version, as well as a number of other smaller features. (Of course, everything is a new feature on this initial Mac release, but it is an improvement on Pretty Good Solitaire Mac Edition 1.0, which included the same 30 games.)

In terms of technology, this release used the same revisions of our Goodsol Solitaire Engine that were used for Goodsol Solitaire 101 version 1.01 (on Windows) and Pretty Good Solitaire Mac Edition 2.01 (on Mac OS X). These are the last planned updates before the next GSE upgrade, which will add a few additional features and make some internal changes to reduce the source code differences between platforms.

The marketing challenge for this product is handling both the Windows and Mac OS X versions simultaneously. Having the same price (and registration codes) for both makes it easier, and also allows customers to switch to Mac (you know, or the other way) without having to repurchase. The biggest issue is the different approach to trial versions: whereas the Windows version can be converted into the full version by entry of the registration code, the Mac OS X version has a separate full version download.

In the three weeks since the latest Pretty Good Solitaire Mac Edition update, that product has risen (back) into the top 5 on Most Popular in the Cards & Puzzles category for Apple Downloads, but Most Popular Solitaire (Mac Edition) is now in the top 20 (and climbing) in only a week. Downloads of both products (trial versions) are increasing, but we will have to see how that translates into sales.

In any event, somebody is enjoying our games, and I dig that.

Duke Nukem For Never

Surprise (NOT)!

As you have probably heard or read, 3D Realms, the developer of (the aptly named) Duke Nukem Forever, has gone out of business. The company website now features a big “Goodbye” message on the front page. The story was reported even in the mainstream media, including this BBC News article.

The release date for DNF has always been “When it’s done.” This scheduling choice seems to put a product on a slow train to vaporware, and I posted about it being way past expiration three years ago: A Long Time Coming. I could rehash the history, but game industry news site Shacknews has posted an updated article (originally from 2007), The Brief Long History of DNF: Post-3D Realms Edition, detailing a dozen years of unfulfilled promises and hype.

So, now Duke Nukem Forever is finally toast, all of the developers have been laid off, the company is gone, and the product is going to remain unpublished. The saga ends here, right?

Not so fast.

Next comes word that Take Two Interactive, who in 2000 (perhaps unwisely) purchased the publishing rights to this title (from another publisher) for $12 million, and reportedly (probably unwisely) renewed this agreement with 3D Realms in 2007, is now suing for breach of contract. Of course, they (definitely unwisely) never provided any development funding for the title, so there is not much left there to get…

… except the source code. Take Two immediately filed for an injunction to get a copy of the source code “to ensure the code is preserved and remains unharmed” while it prosecutes its lawsuit, as shown in this article about the release of the court documents.

Now it is revealed in this Gamasutra article that “3D Realms has not closed and is not closing” after all. They merely fired (sorry, “let go”) the entire Duke Nukem Forever development team due to lack of funding. Still, they (i.e., unnamed 3D Realms representatives) “believe Take-Two’s lawsuit is without merit and merely a bully tactic“. Really? Interesting.

Here is what we know:

  1. Company management did not do what it would take to ship this game.
  2. The development team did not do what it would take to ship this game.
  3. The publisher did not provide what it would take to ship this game.
  4. Incompetence reigns in this matter, and there is plenty of blame to go around.
  5. It will probably be another year before this matter is finally settled.

This whole story is a case study in poor choices and a wholesale failure of anybody involved to recognize and acknowledge the [situation] this has become. Trains wrecks are fascinating, though.

Always Bet On Duke.” – I don’t think so.

Pretty Good Solitaire Mac Edition 2.01

A update to our best-selling card solitaire game for the Mac is available.

Goodsol Development published Pretty Good Solitaire Mac Edition 2.01, a maintenance update to PGSME 2.0 announced here.

This version of Pretty Good Solitaire Mac Edition fixes about a dozen (i.e., all) bugs reported since the initial release, and also makes a few changes designed to improve ease of use and, thereby, reduce the number of customer support inquiries. In particular, many users did not understand the Climb Mode feature at all, much to my personal dismay, so it is no longer the default.

The most important bug fix in this version, and the one that took the longest time to find and track down, was an interface race condition which could allow code to be unexpectedly reentered, sometimes causing a crash or, more often, just creating illegal positions. The nature of the bug meant that some (most?) players would never experience a problem, but a few managed to trigger the error on a regular basis. Imagine clicking to redeal a waste pile back to the stock and then attempting to redeal from the stock during this process. Unfortunately, “Patience is a Virtue” was not an adequate response.

After the initial release, Pretty Good Solitaire Mac Edition 2.0 was a hit in the Top Apple Downloads, rising to #2 Most Popular in the Cards & Puzzles category (and still in the top 20 as I write this). It also flirted with the Top 5 overall in the general Games category, peaking at around #6. This is only the tip of the iceberg, though, as the upcoming PGSME version 2.1 will have 200 games, up from 101 in the current version.

Onward and upward…

Making Mac Disk Images Pretty

This is how to add that “curb appeal” to your Macintosh disk images.

Important update:  Be sure to read Disk Images Revisited, the quick synopsis of which is that this method does not work properly on Snow Leopard due to a Mac OS X bug.  (Building disk images under Tiger or Leopard works fine.)

In a previous posting, I explained the basics of making Macintosh Disk Images for software distribution. By following that method, using free tools from Apple, you can create a basic disk image (.dmg) file that is suitable for downloading. The only problem is that, when mounted, it appears simply as a plain window with the bundle (and any additional files) in it. Utilitarian, at best.

We wanted something more like this:

Pretty Good Solitaire Mac Edition 2.0

This gives a much better initial experience, being not only more visually appealing, but also providing some initial instructions (text in green). Note that the ‘Pretty Good Solitaire’ and ‘Readme’ icons are live, while the rest of the window is simply a background image. In addition to this display when the disk image is mounted, we also wanted to add a license agreement before that happened.

We accomplished what we wanted (the image above being an actual screen capture from our upcoming release), and this is how we did it.

First of all, this can be accomplished, in theory, using the ‘Disk Utility’ and other free tools included with Mac OS X, provided a certain amount of legwork both in figuring out and then in executing the process. Upon a recommendation in the private ASP (Association of Shareware Professionals) newsgroups, however, we tried and settled on an inexpensive third-party tool called DropDMG, from C-Command Software. Not only does this save time and hassle, but it provided an added feature that we did not even know we wanted. (The trial version is fully-featured, and for only $20 the decision to purchase took no deliberation.)

Even with this tool making life easier, it is important to note that the process is slightly convoluted, primarily because one needs a relative path to background image. In our first few attempts, we managed to have backgrounds that showed only on the development system, but disappeared (rather, never appeared) when downloaded to another system. The basic approach is to create a writable disk image first, with the desired contents (including the background image), then arrange this malleable window as desired, and finally convert that into a final (read-only) disk image for distribution.

The first step is to create the desired background image (which is left as an exercise for the reader); it should probably be a non-lossy PNG file for best results. This file should generally be “hidden” in the disk image, and (according to warnings I chose not to test) needs to be in a subfolder, not the root of the disk image. The most common, even ubiquitous, recommendation is to make a hidden subfolder and place the background image in that. However, we took a slightly different tack, by way of the following trick:

Add the background image (say, install.png) to your product bundle in Xcode. Our software has a ‘resources’ folder that contains various images used in the game, and by simply copying the background bitmap there and then adding the file to the project, it is included in the application bundle. This way, there is no messing around with an extra folder just to hold a single file, and if a system is configured to show hidden files, there is not a rogue “.background” folder icon floating around, messing up the layout. (The drawback is that the bundle is slightly larger, but the download size would be essentially the same, and an extra 100K on a hard drive is negligible these days.)

Once you have the background image created and included in your project, follow the setup process in the original post, by creating a distribution folder (named “Pretty Good Solitaire 2.01” in our example) and copying your application bundle and any other files/documentation (e.g., “Readme.txt”) into it. This will serve as the basis of the final disk image, so make sure that everything is up to date.

Now, this is where DropDMG comes into play. Launch this application and create a default configuration for writable disk images (which we, creatively, called “writable”). Select ‘DropDMG->Preferences…’ from the menu, and then in the dialog box, for ‘Format’ choose “.dmg Read-write (can be modified)”. Frankly, the other settings do not matter much here, so leave the default values. Finally, select ‘Save Configuration As…’ (Command-S) from the ‘Configuration’ box and save this configuration, then close the window.

Next, select “writable” (or whatever named you chose) in the ‘Configuration’ box of the ‘DropDMG Status’ window. Then, simply drag the distribution folder onto this window, and a disk image will be created and placed (by default) next to the distribution folder. The log file will reflect this action (as in, Created “Pretty Good Solitaire 2.01.dmg”).

The next step is to mount (and open) the writable disk image, which can be done simply by double-clicking on it in Finder. This window can then be configured as desired, including resizing, setting icon sizes and positions, and (of course) changing the background image. Here are the steps that we take to do this:

  1. Press Command-J (‘Show View Options’).
  2. Under ‘Background’, select the ‘Picture’ radio button.
  3. Click on ‘Select…’ to choose the background image.
  4. Select the mounted disk image (under ‘Devices’).
  5. Press Shift-Command-G (‘Go to Folder…’).
  6. Type the name of the application bundle (e.g., “Pretty Good Solitaire.app”).
  7. Browse ‘Contents’ for background image file (e.g., “resources/install.png”).
  8. Click on ‘Select’ button.
  9. Resize window to fit background image (if necessary).
  10. Reposition icons as desired.

Once you have this done, unmount the disk image, and the layout configuration will be saved. (You can double-click on the .dmg file again to verify this.) Note that it is essential that the background image be selected from the disk image itself (see step #4); otherwise, the link will be to a file on the current system that will (most likely) not be on a user system, and a plain white background will be used instead.

If you want to include a license agreement in the disk image, one that must be accepted before the disk image is mounted, then you will need to add one in DropDMG. Honestly, this part of the interface leaves a little to be desired, but to avoid confusion, here are the basic steps:

  1. Press Command-L to ‘Show [License] Agreements’ window.
  2. Press Command-D to ‘Add [License] Agreement…’ (name).
  3. Type a name for the new license agreement and click ‘Add’.
  4. Select the new license agreement in the window.
  5. Press Shift-Command-D to ‘Add Language…’ to that agreement.
  6. Choose a language and click ‘Add’.
  7. Double-click the added language and insert text as needed.
  8. Repeat previous three steps for each desired language.

At this point, return to DropDMG preferences again (DropDMG->Preferences…). This time, create another configuration for your specific product. Under ‘Format’, select “.dmg zlib-compressed (Mac OS X 10.1)” (or another read-only option at your discretion). This will be the format of the final distributable disk image.

Under ‘Options’, you can select the license agreement added above, if desired. Check the ‘Use custom icon for mounted image’ option. This is the bonus feature that we did not even know enough about to know we wanted. Instead of a simple disk icon, when mounted the disk image shows a disk icon with the bundle icon superimposed on it (which you can see in miniature on the title bar in the example above). There is a way to create a truly custom icon, but we did not feel the need to go that far.

Also check the ‘Auto-open image window after mounting’ option, which causes your window landscaping to immediately appear to the user when the disk image is mounted, as intended. However, do not check the ‘Internet-enable’ option, as this will cause the contents to be automatically copied into the download folder, skipping all of the hard work you just did to get to this point.

Save this configuration (Command-S), close the preferences window, and then select the new configuration in the ‘DropDMG Status’ window. We are in the home stretch now…

Drag the writable (and beautifully landscaped) .dmg file onto the DropDMG window. This will begin a conversion to the new, distributable format. The action will be reflected in the log (as in, Converted to “Pretty Good Solitaire 2.01-1.dmg”). Rename the brand new disk image to something appropriate and upload it. Of course, you definitely need to thoroughly test it, as you would an installer for a Windows product, but if you followed these directions accurately, it should work for you. [Insert disclaimer about me taking no responsibility for your results whatsoever…]

Done.

Goodsol Solitaire 101 version 1.01

A maintenance update to our latest Windows solitaire game is released.

Goodsol Development has now published Goodsol Solitaire 101 version 1.01, an update to the initial version of GS101, which was released last November [2009]. (Internally, I refer to the product as GSCI to avoid confusing naming such as GS101101.) This version fixes a number of bugs that were discovered since the original release.

What makes this release interesting is that it shares its game data file with our Mac product, Pretty Good Solitaire Mac Edition 2.0, and both games are based on common source code, so several of the bugs that were fixed were originally discovered during beta testing for PGSME 2.0, and then confirmed and resolved on GS101. Of the various arguments I have heard for cross-platform development, additional testing of the fundamental program logic (on each system) was not mentioned, so this was a welcome surprise. It should only benefit the quality of both products.

For more information on the game, please visit the Goodsol Solitaire 101 web site, or just download the program and give it a try. This update is free to all customers who have already purchased GS101.

Pretty Good Solitaire Mac Edition 2.0

The next version of our card solitaire game for Mac OS X is now available.

Pretty Good Solitaire Mac Edition 2.0 has been published by Goodsol Development. This solitaire program includes 101 games (up from 30 in version 1.01), plus 34 bonus variants in the full (purchased) version. It also adds some features, including the introduction of Climb Mode. For more information on the basic features, see the screenshot tour.

This version of Pretty Good Solitaire Mac Edition is a major technological upgrade from the previous versions, now being based on our Goodsol Solitaire Engine, which is a cross-platform, data-driven game engine that has been the focus of our development over the last year or more. Although more improvements are still planned, the basic functionality of this engine has already been proven, and it will allow us to produce upgrades and expansions more quickly and easily.

Climb Mode is a feature where deals for a particular game are played in numerical order, with a fixed set of rules, for a cumulative game score. This feature was implemented originally as a solution to online statistics manipulation, but it has evolved into a good competition, especially in the card solitaire games. With the addition of Climb Mode and the supported 101 games, PGSME 2.0 is the Mac OS X equivalent of Goodsol Solitaire 101 on Windows, and they share online high score tables.

Because of the (overly?) generous upgrade policy, Pretty Good Solitaire Mac Edition 2.0 is free to all customers who purchased PGSME 1.0. If you have not purchased yet (why not?), it is available for $24.95 (plus $7.50 if you want it on CD) here.

One down, two to go! (See the second item in our company goals for 2009.)