How pyrite-dev/nishbox works
Project type and purpose
• This is “NishBox,” a multiplayer sandbox game written in C. It follows a classic client-server architecture, powered by a shared game engine and asset pipeline.
• The README confirms it’s a networked game with nightly builds via Jenkins and uses Premake5 as its build generator.
File structure
• Top-level directories
• data/ → all runtime assets (fonts, textures, music, scripts, sound)
• engine/ → shared engine code (graphics, input, audio, scripting)
• src/client/ → client entry point and UI code (main.c)
• src/server/ → server entry point and authoritative game logic (main.c)
• tool/ → shell scripts for cleaning, formatting, packaging, tooling (format.sh, pack.sh, etc.)
• Build scripts
• premake5.lua → defines project targets
• Jenkinsfile → CI pipeline
• BUILDING.md → build instructions
• Configs and assets
• data/scripts/*.lua → Lua scripts loaded at runtime by the engine
• data/font, data/music, data/sound, data/texture → various asset subdirectories
README for additional insights
• Multiplayer sandbox game
• Stack: Premake5 for project generation
• Jenkins for nightly build
a. Main components
1. Game Client
– Loads assets (textures, fonts, audio, Lua scripts)
– Renders graphics, handles user input
– Network module to communicate with server
2. Game Server
– Headless engine instance handling world state
– Runs authoritative game logic via Lua scripts
– Broadcasts state updates to clients
3. Shared Engine Module
– Core sub-systems (rendering, audio, input, scripting)
– Exposed to both client and server
4. Asset Repository
– data/ folder with fonts, textures, audio, scripts, configs
5. Build & Dev Tools
– Premake5 → generates build files for makefiles/Visual Studio
– tool/*.sh scripts → automate cleaning, formatting, packaging
6. CI Pipeline (Jenkins)
– Triggers on commits
– Runs build, tests, packaging → produces nightly binaries
b. Relationships and interactions
c. Architectural patterns/design principles
– Client-Server separation of concerns
– Shared library approach for the engine (code reuse)
– Scripting extensibility via Lua (data-driven design)
– Modular asset pipeline (fonts, textures, sound, music, scripts)
d. Key technologies/frameworks
– C language core
– Lua scripting
– Premake5 for project generation
– Shell scripts for tooling
– Jenkins for CI
Elements
• from Client ↔ Server (network flow)
• from both Client/Server → Assets (I/O)
• from Build Tools → Engine/Client/Server (compilation)
• from Jenkins → Build Tools (CI trigger)
• Build/dev components (Premake, tool scripts, Jenkins) in another
• External dependencies (Lua) in a third