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

Requirements

All Risk rules must be followed such as reinforcing, attacking, and obtaining cards. Although there are many variants, you are required to use these Rules of Risk

Computer Players:

1. Beginner Not very smart and easy to defeat. 2. 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. 3. Third Strategy 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. Also include these features: • Tournament: • Your system must be able to have six computer players (no prompts or user input needed) with three different computer strategies that would allow quick play until the end of a game with no human player.

• Name this program Run6Bots.java. Use standard output to print when each player is defeated. For each defeat, show the state of each player including such as the number of armies and the cards. • • Run 1,000 games and report the number of wins per strategy • Name the file that runs this RunTournament.java • Must be completely separate from the GUI • You could simply print the results to standard output • Allow the user to select human players or computer players before the game begins • Allow the human player to set strategies of the computer players before the game begins • Graphical View • Should draw images, shapes, and other graphical entities to represent things such as the countries, continents, number of armies • 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 • Savable/Loadable game • Save the game state and anytime. Also prompt the user to save when quitting. • Load a game at anytime. • Prompt the user to save the current game on quit • Must be able to save at anytime as a menu selection • Must use JFileChooser to load and save the game as a file • Menus • Reasonable set of menu options • Splash Screen and About Box • Splash screens are 'loading' or 'start-up' screens that has animations, sound, a cool picture. • About box to describe the game, team name, and developers (team members)

Play???:

Loading and Saving: (10 points) At the beginning of any human user's turn, it must be possible to save the game, exit, restart the game and resume the game exactly with the state saved. When exiting the application, the user should be queried if they want to save the game. You must use JFileChooser to permit the user to select the filename of the save file.

← Human Players ← ← ← ←

Artificial Intelligence (AI) Players:

You must have two different levels of AI players available in your implementation. The “simple" AI should be simple to beat while the “expert" AI must be challenging for a human Risk player.

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, Expert AI)  names of players

GUI: Your implementation must have a clean, attractive, and easy to use graphical user interface. It should provide the required information the user(s) will require to play the game, including:

Map

You must have a map which shows all of the countries on one standard lab monitor (not the graphics machines, and no scrolling maps).

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.

Cards

In addition to the map, a 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).

Turn

It must always be clear whose turn it is and which phase of the turn is active.

Splash Screen and About Box:

An opening splash screen animation (see below for animation specifics) with the name of the team doing the project is required. The user should be able to press a key to get through the screen quickly. This is a user's first view of the game and should serve to draw them in. A menu selectable ”About box" popup should accessible at all times in the game. This should include a short description of the game, and an explanation of any special features. It should also list the team members.

Animations:

There are two types of animations required. 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. Sound:

The events above should also be accompanied with sounds that help communicate the type of event that has occurred.

It must be possible to disable the sounds at any point during the game.

Extra Credit: 15 points Max

 Adviser Mode: (5 points) At any time the human user may ask for advice from the computer, the computer will give useful advice after analyzing the current game situation. Also, warnings like “Player 3 is about to take Europe!" will appear for the player using the adviser mode. The adviser must not make moves for the player, but only issue recommendations to the player. The AI cannot use the adviser.

  Two Player Variant: (5 points) Implement the two player variant. The rules are on the last two pages of the 1975 rules PDF referenced at the end of this document.

 Networking: (15 points) Implement full networking support into the game. This should include a rudimentary chat server.

 Statistics: (5 points) Collect and display relevant statistics about the game so as to provide users information regarding how the game proceeded.

 Mission Cards for Humans Only: (5 points) This would be an optional mode of play, that is, you must be able to select this mode at the start of the game and the standard game must also be playable. In this mode, each player gets a mission card at the beginning of the game. The card specifies that player's conditions for winning the game. There must be at least 4 different types of mission cards, with 2 of them being: o Conquer and hold for 3 turns a set of random continents totalling no less than 7 bonus points. The continents are randomly assigned at the start of the game by the computer. o Eliminate one other player, selected at random. Note that in this option (Mission Cards for Humans Only), the AI player's goal and victory condition is still global domination. When a player completes their victory conditions the game ends and they are declared the winner.  Mission Cards for AI and Humans: (10 points) This is the above option, but with AI players also getting mission cards which they must attempt to satisfy.

Hints:

It is strongly recommended that the development team play a game of Risk to solidify their understanding of the game. Make sure you play by the rules we provide. One (or more) persons on the team should study the rules very carefully and make sure they understand the subtle cases.

References:

Risk 1975 Rules (remember not to implement the two player rules unless you are doing that extra credit http://www.hasbro.com/common/instruct/Risk1975.PDF ←