Free Tennis

How to play

This is a tennis simulation, not an arcade. You play with the mouse and five keys. Five keys may seem overwhelming, but you can play very well with no keys at all! The keys are meant for experts (e.g. to change the shot height, to sprint, to dive, to do backspin), and can be learned to use gradually. The five keys are X, Z, D (on the keyboard) plus the two mouse buttons.

The meaning of mouse movements and buttons depends on the "game phase". We can identify three game phases:

  1. service phase: your player is serving;
  2. feet movement phase: in this phase the mouse controls the feet of your player;
  3. aiming phase: in this phase you use the mouse to aim (i.e. decide where the ball will fall), while the feet of your player are controlled by the A.I. You can tell you are in aiming phase because you see the shot parabola (see screenshots).

The meaning of controls is the following:

During the service phase

The meaning of the mouse movement is the following:

The meaning of the four keys is the following:

During the feet movement phase

During the aiming phase

Other keys that work during game

Note: as soon as the game starts, you need to press either "F" or "G"
to activate mouse input. See below.

The players

Currently, you can choose among 3 players: Pete, Mats and Ivan. The following descriptions are only valid if you enable the "-realistic" flag (see below).

Command line options

The game must be started by command line. The minimal command line is
./freetennis -newbie
which will start a human-vs-computer match, on cement, with players equal to Ivan and Ivan.

Choosing the players

You choose the player with the -p0 and -p1 command line options. For example:
 ./freetennis -p0 ivan -p1 pete

The default is "ivan". Case does not matter.

These options are ignored when the "-client" option is used.

Choosing the court surface

You can choose among three surfaces: Clay, Grass and Cement. [insert descriptions here].

You specify the court surface with the option -surf. Example:

./freetennis -surf cement

The default is "cement".

This option is ignored when the "-client" option is used.

Playing human vs computer

This is the default. You don't need to pass any special option to start a human-vs-computer match. Only, remember that player 0 is the human, player 1 is the computer.

For example, if you want to play with Ivan against Pete, type

./freetennis -p0 ivan -p1 pete

and the computer will impersonate Pete, whereas you will impersonate Ivan.

Playing human vs human

In order to play human vs human, you need two PCs connected via a network (either LAN or Internet). One of the PC must act as a server, the other as a client. 

The server must be started this way:

./freetennis -server -port yyyy

where yyyy is a free TCP port in your network (e.g. 8080). The port must be chosen according to which ports your firewall makes available.

The client must be started this way:

  ./freetennis -client xx.xx.xx.xx  -port yyyy

where xx.xx.xx.xx is the IP address of the server (e.g. 192.168.1.33), and yyyy is the same port specified by the server.

The option "-port" can be omitted, in which case a default port of 4000 is used.  You may have to configure your firewall to open that port. The client does not have this problem.

In human-vs-human mode, the players and surface are decided by the server. The -surf and -pXname options are ignored by the client.

Example: in order to start a match Ivan vs. Pete, on the grass, you should type

./freetennis -p0 ivan -p1 pete -surf grass -server -port yyyy

on the server, and

./freetennis -client -port yyyy

on the client.

Making the game realistic

In this section we'll talk about the "-realistic" and "-newbie" flags. These flags are mutually exclusive, and you must specify one of them (there is no default). Their meaning is the following.

In real tennis, these 3 rules hold:

  1. players who are powerful are usually not precise, and viceversa;
  2. some players are more skilled at net, others at groundstrokes;
  3. fast shots are more difficult to respond to.

So, for the game to be realistic, those rules must somehow hold; that is, aiming must be more difficult if the opponent's shot is fast, if you are not very good at that shot, or if you are very powerful.

This happens when you choose the -realistic flag.  If you use it, the parabola becomes more or less visible, according to the situation, so as to satisfy the 3 rules.

The -realistic flag makes the game much more amusing, but also more difficult for newbies (it is more difficult to aim). So it should be avoided when learning (in which case you should use the -newbie flag).

Note: without the -realistic flag, some players are much more convenient to use than others. With -realistic, each player has its own strength and weakness, and the game is more fair.

Choosing the difficulty level

This only makes sense if you are playing human vs computer. The option to use in this case is -computerskill. Example:

./freetennis -computerskill 200

The number must be between 0 and 250. 0 is very difficult, 250 is very easy.

Choosing the resolution

Use the options -xres and -yres. Example:

./freetennis -xres 400 -yres 300

Miscellaneous examples

./freetennis -realistic
./freetennis -p0 pete -realistic
./freetennis -p0 mats -p1 ivan -newbie
./freetennis -surf cement -computerskill 200 -realistic
./freetennis -client 192.168.1.33 -xres 400 -yres 300 -realistic
./freetennis -server -p0 ivan -p1 ivan -surf clay -realistic -nosound

Miscellanea