contrib/tinks: intro 3D client
[nit.git] / contrib / tinks / README.md
1 Tinks! a multiplayer crossplatform action game with destructible procedurally generated worlds
2
3 # Project description
4
5 Each player controls a tank, opens fire from the turret and navigates between the terrain features.
6 Explosions from turret fire and tank destruction have different forces and destroy the terrain.
7 Each tank needs 4 hits to be destroyed.
8 Destroyed tanks drop health powerups which can repair other tanks.
9
10 The game is optimized for the multiplayer mode but one can play alone to practice.
11 Upon launch, a client searches for server by broadcasting a UDP socket.
12 A server may respond with its TCP connection port.
13 If there is no answer, the client starts its own server which will accept other clients.
14
15 The game logic is mostly event based.
16 Only the events are passed to the clients at each frame, by serializing them to binary.
17 So both the clients and the server keep the game knowledge.
18
19 The world is different in each game, it is procedurally generated with an "unlimited" size.
20 Each world feature is discovered only as needed by either the server or the clients.
21 The server discovers the features affected by possible collisions and by explosions.
22 The clients discover the features visible on screen.
23 The clients and servers share the seed for the noise generator, so they discover the same features.
24 Only the destroyed features and new powerups are passed to the clients by the server as events.
25
26 # Modifications
27
28 This game was developed quickly while aiming to keep it simple.
29 It should be easy to add features as refinements on both the client and the server.
30
31 # Clients and server
32
33 Tinks! has two distinct clients and one dedicated server.
34 The whole project is modular, these software share mostly the same code.
35
36 * The original 2D client at `bin/tinks` uses mnit and OpenGL ES 1.0 to display the world from above.
37
38   The Android variant at `bin/tinks.apk` uses the same view from above, with added on-screen controls.
39
40   ![Screenshot of the 2D client](doc/tinks.png)
41
42 * The 3D client at `bin/tinks3d` uses gamnit and OpenGL ES 2.0 for an immersive world.
43
44   Despite the different graphics, both client are fully compatible for multiplayer.
45
46   ![Screenshot of the 3D client](doc/tinks3d.png)
47
48 * The dedicated server at `bin/server` acts as a headless server for clients on the same local network.
49
50 # Usage
51
52 Compile with: `make`
53
54 Launch with: `bin/tinks` or `bin/tinks3d`
55
56 Compile for Android with: `make bin/tinks.apk`
57
58 Launch a server with: `bin/server [server_port]`
59
60 Connect to a precise server with: `bin/tinks server_address [server_port]`
61
62 # Configuration on desktop for the 2D client
63
64 You can configure the client by modifying the file `./config.json` created when you first launch the game.
65 The fields `res_x` and `res_y` specify the resolution of the window.
66 The field `play_sounds` should be clear enough.
67
68 # Artwork
69
70 * Trees and rocks models created by Kenney.nl, shared under CC0
71 * Ground texture created by Duion, shared under CC0
72 * Health model created by Alexis Laferrière, shared under CC0
73 * Tank original model created by Sapen, shared under CC-BY-SA 3.0
74         * Derivatives from this model were created by Alexis Laferrière, shared under CC-BY-SA 3.0