Terminal-based multiplayer games over LAN. Written in C.
Bytes is a multiplayer game platform that runs entirely in the terminal. Players can host, join, or spectate games over a local network using nothing but a compiled binary and a terminal emulator.
The first game is Pong. The architecture supports adding more.
make
./bin/bytesOne player hosts, the other joins with the host's IP. That's it.
sudo apt install build-essential libncursesw5-dev # Debian/Ubuntu
makexcode-select --install # if needed
brew install ncurses # if needed
makesudo apt install gcc-mingw-w64-x86-64
git clone --depth 1 https://github.com/wmcbrine/PDCurses.git deps/PDCurses
cd deps/PDCurses/wincon && make CC=x86_64-w64-mingw32-gcc AR=x86_64-w64-mingw32-ar WIDE=Y && cd ../../..
make windowsProduces bin/bytes.exe -- a statically linked Windows binary with no runtime dependencies.
Install MSYS2, then from a UCRT64 shell:
pacman -S mingw-w64-ucrt-x86_64-gcc mingw-w64-ucrt-x86_64-pdcurses make
make./bin/bytes # default port 7500
./bin/bytes --port 8080 # custom port
./bin/bytes --solo # single player vs CPU
./bin/bytes --test-keys # input diagnostics
Host a game, join by IP, or spectate an ongoing match. Navigate menus with arrow keys, confirm with Enter.
- LAN multiplayer over TCP
- Host, join, or spectate
- Solo play vs CPU
- 30 Hz server-authoritative game loop
- Automatic pause & reconnect on disconnect (30s window)
- Persistent local win/loss stats (
~/.bytes_stats) - Cross-platform: Linux, macOS, Windows
- Unicode box-drawing UI
src/
├── main.c Entry point, menu loop, host/join/watch flows
├── game.c Game registry, session lifecycle
├── pong.c Pong implementation
├── network.c TCP server/client with length-prefix framing
├── protocol.c Message pack/unpack (little-endian wire format)
├── ui.c ncurses menus, overlays, screens
├── stats.c Persistent win/loss tracking
└── platform.c OS abstraction (sockets, time, paths)
Games implement a simple vtable (game_def_t) -- init, input, update, render, serialize, deserialize, win check. The engine handles networking, protocol, and session management.
- Create
include/<game>.handsrc/<game>.c - Implement the
game_def_tfunction pointers - Add an enum value to
game_type_tincommon.h - Register in
game_registry[]ingame.c
No changes needed to networking or protocol code.
MIT