PubNub Chess Club was inspired by the PubNub 3D Visualization contest on ChallengePost. It is targeted to any chess player with a browser and runs in any WebKit enabled browser, although currently it works best in Chrome. The contest piqued my interest about PubNub and what it did. When I found out it was an ultra-fast, super smooth, messaging network that could be used to create collaborative apps, I realized I needed to get to know the service. I had previously been looking at collaborative technologies like SignalR, etc., but the thought of setting up servers myself, especially those that could scale rapidly under heavy traffic loads, was more than I could handle. When I discovered that PubNub was an affordable feature-rich messaging and signaling solution that was "no assembly required", I decided to go through Ian Jennings excellent tutorials on PubNub and see how much effort was involved in programming around it. I was delighted to find out it was easy as hell.
I then searched for a game that I could tie into the chat lobby I had built from Ian's tutorials. I found the 3D Hartwig Chess set project on GitHub and forked it. That project provides an attractive 3D chess set with several really nice animations for moving pieces. Tying it into PubNub was easy and fun. It became a simple matter of passing the chess moves back and forth over PubNub through a private channel dynamically created for each game, and animating moves received from the remote opponent.
The best part was learning about features like the Presence API, which I used to add/remove users as they join the chat/room, and detect the arrival and exit of an opponent during the game. Implementing that API was equally easy and the idea that I could completely offload the management of online users to PubNub was wonderful. This opens the very real option to create collaborative apps that require no server component yet have all the advantages and features of client apps supported by a heavyweight server!
I look forward to trying out the other powerful PubNub APIs like the Access Management API, the Data Sync API, and others.
All the source code for my entry can be found on GitHub at this URL:
The game can be played at this URL:
NOTE TO JUDGES:
If the chess board looks "bland" or worse, you have disappearing pieces, please note that the latest version of Chrome introduced a bug that affected badly some 3D shader code like the Photon library used in my project. The chess board normally looks sleek with glossy shaded pieces, but it's just my bad luck that a week ago Chrome introduced this bug right in the middle of your contest. You can see the confirmation of this bug in the issue tracker on the Chrome issue tracking system (see last message):
I hope you can look past this when judging the app. It really is a great looking app when fully rendered. Hopefully the Chrome team fixes the bug by the time you read this.