Loading....
Recent Article links:

Archive for August, 2008

Klaverjassen — now with Bluetooth!

After a day of pretty heavy programming, I am proud to announce a new version of the Klaverjassen game, now with Bluetooth support. Just in time for my train trip to the Sziget festival next monday :)

The new version (JAD, JAR) lets you choose between server, client and standalone mode. In server mode, one gets a list of all connected clients, and one can change their ordering by using the “Up” and “Down” menus. In client mode, one just has to wait for the server.

All remaining places are filled up by computers. The server player is responsible for pressing any key to let the computer player make a move. For the rest, the gameplay remains unchanged.

ChangeLog:

Milestone 4

* Bluetooth support!
* Now play with “0″, pass with any other key
* Changed layout/player names to facilitate smaller screens

Some notes on my implementation follow when I am less tired..

Klaverjassen M3 — it’s there!

After spending some time on the PC version of my Klaverjassen game, today I transferred the improvements to the mobile version, releasing version M3 (JAR, JAD). Basically, this means that it now features the still-dumb-but-not-quite-random AI of the PC version and improved game logic.

The user interface

Also, I wrote a new user interface. It is not perfect yet, but it looks pretty OK on my mobile phone’s QVGA (240×320) display. Smaller displays probably won’t work too well. Some screenshots (from the Sun Java mobile phone emulator):

Let me explain the UI. In the left-upper corner of the screen, the game number and the person starting in this game is shown. After every change in the situation of the game, the game pauses and one has to press a random key. For instance, this is after each card played by the computer, or after each play/pass decision.

In the left screenshot, the user (”Ik”) has to choose whether to play on clubs (”Klaveren” in Dutch), displayed just below the game number. In this case, I chose to play (by pressing the “3″ button of the phone — any other key would be passing), so “Wij op K” is displayed, meaning that we are playing on clubs.

Now, I choose to play the ace of spades by pressing the “4″ button. The other players also play some cards, and I win with 29 points, as shown in the right screenshot. And so on, and so on.

Changelog and technical details

Here is the changelog:

Milestone 3 (07-08-2008)
————————
Game logic:
* [FEATURE] Base play/pass decision on cards
* [FEATURE] Simple heuristic AI
* [FIX] Reset extra points counter after game
* [FIX] Rebuild of game class in pull based fashion
* [FIX] Don’t use Integer.compareTo(), @override in game logic
* [FIX] New trump can’t be the same as old one
* [FIX] Don’t use floating point numbers: not supported by CLDC 1.0
* [FEATURE] Added field showing first player in current showdown
User interface:
* [FEATURE] Brand new, graphical UI

The game, as far as I know, uses only CLDC 1.0 and MIDP 1.0 features, so it ought to work on any Java-enabled phone. I only tried it with resolutions of 240×320 and larger; smaller screens probably won’t work too well. I’d like to hear your comments!

Klaverjassen — PC version

To find out something about strategies, I did a PC version for my Klaverjassen game. Features:

  • Play Klaverjassen against a (not very smart) computer AI
  • Keep scores of games and total score

I did a very lazy attempt at an AI so it isn’t really smart yet (stay tuned for updates on this topic), but at least it should be a bit better than the previous mobile AI, which was completely random. A small screenshot:

I know the game logic isn’t completely correct yet — sometimes an illegal move is allowed or even forced, but I hope for your comments on fixing it. Also, rather than the game just going on and on, I am planning to build “pause” functionality later.

For now, the game can be launched using this link (Java Web Start); the file can be downloaded here. Stay tuned as I port the improvements in the game logic to the mobile version!

Where’s Waldo

Some three years after being spotted on German television at Rock am Ring – and of course, some months since having been on the BBC at a snooker match – , finally I was spotted again, this time on the Fabchannel recording of last years Wir Sind Helden concert in Paradiso: