Turn-based game - experimental economics

Discussion in 'Python' started by Paolo Crosetto, Sep 5, 2009.

  1. Dear all,

    I am writing an application in Python for an experiment in Experimental
    Economics.

    For those who do not know what this is: experimental economics uses
    controlled, computerised lab experiments with real subjects, putting the
    subject in a game mimicking the situation of interest and collecting
    behavioural data about choices made.

    Hence, experiments involve the use of a multi-client architecture with one
    server, and are sort of online games, with actions taken by clients and
    computation, data collection, etc... handled by servers.

    I chose to use Python because I needed something flexible, powerful and easy -
    I am a beginner programmer.

    My game is a sort of scrabble, with palyers buying letters and producing words
    or extending existing words. I use a pipe to ispell -a for spellcheck, XMLRPC
    for the server-client infrastructure, and have developed all the rules of the
    game as server functions, called by a client. States of players and of words
    created are stored in instances of two basic classes, Player and Word, on the
    server side.

    The problem I now face is to organise turns. Players, as in Scrabble, will
    play in turns. So far I have developed the server and ONE client, and cannot
    get my head round to - nor find many examples of - how to simply develop a
    turn-based interaction.
    I basically need the server to freeze in writing all the clients while client
    i is playing, then when i is over passing the turn to i+1; clients are still
    accessible by the server at any time (the payoff of a player changes even as
    she is not playing, by royalties collected from other players extending her
    words).

    In another thread (about a battleship game) I found two possible leads to a
    solution:
    1. using 'select'.
    2. using threads.

    But in both cases I could not find any clear documentation on how to do this.
    The 'select' road was said to be the easiest, but I found no further hints.

    Does anyone have any hints?

    thanks!

    --
    Paolo Crosetto
    ---------------------------------------------------------------------
    PhD Student in Economics
    DEAS - Department of Economics - University of Milan
    ---------------------------------------------------------------------
     
    Paolo Crosetto, Sep 5, 2009
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Adriano Monteiro
    Replies:
    7
    Views:
    294
    Scott David Daniels
    Sep 24, 2005
  2. cwmtrader
    Replies:
    0
    Views:
    322
    cwmtrader
    Feb 8, 2008
  3. Replies:
    0
    Views:
    1,020
  4. Dr Nic
    Replies:
    0
    Views:
    93
    Dr Nic
    Sep 7, 2006
  5. Jonathan Hayward

    Experimental Python-based shell

    Jonathan Hayward, Oct 3, 2012, in forum: Python
    Replies:
    4
    Views:
    208
    Terry Reedy
    Oct 5, 2012
Loading...

Share This Page