An educational RuneScape client–server prototype written in portable C99, featuring multiplayer support, persistent state management, and authentic protocol #225 compatibility.
The project includes both a custom game server and a cross-platform client. The game server is a clean-room implementation developed strictly for educational and research purposes, with no intent of monetary gain or commercial use. The cross-platform C client was independently reverse-engineered, refactored, and ported by Lesleyrs and contributors to the Client3 project: https://github.com/lesleyrs/Client3
This project uses the original game cache and assets without modification; all such assets remain the sole property of Jagex Ltd.
This project is not affiliated with, endorsed by, or sponsored by Jagex Ltd. "RuneScape®" and "Old School RuneScape®" are registered trademarks of Jagex Ltd.
Through extensive code documentation, this project studies:
- Network protocol implementation
- Client-server architecture
- Game loop design
- Binary serialization
- Cross-platform C development
- Non-blocking I/O patterns
- Memory management strategies
├── C-Server/ # Game server implementation
│ ├── src/ # Server source code
│ ├── data/ # Game assets/cache and player data
│ └── bin/ # Server binary output
├── C-Client/ # Multi-platform game client
│ ├── src/ # Client source code
│ └── rom/ # Client assets and cache
└── shared/ # Shared code between client/server
└── src/ # Common data structures and utilities
Multiplayer • Supports up to 2048 concurrent connections with synchronized player state
Persistence • Binary save/load system with CRC32 integrity checking
Movement • Delta-encoded pathfinding with walk/run mechanics
Security • ISAAC cipher for packet obfuscation
Protocol • Bit-packed viewport updates for efficient bandwidth usage
Cross-Platform • Windows (95+), Linux, macOS, FreeBSD, Web (WASM), and various game consoles
Rendering • SDL1/2/3 support with software rendering
Audio • MIDI playback with TinySoundFont
Portable • Runs on 32-bit systems with 64MB RAM (lowmem mode)
Coordinates • 14-bit X/Z (0-16383), 2-bit height (0-3)
Network • Big-endian TCP, non-blocking I/O
Tick Rate • 600ms game loop (~1.67 ticks/second), 1ms network poll
Memory • Minimal heap usage, efficient stack allocation
Platform • POSIX-compliant (Linux, macOS, FreeBSD, WSL), Windows via MinGW
Build (Linux/macOS/FreeBSD/WSL)
cd C-Server
./build_server.shOr with make:
make clean && make -j4Build (Windows)
mingw32-make clean && mingw32-make -j4Run
cd C-Server
./run_server.shOr directly:
cd C-Server
./bin/rs225Default port: 43594
Build
cd C-Client
./build_client.shRun
cd C-Client
./start_client.sh -u username -p passwordC-Server/ contains the following scripts:
build_server.sh- Build script with compiler optionsrun_server.sh- Launch server (builds if needed)
cd C-Server
./build_server.sh -h # Show build optionscd C-Server
make # Build server
make asm # Generate assembly/preprocessed files in temp/
make clean # Remove build artifacts and temp files
make clean-temp # Remove only temp files
make run # Build and runC-Client/ contains the following scripts:
build_client.sh- Build script with compiler and SDL optionsstart_client.sh- Launch client with connection parameters
cd C-Client
./build_client.sh -h # Show all build options
./start_client.sh -h # Show launch optionsThe client supports multiple compilers (gcc, clang, tcc, emcc) and SDL versions (1/2/3).
Type in chat:
::tele <x> <z> <height> - Teleport to coordinates
::perf - Show FPS and cache stats (client)
C-Server/
├── data/
│ ├── players/ # Player save files
│ ├── maps/ # Map region data
│ ├── archives/ # Game cache archives
│ └── songs/ # MIDI music files
└── bin/rs225 # Server executable
C-Client/
├── rom/
│ ├── cache/ # Client cache files
│ └── Roboto/ # Font files
├── client # Client executable
└── config.ini # Client configuration
- Single-threaded event loop with 600ms tick rate
- Non-blocking I/O for network operations
- Fixed player slots supporting up to MAX_PLAYERS (2048)
- Modular subsystems: world state, cache, items, NPCs, objects
- Fixed timestep game loop (20 ticks/second, 50ms per tick)
- ISAAC cipher for secure packet encryption
- BFS pathfinding for click-to-move
- Platform abstraction via SDL or native APIs
- SDL 1.2/2.x/3.x - Cross-platform multimedia
- TinySoundFont - MIDI playback
- LibTomMath - RSA encryption
- micro-bunzip - Compression
- ISAAC - Stream cipher
- ini - Configuration parser
- stb_image/stb_truetype - Image/font rendering
- Standard C99 library
- POSIX sockets (or WinSock on Windows)
The client supports an extensive range of platforms:
- Desktop: Windows 95-11, Linux, macOS, FreeBSD
- Web: WebAssembly (via Emscripten or wasmlite)
- Consoles: Wii, Dreamcast, Xbox, PSP, PS Vita, 3DS (via devkitPro)
- Embedded: Custom ports for various platforms
Connect the client to the server:
- Start the server (default port 43594):
cd C-Server && ./run_server.sh - Launch the client:
cd C-Client && ./start_client.sh -u username -p password - Optionally specify server IP/port:
cd C-Client && ./start_client.sh -u username -p password -i 127.0.0.1 -P 43594
The client can also be configured via config.ini file instead of command-line arguments.
