This page is kept for historical purposes only. Please see the home page for my current situation. —Luca Saiu.

DLL: TP 5 - guile-game has been released as free software: improve Pong

You can go on reverse-engineering Pong as I asked the last time and the time before that, if you want more time to try. Anyway I've seen that many people have had serious problems with the reverse-engineering thing, so I've provided an easier alternative. If you still do the following by re-implementing from scratch, please tell me.

I've also prepared the code for the final project, which consists in the Pong engine you already started working with, but with the complete source included and the license changed. Now you can see how the server, the monitor and (most importantly) the client are implemented.

You can download the software tarball from here. Please take the most recent version.

Notice that the tarball also includes client input and output logs.

When you work at the Institut Galilée labs, before starting, you have to execute the following line on every terminal you use:

source ~10706282/add-prefix ~10706282/usr

That is for using the software I have installed in my home directory on the machines at Institut Galilée; I don't have administrator privileges on the lab machines, so I have installed everything in my home directory.

Of course you don't need to do anything similar at home if you have installed everything correctly, because you are the administrator of your own machines.


Now you also know the legal part: you should always pay attention to copyright and license headers, and respect the licenses. I will keep this into account when deciding if you deserve a bounus for your final mark.

Please notice that you can call guile or guile-game with the --debug command line option, to get better error messages. For example if you are developing your modified client for the Task 1 (see below) and your client is in my-client.scm , you can run:

./server './guile-game blobs/client.scm' \
  './guile-game --debug my-client.scm' \
  './guile-game blobs/monitor.scm'

The command line above is for passing --debug to your modified client only.


Task -1: Subscribe to the mailing list

I've seen that many people didn't subscribe to the mailing list yet, so chances are that you didn't either; please do it now.
A student noticed that the page may ask you to accept certificates. Don't worry, the server is at LIPN, Université Paris 13; it's perfectly safe.

Please do subscribe: the list will be very useful for the final project.


Task 0a: legal questions

This is an excercise in preparation of the written exam; it's a little harder than the questions you would find there.

The author of guile-game has now released it to the public as free sotware, which of course implies that you have the complete source. Now you can see that all the important logic of Pong was implemented in Scheme, but the source code was mangled to make it intentionally hard to read (see src/client-proprietary.c after compiling). Anyway this new release also includes the original unmangled sources for the client, monitor and server, which you can read and use.

All the guile-game code is now released under the GNU GPL. Would the licenses allow me (I'm the author of guile-game including Pong, but not of Guile, SDL or SDL_ttf) to release the software without the unmangled source for client, server and monitor? Tell me if you know the answer.

Hints: what are the licenses of Guile, SDL, and SDL_ttf? What is source code according to the GNU GPL (read the text)?

Tell me if you already know the answer without searching on the web.


Task 0b: Understand the sources (or at least the source code for the client)

The client logic is in blobs/client.scm . Try understanding how it works.

Notice that you already have input and output logs this time; they aren't different from what you could have obtained last time, but now I've prepared them for you: see CLIENT-INPUT-LOG and CLIENT-OUTPUT-LOG .

Logs may be useful, but of course the source code should help you more.


Task 1: make the client more intelligent

Create another client by copying and modifying the client source code, and make it play against the original client. Yours should play better.

Hint: You should compute in advance where the ball will bounce when arriving at your side.

Hint: If the application is too slow, you can change the speed-related constants at the beginning of blobs/server.scm (and recompile if you're using the compiled server); the thing will speed up.

Hint: You can write to the standard error for debugging your client: search for current-error-port in the Guile manual.


Task 2: allow 4 players to play one against the other

Modify the server, the client and the monitor so that it allows four players to play one against the other. Two players should move horizontally and the other two should move vertically.


Task 3: allow any number of players (hard)

Modify the server, the client and the monitor so that it allows any number of players to play together.

Hint: Arrange players on the sides of a regular polygon with as many sides as the current number of players.



Notes for myself, in case of problems with the SERCAL installation or with student accounts:
The emergency machine has IP 194.254.173.145 .
My id is 10706282 .



Back to my home page...


Luca Saiu
Last modified: 2010-12-09


Copyright © 2010 Luca Saiu
Verbatim copying and redistribution of this entire page are permitted provided this notice is preserved.