Nuggets

Nuggets is a multi-player exploration game inspired by Rogue in which a game server maintains all game state, and one or more game clients display the game to a user. The object of the game is to collect more gold nuggets than any other player. The game ends when all gold nuggets have been collected by some player. This was the final project for CS50.

Spectator view of the game

*I cannot share source code on this site because future students may copy it. Go to my private github organization for source code*

Implementation Notes

The game was implemented in C, and uses the ncurses library in order to provide the text display (see https://github.com/srb-private-org/nuggets-game). Designed and implemented in a team with John Donofrio, Brendan Berkman, and Carter Sullivan. We collaborated with regular meetings, writing the design and implementation specifications, and dividing up work equally. I focused primarily on the client module which implements client-side interaction with the server at real time due to keyboard input.

Server

Command line usage

Client

Command line usage

The server and client communicate over a UDP network protocol. The network protocol connects zero or more clients with one server. The server maintains all game state; the clients displays the game state to a user and sends their keystrokes to the server; the server sends back updated display. Each UDP datagram carries a singular message (ASCII string) between client and server. The server can receive PLAY, SPECTATE, and KEY messages. The client can receive OK, GRID, GOLD, DISPLAY, QUIT, and ERROR messages.

What Did I Learn?

  • How to work in a software development team in a fast-paced environment
  • How to code a large project in a low level programming language (C)
  • Github skills for a multi-person organization
  • Network protocols
  • How to read manual pages (for ncurses)