A multiplayer terminal game built on a UDP client/server architecture. Up to 10 players share a live 60x20 ASCII grid, moving their characters in real time while the server broadcasts world state to all connected clients.
_ ____ ____ ___ ___
/ \ / ___| / ___|_ _|_ _|
/ _ \ \___ \| | | | | |
/ ___ \ ___) || |___ | | | |
/_/ \_\____/ \____|___|___|
_
| | ___ ___ __ _ _ _ _ __ _ _ ___
| |/ _ \/ __|/ _` | | | | '__| | | / __|
| | (_) \__ \ (_| | |_| | | | |_| \__ \
|_|\___/|___/\__,_|\__,_|_| \__,_|___/
- UDP-based networking — lightweight, low-latency communication
- Up to 10 simultaneous players, each with a unique symbol (
@,=,$, …) - Wrapping movement across the grid (walk off one edge, appear on the other)
- Supports WASD, vim (
hjkl), and arrow-key movement - ncurses rendering with ~30 FPS refresh rate
- Verbose logging mode for debugging (
-v) - Graceful shutdown on
Ctrl+Corq
| Dependency | Notes |
|---|---|
| GCC | C99 or later |
| ncurses | libncurses-dev on Debian/Ubuntu |
| POSIX make | GNU Make works fine |
makeThis produces two executables: ASCIIlosaurus_server and ASCIIlosaurus_client.
To clean build artifacts:
make clean./ASCIIlosaurus_server [-P port] [-v] [-h]
-P <port> Port to listen on (default: 10011)
-v Verbose logging to stderr
-h Print help and exit
Server console commands (type and press Enter while the server is running):
| Key | Action |
|---|---|
q |
Quit the server |
h |
Show help |
k |
List client movement keys |
l |
List connected clients |
./ASCIIlosaurus_client [-H host] [-P port] [-v] [-h]
-H <host> Server IP address (default: 131.252.208.23)
-P <port> Server port (default: 10011)
-v Verbose logging to stderr
-h Print help and exit
| Key(s) | Direction |
|---|---|
w / k / ↑ |
Up |
s / j / ↓ |
Down |
a / h / ← |
Left |
d / l / → |
Right |
q |
Quit |
# Terminal 1 — start the server
./ASCIIlosaurus_server -v
# Terminal 2 — connect a client (loopback)
./ASCIIlosaurus_client -H 127.0.0.1Open additional terminals and run more clients to play with others.
ASCIIlosaurus/
├── ASCIIlosaurus_server.c # UDP server — manages world state & player positions
├── ASCIIlosaurus_client.c # UDP client — sends input, receives & renders state
├── ASCIIlosaurus_world.c # ncurses UI helpers (draw_world, get_input, …)
├── ASCIIlosaurus_world.h # Shared protocol types (player_t, world_state_t)
└── Makefile
All communication uses UDP datagrams on a single port.
- Client → Server: a single
int(network byte order) carrying the pressed key code. - Server → Client: a
world_state_tstruct (network byte order) containing the full grid state and each player's position, symbol, and active flag.
The server serializes coordinates with htonl before sending and the client deserializes with ntohl on receipt, making the protocol endian-safe.
MIT — see LICENSE.