CPSC 329 Software Development Fall 2026

CPSC 329 Project P2 — Hedgehogs GUI

In this (mostly) group project, you and a partner will extend the Hedgehogs in a Hurry game from project P1 with a JavaFX GUI. This project has three parts:


Logistics and Due Dates

Schedule. Part B is by far the largest part — don't let Part A go on too long! Also, while the three parts and the steps within each part are largely sequential, there is some room for overlap. See the note at the beginning of each part's Tasks section for specifics.



Part A

In Part A, you'll design a GUI for Hedgehogs in a Hurry. Read through this whole part (sections marked with "[A]" in the heading) to get an overview of what you'll be doing, then work through the three tasks in the Tasks section.


[A] Specifications

UI Requirements

The GUI replaces P1's console input and output entirely. It must:

Fancy graphics aren't required — a plain board drawn with shapes and text is fine. A board background image will be provided if you want to use it (not required).

UI Design Requirements

Design principles. Your design must reflect appropriate use of the UI design principles regarding appropriate controls, visual hierarchy and grouping, feedback and visible state, preventing and explaining errors, and consistency that were discussed in class.

Usability. Unlike the throwaway console UI from project P0 (and P1), your GUI should be well-designed, not just functional. Lecture and labs 7 and 8 introduced a two-screen organization (a setup screen and a game screen) and a drag-and-drop gesture, but these are not prescribed — you are free to choose another organization (such as a single screen) or different interactions. Weigh your choices for usability, considering what works best for someone playing the game rather than what is most familiar or easiest to build. What does a player do most often — is it quick and direct or awkward or inconvenient? At each point in the game, does the player know what their options are and do they have what they need to decide what to do?

Accessibility. The design must address the accessibility considerations discussed in class: keyboard operability, labeled controls, contrast, and visible focus. Design for all of them now; Part B specifies what your team will need to implement.


[A] Tasks

Do these tasks in order, except as noted:

A0: Team Kickoff

This is a team task.

A1: Individual UI Design

This is an individual task. Each partner should do the steps in this part separately before seeing or discussing the other's design.

Design a GUI for Hedgehogs in a Hurry. Complete the following steps:

A2: Team UI Design

This is a team swarming task.

Design the UI for the Hedgehogs game:



Part B

In Part B, you'll refactor the code to follow MVC and build the GUI designed in Part A. It ends with a playable JavaFX game and a usability evaluation.

Read through this whole part (sections marked with "[B]" in the heading) to get an overview of what you'll be doing, then work through the five tasks in the Tasks section.

[B] Specifications

Functionality

The game. The implemented GUI reflects your adopted design and supports everything in the UI Requirements. If you change the design while building it (for example, after the usability evaluation), record what changed and why in docs/A2-design-changes.txt.

Accessibility. The contrast-related aspects of accessibility, including that player identity is not shown by color alone, are incorporated. The other aspects of accessibility (labeled controls, keyboard operability including keyboard alternatives for mouse interactions, and visible focus) are required for the team of three and optional (extra credit) for pairs.

Robustness. Bad setup input is rejected with a clear message, an illegal move is prevented or explained, and the program doesn't crash if used incorrectly.

Tests. Write JUnit tests for the model API — tests for classes not touched by the refactoring can be carried over from P1 as is, while other tests may need to be modified or scrapped and new tests created. Controller and GUI code doesn't need automated tests. (Optionally, write tests for any controller logic worth testing. Use a fake view to make this possible.)

Thin console version. (required for the team of three; optional for pairs) This is a complete console-based version of the game that uses the same model and controllers as the GUI but with new view(s) and its own main. ("Thin" means the console code doesn't handle any game logic: it only displays what the model reports and turns typed commands into calls to the controllers.) This UI only needs to be functional enough to play the game; something like P0's is fine.

Design and Code Organization

MVC. The code should be organized into packages model, view, controller and app:

Console version. (teams of three) The console version uses the same model and controllers as the GUI, with only the views replaced, so the controllers must work with either UI.

No side effects. Methods that check whether something is allowed (such as whether a move is legal) should only report — they don't print, prompt, or change the game since the views, the controllers, and the hint generator (part C) all need to be able to ask without changing anything.

Refusals with reasons. Whenever the model refuses something — setup choices that aren't valid, a move that isn't legal, etc — the controller needs to be able to find out why so it can tell the user what the problem is.

Observer. The model notifies its listeners (the views) through a listener interface you define. The recommended starting point is a single broad "the game changed" notification after each complete action, with each view doing a full refresh by pulling the state it needs from the model (as in the Klondike example discussed in class). You can refine this as needed; if so, include a brief explanation of what you changed and why in docs/B-design.txt.

Single entry point for changes. While there may be multiple classes in the model, the views need a single source of notification — thus one model class will be the entry point for all changes to the game and it is the class that notifies the views. Controllers and views can call methods that only report game state on any model class, but controllers change the game only through the methods of the entry-point class.


[B] Provided Code

Fancy graphics aren't required — a plain board drawn with shapes and text is fine. Some images (including a board background, a plain background, and dice pips) are available in /classes/cs329/hedgehogs/board-images if you want to use them (not required). There's a README.txt in that directory describing the images and how to work with them.


[B] Tasks

Do these tasks in order. B0 can be done in parallel with Part A, and Part C can overlap the end of Part B (see Part C).

B0: Setup

This is a team task. It doesn't need a meeting and can be done any time once you've decided on a codebase (A0) — but it must be done before B1, since B1's planning happens in the team repository.

A new team repository will be used for this project:

One person:

The codebase owner: (if you are using one partner's P1)

Once the P1 code (a partner's code or the reference implementation) is in the repository, continue:

Everyone (including the codebase owner):

One person:

B1: MVC Design and Planning

This is (mostly) a team task with one individual step (the independent estimates). It can be combined with the A2 design meeting; in that case, do A2 first before moving on to B1.

Task list. The implementation work in B2 is organized into four chunks: the skeleton setting up the MVC structure, two slices of the game, each covering a part of its functionality, and a final integration step to make sure everything works together correctly. For teams of three, there is an additional slice 1 task and a third slice, adding a console (text-based) version of the game and additional accessibility requirements.

The details for each task below are given in B2; read them before making your S/M/L estimates. Use the task names below as issue titles. Issue descriptions are optional: use them for anything specific to your team, such as how you divided a task into several issues or a detail about an issue that you agreed on.

Ownership.

Scheduling. (teams of three) Slice 3 depends on tasks in both other slices, so plan the order of your tasks to avoid delays for the slice 3 owner (see the dependency diagram). In particular, the slice 2 owner should start with the board view and board interaction (2.3, 2.4), and the slice 1 owner should leave 1.2 until after the setup and game status UIs (1.3, 1.4).

B2: MVC Refactoring and GUI Build

This is a team task. Follow the Team Process throughout. Details for each chunk and task are given below the steps.

Chunk and task details and implementation notes:

B3: Usability Evaluation

This is a team task. Do it as soon as B2 is finished so that there's time to make changes if you want to.

B4: Wrapup

This is a team task.



Part C

In Part C, you'll add a "suggest a move" hint feature to the game. The hint generator logic itself is provided; the work in this part focuses on the UI-related elements of the hint feature. Read through this whole part (sections marked with "[C]" in the heading) to get an overview of what you'll be doing, then work through the three tasks in the Tasks section.


[C] Specifications

Functionality

UI Design Requirements

The parts of the UI the hint adds or changes are held to the same design principles as the rest of the GUI (see the Part A specifications). Feedback and visible state matter particularly here: the player should be able to tell that a hint is being computed and how far along it is and why a hint (or any other control) isn't available.

Design and Code Organization


[C] Provided Code

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.


[C] Tasks

Coming soon!



Project Wrapup

Coming soon!



Requirements

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

Coming soon!



Process


Team Process

The team process is the same as in P1 (see the P1 Team Process), except as noted here.

Intention Inventory

An intention inventory lists what the user needs to do or find out along with what the UI needs to support for each. Writing it first — before any decisions are made about controls or layout — keeps the design focused on the user's goals and makes it easier to check that a design covers everything.

For each intention identified, record:

Some goals may be informational when that is something that the user would want to do for its own sake, such as checking how close each player is to winning. If the information is only part of fulfilling another goal, such as determining which track was rolled as part of moving a hedgehog forward, then it is "information needed" rather than a goal itself.

Also note that the inventory records what the user needs to know, not how the UI provides it: information the user needs to know might be shown directly or the user might work it out from what's shown and their knowledge of the rules. That's a design decision you make in your sketches.

Summarize the inventory in a table. For example, some intentions for Klondike solitaire:

goalinformation neededwhenwhat can go wrongwhat changes
move the top waste card onto a tableau column the waste card, the top card of each column, which columns it is legal to move the waste card to the waste isn't empty and the game isn't over the move isn't legal — nothing moves the card is on the column it was moved to, the next waste card shows (or the waste is empty)
find out whether there are any moves left whether the stock and the waste still have cards, the top card of the waste and of each foundation, the face-up cards in each tableau column any time the user may not realize the stock can be turned over again nothing
start a new deal whether the current game will be lost any time losing a game in progress by accident a fresh deal (the old game is gone)

Also think about what the P1 console version printed as the game went along: whose turn it is and what was rolled, why a move wasn't allowed, what a variant did (a hedgehog sliding back to the start, a push, a skipped forward move), and who won. The board alone doesn't show these, so each needs a place in your inventory and your design.

For Hedgehogs, be sure to cover every phase of using the program: setting up a game, each step of a turn, between turns, the end of a game, starting over, and quitting. Be sure to also include intentions specific to a particular rule variant that your P1 supports.

Usability Evaluation

You'll evaluate the design three times: by walking through your own sketch on paper (A1), by walking through the team's adopted design on paper (A2), and by watching someone else use the finished GUI (B3). All three use the same tasks so you can see how the design changes between rounds and what each kind of evaluation finds.

Tasks. A task is something concrete a user would set out to do. Use the following tasks along with one or two of your own added to cover anything important in your intention inventory that would otherwise be missed:

  1. Set up a 3-player game with a black square variant other than the standard one and play two full turns, including at least one sidestep.
  2. Try to move a hedgehog that can't be moved (an opponent's hedgehog sideways, or one stuck on a black square) and find out why it can't move.
  3. Partway through a game, start a new game with 2 players.
  4. Play a turn in which no hedgehog in the rolled track can move forward.

Hallway test. Find someone from outside the class who hasn't seen your program (such as a friend or roommate). If they aren't familiar with how to play Hedgehogs in a Hurry, give them this rules summary — don't show them your program to explain the game! Give them a chance to ask any questions they may have about the rules and gameplay. They can also refer back to the summary as they play.

Once they understand the rules, begin the test: give them the same tasks as in the paper walkthroughs, one at a time, and ask them to think aloud as they do the task — what they are looking for and what they expect to happen. Don't help or explain the UI — let them try to figure things out on their own. If they get stuck for a while, make a note of it and then give a hint so they can keep going. Since the dice are random, if a particular situation that you want to test (such as a turn with no possible forward move) doesn't arise, just note that rather than trying to make it happen. What to record is described in B3.


Deliverables and Handin

Coming soon!


Assessment

Coming soon!