Project (Sagrada)
1
Assignment 2
Sagrada Game
This project will allow you to implement a computer game, with some
simple graphics. It is a game where you will implement some simple
artificial intelligence and incorporate it in the computer player.
This project is worth 7.5% of your final grade. You must do this project
on your own. The submission deadline is the last teaching day of
semester, Friday 15 October 2021 at 5pm. Your submission will be
marked out of 12 in the lab, then your C# code will be marked out of 8
after you submit your program.
Project Specification1
You have been asked to write a computer version of the Sagrada board
game, by Daryl Andrews and Adrian Adamescu. It is an abstract game
where you place coloured dice to complete a ‘window’. The object of the
game is to complete the ‘window’ such that you gain the most points.
Sagrada is played over 10 rounds. Each round, random coloured dice are
pulled from a bag and rolled. Players take turns choosing a dice and
placing it in their ‘window’ following placement rules. There are both
general placement rules and rules specific to their ‘window’. There are
also special ‘tool’ actions that allow the player to reroll or change the
dice, make special placements, or rearrange their existing window dice.
After 10 rounds, the players score their window, according to public and
individual objectives. Players lose points for every empty position in
their window, and tool token used. Winner has the most points.
The full rules are in the Sagrada_Rules.pdf file.
Your program should implement (a simplified version of) the game
where the user plays the solo player variant.
Solo player
The game has a set of Solo Play rules, which affect the scoring, but mean
you do not need an opponent. Implement the game so the user (or a robot
player – see below) can play a whole game.
1 Rules from https://boardgamegeek.com/boardgame/199561/sagrada
COMPX102-21B
2
Robot player
A computerised version of this game will have a robot player acting as
the solo player. At each turn the robot player can choose a number of
dice to place (and where to place it), and whether it is using a special tool
action. The robot player must only make legal moves, and can do 10
rounds.
A purely random robot player would not be that interesting to play
against. So, your robot player should try to have some artificial
intelligence, or ‘heuristics’, such as picking the highest scoring dice, or a
dice that achieves an public or private objective. Is the computer a
‘greedy’ player, taking the dice that immediately are worth more points,
or going for more long-term objectives, that might be riskier to complete.
Tasks
Write a program that satisfies the specifications described above. It
should make use of the programming features that you have learnt so far,
in particular using classes, subclasses and methods to structure your
program.
The project requires you to both get it verified in the lab and to hand in
the source code. Half of the grade will be based on how the program
runs and half on the structure, code style, documentation and user
interface/interaction.
We suggest that you build a simplified version of the game first, and then
add in more features as time permits. Concentrate on getting the objects
and simple turn play right before adding fancy graphics and controls. It is
easier to control all players actions, then adding a computer player once
you have a basic game going. Once you have a stupid computer player,
then add more intelligence and heuristics (preferably into player
subclasses).
If your program is structured well, you should be able to let the user
choose which robot player they want to play, and the different
behaviours are provided by setting which subtype of objects are used.
Sagrada Game Assignment 2
3
COMPX102-21B
Assignment 2 Hand-in due 5pm 15th October 2021
Compress (Zip) the Visual Studio folder with your program code and submit it via Moodle.
Student Declaration of Originality
I declare that the program which I have had verified and submitted in Moodle is entirely
my own work. I have not worked together with any other people. I have suitably
acknowledged (referenced) any parts of other programs that I have used. I understand
that if I have breached the above conditions I will be sent to the University Disciplinary
Committee.
Note: This project will only be marked if this Declaration of Originality is signed.
Name: __________________________________
ID Number: ______________________________
Signed: _________________________________
Date: ___________________________________
Functionality and Usability (to be demonstrated in the lab)
Displays ‘window’ board and random coloured dice _____ /1 mark
Can pick and place coloured dice in window _____ /1 mark
Checks no adjacent same colour or value dice _____ /1 mark
Checks dice placed adjacent to existing dice _____ /1 mark
Loads/generates window designs/restrictions _____ /1 mark
Checks dice follows window restrictions _____ /1 mark
Displays and scores private objectives _____ /1 mark
Displays and scores public objectives _____ /1 mark
Three tools implemented _____ /1 mark
Plays 10 rounds. Recognises game end and winner _____ /1 mark
Usability (layout, choice of controls, feedback, etc.): _____ /2 marks
Functionality Total: _____ /12 marks
Bonus: Use delegates to make code more flexible _____ /+1 mark
Bonus: Robot player implemented _____ /+1 mark
Coding Style
Code Style (object design, docs, contracts, etc.): _____ /8 marks
Total: _____ /20 marks