cardstories part 1: draft implementation

The farsides studio published specifications for a card game named cardstories. A development environment was installed and a draft implementation of the gameplay completed.

Xavier Antoviaque and David Blanchard wrote the specifications for a game of cards where the player needs to find out a card using a sentence made up by another player. tartarugafeliz created interface designs to illustrate the user interaction as well as a deck of 36 cards. Pranjal Srivastava is working on a PHP code base to implement the specifications.

development environment

A new code base was started using Twisted/Python and JQuery. It was adapted from the wspool code base because it has a similar infrastructure. The user interface part would be JavaScript only, using a JSON based REST webservice.
In order for this web application to be friendly to social networks integration, two traps must be avoided:

  • not rely on cookies at all because cookies do not exist in this social network world
  • make sure the JavaScript is insensitive to being run in an iframe

The farsides hosting infrastructure was used to create a Debian GNU/Linux squeeze virtual machine dedicated to the development of the new code base. Backups are made daily after significant modification, on disks located at lawomatic.

game logic

The game logic has been implemented and tested. It was discussed in the morning with Xavier Antoviaque and described as follows (copied from the source file):

#
# A user is identified by a number (in the 20 to 30 range below).
# The creator of the game choses one card out of 36 and sends the
# action=create&owner_id=25&card=1&sentence=wtf
# message which returns the newly created game identifier
# {'game_id': 101}
# The newly created game is in the 'invitation' state and
# up to five players can join by sending the
# action=participate&player_id=26&game_id=101
# message which returns
# {}
# on success or
# {'error': 'error message'}
# if it fails. The player then asks to see the cards it was dealt
# by sending the
# action=player2game&player_id=26&game_id=101
# message which returns
# {'cards': [12, 8, 2, 5, 6, 10, 15], 'picked': None }
# The player then picks the card that is closer to the sentence (wtf)
# by sending a
# action=pick&player_id=26&game_id=101&card=10
# message. The player can send the message more than once to change the
# value of the picked card.
# The game owner decides to move to the voting phase by sending the
# action=voting&owner_id=25&game_id=101
# message. The game is now in the 'vote' state and each player who
# chose to participate can vote for one of the cards picked by the
# owner or the other players by sending the message
# action=vote&player_id=26&game_id=101&vote=2
# where vote is the index of the chosen card in the range [0-6].
# The player can send the message more than once to change the
# vote.
# The game owner decides to move to the voting phase by sending the
# action=complete&owner_id=25&game_id=101
# message. The game is now in the 'complete' state and the winners
# are calculated as follows:
#     * The owner wins if at least one of the players guesses right,
#       but not all of them do. Then the winners are the owner and the
#       players who guessed right.
#     * If the owner loses, all the other players win.
#

licensing

The license chosen for the code is the GNU AFFERO GENERAL PUBLIC LICENSE and the license for the artwork is the Attribution-ShareAlike 3.0

This entry was posted in cardstories. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>