Project Description #
Nuggets is a text-based multiplayer exploration game developed as a final project for COSC 50 in the C programming language. The game follows a client-server architecture where players navigate a grid-based map, collecting gold nuggets while competing against other players. The system is composed of several core modules:
- Server Module: Manages the main game loop, interprets messages from clients, modifies game state based on player input, and broadcasts updated game information (gold counts, display strings) back to all connected clients.
- Client Module: Handles communication with the server, renders the player’s visible portion of the map, displays status information (player letter, gold held, gold remaining, gold just collected), and prompts users to resize their terminal window if the map doesn’t fit. It also supports a spectator mode that shows the full map along with server details and remaining gold.
- Map Module: Represents the game world as a 2D grid of tiles, encapsulating grid dimensions, metadata for map operations, visibility algorithm methods, and player movement logic.
- Player Module: Stores each player’s state, including gold count, assigned letter, full name, client address, a personal visibility map, map dimensions, and activity state (playing or quit).
- Visibility Algorithm: Determines what each player can see at any given moment through two main processes: updating the player’s visibility map (distinguishing between permanent boundary tiles, semi-dynamic room/passage tiles, and dynamic elements like gold and other players) and generating a string representation of the player’s current view of the map.
The game concludes by displaying a leaderboard showing final results for all players.
My Role #
As part of a four-person team, I took on a multifaceted role that spanned testing, documentation, and general development support. Specifically, I was responsible for writing comprehensive tests for the Player, Map, and Coordinate modules, ensuring the reliability and correctness of these core components throughout the development process. I also contributed to project documentation, helping to clearly articulate our design decisions and module interfaces. This role gave me broad exposure to the entire codebase and strengthened my skills in software testing, team collaboration, and systems-level thinking in a networked application context.
Code #
Available upon request, as this was a course assignment.