Risk

CSc 335 – Final Project

Overview

Risk is a popular board game of strategy that has been around since 1957 and is known throughout the world by a variety of names. The basis of the game is to conquer the world using strategy, luck, and perhaps some diplomacy. Its colorful history can be explored on the Internet, starting with the Wikipedia article.

Your Task

You are required to create a fully functional game of Risk following the rules such as reinforcing, attacking, and obtaining cards. Although there are many variants, you are required to use these rules

with the following exceptions:

  • Do not implement the Two Player Risk described on pages 11 and 12).
  • Do not implement the Card Feature as the required part of your project.
  • The human player may have a default number of dice to roll that can be changed. This avoids requiring a selection of 1, 2, or 3 dice before attacking or selecting 1 or 2 before being attacked. Allow human players to change attacker and attacked default dice rolls. This works well when you have real dice handy, but not so well in a computer version).

Settings:

The implementation must provide a way at startup to graphically configure the game to change the following settings:

  • Number of players
  • Type of player (Human, Simple AI, Intermediate AI, Expert AI)
  • Names of players
  • Color to represent each player

Computer Players:

  • The game must be playable by choosing 2 to 6 computer players with the following strategies
  • Beginner: Not very smart and easy to defeat. Random decisions can help.
  • Intermediate: An intermediate computer player differs significantly from the beginner and indicates a “better” player. Intermediate players should be more difficult to beat than the beginners over many games.
  • Expert: An advanced computer player should be able to beat the other two most of the time. It should be a challenge for humans to beat these players. We should see this strategy hand in there.
  • Include a program named Run6Bots.java using standard output (no GUI) to print the wins of each AI it after running 1,000 games when computer players have two players with each of the three strategies playing against each other. Report the number of wins per player and its strategy. Expert strategies should win most of the time, Beginner strategies should lose most of the time.

Maps:

  • The one map shows all of the countries in your world.
  • At all times the following must be visible on the map:
  • The owner of each country via color or some other easy to understand graphical indicator
  • The number of armies in each country must also be visible and easy to read
  • The continents and what countries belong to them
  • The following must be accessible at all times, but not necessarily visible at all times:
  • The name of any country selected by a user
  • The countries accessible from a selected country
  • The bonuses available for the various continents

GUI:

  • Game has, attractive, and easy to use graphical user interface.
  • The interface provides the required information the user(s) to start a game
  • Must be able to choose the type of players. It could be all bots, or two humans
  • It is always clear whose turn it is and which phase of the turn is active.
  • Should draw images, shapes, and other graphical entities to represent things such as the countries, continents, number of armies
  • Human user must always be able to see his/her cards. The cards must have a graphical representation of the three army components (soldier, cannon and cavalry).
  • Should allow the user to interact with the game by listening to mouse and/or keyboard events.
  • Should allow human players to know whose turn it is
  • Have sounds at start up and to call attention to important game events
  • Must have Menu option to turn sound off or on
  • Users should see what countries can be attacked from any of their own holdings
  • It should be obvious who holds what countries with the number of armies on each
  • Save the game state and anytime. Also prompt the user to save when quitting.
  • Load a previously saved gameat anytime (use JFileChooser)
  • Prompt the user to save the current game on quit
  • Has a Splash Screen and About Box
  • Splash screens are 'loading' or 'start-up' screens that have animations, sound, and/or a cool picture. A good song helps
  • About box to describe the game, team name, and developers (team members)

Summary of Risk Rules and Additional play Features

Here is a summary of the rules from the game of risk along with some additional things needed to be able to test and grade this project:

  • Your system must be able to have six computer players (no prompts or user input needed) with two different AIs (or three if chosen as an additional feature) to quickly play until the end of a game.
  • Can set up a game with any mix of human players or bots in a reasonable manner (choose AIs)
  • All players can place troops on unoccupied territories until all territories have been selected.
  • Can place armies only on territories owned by player until correct numbers are place
  • Number of dice to attack with is selectable and can also be set with a default to avoid a click
  • Minimum two armies must exist in attacking territory.
  • Only owned territories can attack neighbors
  • Post territory conquer army movement occurs
  • Minimum of 1 army left behind on an occupied territory
  • Moves minimum number of armies attacked into conquered territory
  • A card is issued at end of attack if one territory was conquered
  • Card turn in is permitted
  • Players can select how many troops to move
  • Reinforcement is correct
  • Two different strategies are implemented (a third is optional)
  • Run6Bots.java accurately prints the results of two different strategies played in 1000 games (or three strategies if a third strategy is one of the options)
  • Used strategy design pattern so strategies are swappable at runtime and can be set before game begins
  • About box exists and lists the team name and all team member names
  • About box describes how to begin a game so we don’t have to figure it out
  • Menus provide the means to start game, save game, toggle sound, and so on
  • Has sound and it can be toggled off (except the splash screen can play some sound when first started)
  • Can start a game with all bots and run to end of a game, no human interaction needed

Wow Factor
Completing the above requirements will earn at most 90% of your grade. To earn the last 10%, your game needs to have a “wow” factor. This could include lots of extra features, how well designed (and fun) the game is, or just good old-fashioned polish—anything that will make your game really stand out!

//// TO BE REMOVED LATER – ignore for now ///////

There are two types of animations possible. The first is used for video-like animations like the splash screen. An animated GIF* is recommended for simplicity, though you may use any type of animation you would like at your own risk. In other words, the grader may not be able to provide much support if something other than an animated GIF is used and there will not be allowances made in your grade if the animation does not end up working.

*An animated Gif is a single file that has multiple images embedded within it. These files are created by a variety of animation tools including GIMP(free) or Adobe ImageReady($$).

The following events require a simple animation. These can be events occurring on the map screen, or a popup frame with an animated sequence (though the popup should not require user intervention to dismiss).

Animated Gifs are acceptable for these animations.

The conquest of a country.

A player turning in cards (including AI).

A player conquering or losing a continent.

A player losing all of his countries and losing the game.

A player winning the game.

The second type of animation is done using code to draw the steps of the animation with the animation code actually managing the timing of the animation. These animations cannot use an animated gif. The following event requires this more complex type of animation:

A player attacking or defending a country.

Note: the implementation of this animation is more complex. The animation, itself, can be fairly simple.

It must be possible to disable all the animations at any point during the game