CPSC 329 Software Development Fall 2026

CPSC 329 Project P3 — Networked Hedgehogs

In this group project, teams of three or four will add network play to the Hedgehogs game along with the hint feature originally slated for project P2.


Logistics and Due Dates


Specifications

Network Play

Hints

(required for the team of four; extra credit for the team of three)

(extra credit for all teams; requires the hint generator)

UI Design Requirements

The parts of the UI that this project adds or changes are held to the same design principles as in P2: appropriate controls, visual hierarchy and grouping, feedback and visible state, preventing and explaining errors, and consistency. Feedback and visible state matter particularly here, since there is often something going on that the player is waiting for: the player should always be able to tell what the program is waiting for (other players to join, an opponent's move, the server's answer to their own move, a hint) and why a control isn't available.

Design and Code Organization

Protocol

The client and the server communicate with a line-based text protocol: each message is one line, made up of words separated by spaces, with the first word saying what kind of message it is. Part of the protocol is given below; your team designs the rest. Record the whole protocol in docs/protocol.txt.

Given: joining and session messages. Client to server:

MessageMeaning
JOIN name players rules join a game; name is one word; rules is a word from your protocol's list of rule names
QUITleave

Server to client:

MessageMeaning
HELLO hedgehogs/1 sent on connecting: the server speaks first
WELCOME name joined; waiting for a game
WAITING have need the number of players waiting for this game and the number needed; sent after WELCOME and whenever it changes
START players rules seat name1 name2 ... the game is starting: the settings used, which seat (position in the turn order) is yours, and the players' names in turn order
GAME_OVER name the game is over and name won; the server then closes the connection
ENDED reason the game ended early (for example, a player left); the server then closes the connection
ERROR reason your message was refused; nothing changed

After HELLO, the client may send JOIN or QUIT. After WELCOME, the player is waiting and may only QUIT. After START, the game is in progress and the move messages apply. After GAME_OVER or ENDED, the server closes the connection. A message that isn't allowed in the current state gets an ERROR. A client always takes the game's settings from START, not from what it asked for in JOIN.


Provided Code

Testing Tools

The tools are available in /classes/cs329/hedgehogs/tools.

These let you test the server and the client separately, before the other side is working. Import them into a separate package, tools. They are for testing only and don't use any of your other code.

Hint Generator

(team of four; team of three if doing the extra credit)

The hint generator code is available in /classes/cs329/hedgehogs/hint. Import the classes into your project, making sure they end up in the hint package within your project's src folder.

Each class's comments have the details; in brief:

How the generator works. For each possible turn, the generator plays many games to the end from the resulting position, making random moves for every player. It then suggests the turn that won most often for the current player. This is called Monte Carlo evaluation. More simulated games give a more accurate estimate, so time trades directly for quality. Assuming that everyone plays randomly for the rest of the game may sound hopelessly naive, but in games driven largely by chance, such as a dice race like Hedgehogs in a Hurry, this technique does surprisingly well. Its weakness is strategy — simulating many games means it plays much better than random, but it won't match a player who deliberately uses their moves to hinder opponents' hedgehogs and advance their own.


Tasks

Do these tasks in order. The work is a single milestone: setup and kickoff, design and planning, build, wrapup.

Compared to P2, there's less step-by-step direction: each task below has a short description, what "done" means, and notes on things that are easy to get wrong. The rest is up to you.

T0: Setup and Kickoff

This is a team task.

T1: Design and Planning

This is a team swarming task. Finish it before starting work on the skeleton.

Task list. Tasks marked [T] involve a thread and tasks marked [N] involve a socket.

The dependency diagram shows an overview of the "requires" relationships: arrows point to the tasks a task requires, and dashed boxes are team of four only (extra credit for a team of three).

Ownership.

Reviews. See Pull Request Reviews for how to do a review.

T2: Build

This is a team task. Follow the Team Process throughout; each issue is done on its own branch and merged through a pull request.

Task details and notes:

T3: Wrapup

This is a team task.

Each person also does the individual project wrapup (the reflection and peer evaluation).

Project Wrapup

This is an individual task.

Points to address in the reflection:

Be honest and thoughtful — whether you found something useful or not won't affect your grade. What matters is what the experience taught you about software development.


Requirements

These are the end results your work is assessed against (see Assessment). Team code is assessed according to ownership.

Program Requirements

Extra credit (team of three): server shutdown and hints. Extra credit (all teams): network play for variants with a different kind of player action (such as Fizzy Lifting), playing another game with the same players, and a computer player (and extensions of it), with any protocol changes described in docs/protocol.txt.

Code Requirements

Process Requirements

Follow the steps in each task and the practices in the Process section.


Process

Team Process

The team process is generally the same as in P2, with changes noted below.

Pull Request Reviews

Reviews work as in P1 (see P1 Pull Request Reviews for the steps on GitHub and in Eclipse), with two kinds of review in this project (see Reviews in T1 for which pull requests are reviewed):

Besides the usual categories (correctness, standards, tests, readability), check the threads in a designated review: Which threads run each part of the code? Is everything that more than one thread uses protected? On the client, does everything that changes the model or the GUI happen on the JavaFX application thread?


Deliverables and Handin

Deliverables

Your final code is only part of what is assessed. Each item below is created at the point given in the task steps, and together they record your process as well as the end result. Commit history and handin tags provide the timestamps.

On Canvas:

In the team repository:

Hardcopy:

Handin

Most of the handin happens along the way, through the tags listed in Deliverables. To finish:


Assessment

The course projects together account for 50% of your final grade in this course. There are two distinct components to the project grade:

In addition, teamwork is part of the course engagement grade. Teamwork conduct is assessed through a structured peer evaluation at the end of the project (see Project Wrapup) with your team log and GitHub activity as supporting evidence.