Weekly Game: Client-Server

The goal this week a technical, but rather non-constraining one: build a new multi-player game around a client-server architecture.

In a client-server architecture, one program (the server) is responsible for maintaining and updating an authoritative game state, while several other programs (the clients) display this game state to players and relay their actions to the server.

One of the points of this game is to get you familiar with the "bare metal" of sockets programming. So I'd like you to use a programming language where you are able to interact with real TCP or UDP sockets.

It's fine to use a library to get away from the tedium of opening and polling sockets. (In fact, I reccommend using libev for the latter task -- it makes building servers quite a bit easier. I'll be installing a copy in the course directory.)

You can build a real-time or turn-based (or hybrid -- e.g. "simultaneous turns" in multiplayer Civilization) game. Real-time games will be harder -- lag creates big playability issues -- but you may want the challange.


I've installed libev in the course directory. To use it, you'll need to add -I/afs/ to the command line when compiling source files and -L/afs/ -ev to the command line when linking. An example Jamfile:

TOP = . ;
SubDir TOP ;

C++ = g++ -Wall -Werror -O2 -I.  ;
CC = gcc -Wall -Werror -O2 -I. ;
LINK = g++ ;

Objects $(NAMES) ;
ObjectC++Flags $(NAMES) : -I/afs/ ;
MainFromObjects mazeserver : $(NAMES:S=$(SUFOBJ)) ;
LINKLIBS on mazeserver += -L/afs/ -lev ;

You'll also need to make sure is in your LD_LIBRARY_PATH when running your server. Doesn't work:

$ ./mazeserver maze
./mazeserver: error while loading shared libraries: cannot open shar
ed object file: No such file or directory


$ LD_LIBRARY_PATH=/afs/ ./mazeserver maze


Please see the page on weekly games for information about how to write an artist's statement and where to turn in your completed game, as well as the standard grading scale.

Those who include an ascii drawing in their artist's statement will recieve a small reward.