$ show danielknobe/blobbyvolley2
Blobby Volley 2 is a complete, cross-platform 2D multiplayer volleyball game implemented in C++ with Lua scripting for AI bots and game rules. It features local and networked multiplayer (client-server via a bundled, modified RakNet stack), a dedicated server for online matchmaking, replay recording/playback, and a custom immediate-mode GUI built on SDL2. The architecture uses a state machine pattern (State base class with derived menu, game, and replay states), abstracted rendering backends (OpenGL, SDL, Null), and a custom physics engine with integrated Lua-driven rule logic. The project is built with CMake and targets Windows, Linux, macOS, Android, and Nintendo Switch, with GitHub Actions CI for multiple compilers and platforms. The game's core loop processes player input (keyboard, mouse, joystick, touch, or Lua script) through an InputManager, feeds it into DuelMatch (which combines GameLogic and PhysicWorld for physics and rules), and renders via RenderManager. Network games use RakNet for reliable UDP communication with prioritized packet handling; the dedicated server manages lobbies, matchmaking, and state broadcasting. Replays are recorded as binary state snapshots (using GenericIO serialization) and can be played back in-game. The Lua API provides bot developers with real-time game state queries, physics prediction functions, and callbacks for serve and bounce events, along with older legacy scripts in data/scripts/old. While the codebase demonstrates solid engineering (template-based serialization, abstracted file I/O with PhysFS, cross-platform build systems), it carries technical debt from aging dependencies (RakNet, Lua 5.3, SDL2, TinyXML2) and heavy use of platform-specific ifdefs. Some components, like the custom IMGUI and RakNet integration, are tightly coupled and not easily extractable, but the GenericIO serialization layer and FileSystem wrapper are self-contained and could be reused in other C++ projects needing binary I/O or virtual file system access.
The LLM identified 2 files worth highlighting for reuse:
GenericIO provides a template-based abstraction layer for reading and writing binary data to files (FileRead/FileWrite) and to RakNet BitStreams. It uses type traits (GenericIODetail.h) to automatically serialize fundamental types, enums, strings, and tuples with endianness control. This component is self-contained, requires only standard C++ and the base IO classes, and could be extracted into any C++ project needing portable binary serialization with support for multiple output sinks.
FileSystem wraps the PhysFS library to provide a portable virtual file system with mount/search capabilities, abstracting OS-specific path differences. It offers singleton access for reading/writing game data assets and user config files, with support for search paths and directory enumeration. This is a clean, self-contained module that could be reused in any C++ project needing a thin abstraction over PhysFS for cross-platform file I/O.