The internet Zurich Water Game ZWG3
Distributed multi-user models Participants can be anywhere, provided that they have internet access E.g. in their office No duration restrictions Can be involved while doing their ordinary work Can implement private negotiations easily But Less motivation without face-to-face interaction Technical difficulties less easy to solve Requires internet access
Implementation options Client-side Needs to run on many differently configured PCs Java, Javascript OR Server side All software runs on a central server Server generates HTML pages dynamically Client only needs a web browser
Server side implementation Apache web server Standard web server PHP Scripting language All normal programming constructs Basic object orientated features Good interfaces to other software and libraries Relational database PostgreSQL MySQL TCP/IP or other inter-process communication to other models All this is open source, free and available under the GNU licence
Examples Gone Fishing! Zurich Water Game 3 Test the technology Competitive game Simple rules Extensible (robot fishers!) http://www.soc.surrey.ac.uk/~scs1ng/GoneFishing/ Zurich Water Game 3 http://www.soc.surrey.ac.uk/~scs1ng/zwg
The server Program Apache Web PHP Server module HTML Data read/write Page request HTML Data read/write Web page PostgreSQL database
Sample PHP <?php function show_scale($val) { /* display a bar to show value of $val */ $val=round($val); if ($val > 10) $val = 10; if ($val < 0 ) $val = 0; $colour = ($val >= 5 ? 'grn' : 'red'); echo "<td><img SRC=\"images/bar-$colour-$val.jpg\" ALT=\"Value=$val\" width=104 height=14></td>\n"; } ?>
Interface between PHP and database $n_msgs = 3; /* get the last 3 public messages */ $query = new query("SELECT id, sender, recipient, to_char(timesent, 'HH24:MI on DD Mon') as senttime, timeread, msg FROM msgs WHERE (recipient = 'All') ORDER BY timesent DESC LIMIT $n_msgs"); display_msgs($query); ?>