tinks
Tinks! a multiplayer crossplatform action game with destructible procedurally generated worlds
Project description
Each player controls a tank, opens fire from the turret and navigates between the terrain features. Explosions from turret fire and tank destruction have different forces and destroy the terrain. Each tank needs 4 hits to be destroyed. Destroyed tanks drop health powerups which can repair other tanks.
The game is optimized for the multiplayer mode but one can play alone to practice. Upon launch, a client searches for server by broadcasting a UDP socket. A server may respond with its TCP connection port. If there is no answer, the client starts its own server which will accept other clients.
The game logic is mostly event based. Only the events are passed to the clients at each frame, by serializing them to binary. So both the clients and the server keep the game knowledge.
The world is different in each game, it is procedurally generated with an "unlimited" size. Each world feature is discovered only as needed by either the server or the clients. The server discovers the features affected by possible collisions and by explosions. The clients discover the features visible on screen. The clients and servers share the seed for the noise generator, so they discover the same features. Only the destroyed features and new powerups are passed to the clients by the server as events.
Modifications
This game was developed quickly while aiming to keep it simple. It should be easy to add features as refinements on both the client and the server.
Usage
Compile with: make
Launch with: bin/tinks
Compile for Android with: make bin/tinks.apk
Launch a server with: bin/server [server_port]
Connect to a precise server with: bin/tinks server_address [server_port]
Configuration on desktop
You can configure the client by modifying the file ./config.json
created when you first launch the game.
The fields res_x
and res_y
specify the resolution of the window.
The field play_sounds
should be clear enough.
Content
- tinks: Tinks! a multiplayer crossplatform action game with destructible procedurally generated worlds (contrib/tinks)
- assets (contrib/tinks/assets)
- src (contrib/tinks/src)
- client (contrib/tinks/src/client)
- android_client: Android client with a joystick (contrib/tinks/src/client/android_client.nit)
- assets: Client
Assets
and client-only services on game elements (contrib/tinks/src/client/assets.nit) - client: Portable client (contrib/tinks/src/client/client.nit)
- client_serialize: This file is generated by nitserial (contrib/tinks/src/client/client_serialize.nit)
- context: Provides context to abstract the exchanges with a local game or a remote game (contrib/tinks/src/client/context.nit)
- controls: On-screen alternative controls (contrib/tinks/src/client/controls.nit)
- drawing (contrib/tinks/src/client/drawing.nit)
- linux_client: GNU/Linux client with config saved to
config.json
(contrib/tinks/src/client/linux_client.nit)
- common: Services common to the client and server (contrib/tinks/src/common.nit)
- game (contrib/tinks/src/game)
- framework: Structure of a client/server game, based on turns, events, orders and rules (contrib/tinks/src/game/framework.nit)
- game (contrib/tinks/src/game/game.nit)
- players: Player related and tank spawning logic (contrib/tinks/src/game/players.nit)
- powerups: Support for pickable powerups (only health for now) (contrib/tinks/src/game/powerups.nit)
- tanks: Tank and tank turret related logic (contrib/tinks/src/game/tanks.nit)
- world: Physical world logic (contrib/tinks/src/game/world.nit)
- server (contrib/tinks/src/server)
- dedicated: Dedicated server program (contrib/tinks/src/server/dedicated.nit)
- server: Server to host multiplayer games (contrib/tinks/src/server/server.nit)
- server_serialize: This file is generated by nitserial (contrib/tinks/src/server/server_serialize.nit)
- client (contrib/tinks/src/client)