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.
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.
I've seen that many people didn't subscribe to the mailing list yet,
so chances are that you didn't either;
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.
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.
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.
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.
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.
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.
Back to my home page...