Turn-based game - experimental economics

P

Paolo Crosetto

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!
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top