Thursday, October 23, 2008

Kick, Drop, Cancel Game

Today I implemented kicking, dropping, and canceling games. This should make things more smooth during play and give everyone more control.

Below is the new view for a host, which gives him/her a link to send to people playing the game.



This is a shot of what a non-host will see in-game. Notice the new "drop" link to the right of the person's name.



This is a shot of the host in-game. He/she can kick players or cancel the game entirely.


I haven't tested what happens when someone kicks or drops the controlling/current player. That still needs to be tested further.

Saturday, October 11, 2008

Auto Register Implemented

Today I implemented an auto-register feature for Facebook users. It will automatically create an account in the Thirteen game site without the user having to enter their credentials. Since the user has no opportunity to enter credentials, I'll have to implement a user profile page where the user may edit their credentials. 

Wednesday, October 1, 2008

Layout Changes

I made a big layout change due to an inspired comment from Yin, that the card blocks seemed strange and unintuitive. Behold the new layout:

Thursday, September 25, 2008

Kosal's Comments

Kosal provided the most feedback of anyone so far, describing some layout modifications and minor changes that I agreed would really improve playability of the game. Some of the updates:
  • New Players Box which shows who is in control, who's turn it is, how many cards each person has, and the last hand they played.
  • Removed unnecessary Select All and Select None boxes.
  • Changed the layout so that the cards are smaller, so there is room for the players box and history.
I still have several more of his recommendations to implement, but I am making good progress. Here's a screenshot of the current build:



Wednesday, September 24, 2008

Continuing Progress

I've made progress on a number of fronts thanks to the encouragement received from various friends who have been helping me to test the app. Thanks a bunch to:
  • Grace
  • Kosal
  • Lisa
  • Priscilla
Some notes:
  • Implemented more accurate Thirteen rules by removing requirement for user in control to pass to clear the controlling hand.
  • Show only games which have not begun or in which the current user is a player.
  • Grace found a weird error where the diamond symbol appears as a box. This is frequently indicative of some encoding problem, but I cannot reproduce it.
  • Added instructions at the bottom of the page.

Friday, September 19, 2008

Ajax Refreshing

Today I finished implementing FB's Ajax method of reloading DOM content to make the game more user friendly. In the non-FB version, I just refresh the page every 5 seconds. This is, of course, an inelegant solution, but it works.

I am finding it very troublesome debugging the Facebook app. The silver lining is that it has given me new insights on how to build my next application.

Still to do is to implement Ajax refreshing on other pages besides the play-page.

Wednesday, September 3, 2008

Game Over!

Today I implemented some more code surrounding a game over event. Originally, I would simply delete the serialized game object from the database, which would be confusing for players. Instead, I am now setting a game-over flag and leaving the game in the database. This may be useful in the future to analyze human matches when I begin to work on the AI portion again.

The task was especially hairy due to some issues over how AI players affect the game differently than a Human player does. I had to refactor the code a good deal to incorporate AI players so there were still snags here and there.

Tuesday, September 2, 2008

Invitation/Registration

Most of the recent programming sessions were spent ironing out the invitation and registration system used by the application both from the main site and the FB portal.

FB has a very particular system of application invitation which attempts to prevent abuse. As an avid Facebook user, I can state from first-hand experience that the invitation system needs work as I have been deluged with invitation requests not only for application but for friends and events.

I have a invitation system in general which will limit who can join the game. This will prevent people from adding the application until its ready. For now, I will setup custom invitation codes by hand for a select group of alpha testers.

A big consideration in releasing any system is the readiness of that system and whether any users will be turned off from trying the beta once they have been burned by an alpha system.

Friday, August 15, 2008

Rendering

Most of today's programming session was centered on CSS. Certain styles were embedded directly into HTML elements using the style attribute. I worked at removing these, organizing styles into classes, and altering the rendering to appear similar cross-browser. I am still having difficulties with IE however.

I also added a history pane, which shows the game history in terms of hands played.

Saturday, July 12, 2008

Consolidation

The original web app was written in an include-driven method, which has not translated well to Facebook integration. I have therefore consolidated most application code into a new global application class which handles processing. The includes merely call these application-level methods to perform processing.

In this way, I can derive a Facebook application class from a parent and override certain key virtual methods which control rendering, which Facebook is very particular about. Facebook only accepts a certain subset of HTML and javascript in its integrated applications.

Thursday, July 10, 2008

First Things First

After recreating the former schema and ironing out some more of the setup issues and before beginning the integration, I decided that I would need to add a much requested feature--AI.

I decided to work on two levels of AI, one really dirt simple bot, and another more advanced one. The simple AI took several programming sessions to implement.

It involved developing routines to generate all possible moves given a player's hand, and rewriting the code to allow retrieving the appropriate hand from an AI Player subclass of the general player class.

The second level of AI has been less straightforward and is only 60% complete thus far, despite certain assumptions I have made to ease the task.

Thursday, June 26, 2008

Revival

I had been working on a few Facebook applications when I remembered that I already had a working web game I had written in college. It was a simple game based on the card game Thirteen, which some people call Control. I decided to try to find the original code for this game, recreate the MySQL database backend and schema, and adapt it for Facebook.