← All projectsCOSC 50 / Systems

Nuggets

A multiplayer gold-collection game with a C server and terminal clients.

Browser adaptation of our team’s C game, with limited vision and gold stealing.

Watch the original C game
Recorded from the C server and terminal clients. The player explores and collects gold while the spectator sees the whole map. No audio.
A full ASCII map rendered from the local Nuggets server for a spectator.
Spectator view from a seeded local game: players A and B, gold piles (*), rooms, and connecting passages. View full size (new tab): A full ASCII map rendered from the local Nuggets server for a spectator.

A networked terminal game

Nuggets is a UDP client-server game for up to 26 players and one spectator. The server loads an ASCII map, distributes 250 gold nuggets across randomly chosen piles, assigns each player a letter, and sends each client its own display and gold updates. The ncurses client turns keystrokes into protocol messages and redraws the terminal view.

Map and visibility

The grid module loads the map into a 250 by 250 cell structure. Each cell stores terrain, player, gold, and visibility state. The display is assembled per client, so a player sees a discovered portion of the map while a spectator receives the full view. Gold and player locations change as the server processes movement.

Player-specific Nuggets map from a seeded local game.
The same game from test player Bo’s perspective after movement, cropped to the visible area. Rendered from the server’s DISPLAY message. View full size (new tab): Player-specific Nuggets map from a seeded local game.

Protocol and game loop

A new player sends PLAY with a name and receives OK, GRID, GOLD, and DISPLAY messages. The server accepts KEY messages for movement, updates the game state, then broadcasts new displays. It also supports SPECTATE, replaces the prior spectator when necessary, and sends a final summary when the game ends.

Working as a team

Our four-person team split the game into a server, client interface, grid representation, and visibility calculations. The implementation plan assigned me grid handling and gold placement, with line-of-sight work shared with Gustavo Lopez-Flemming. The common message format let those parts connect into a playable game.

Mithun RameshkumarDartmouth College