Welcome Page

Table of Contents

Project Management

  1. Team Working Agreement
  2. Individual Responsibility Agreement
  3. Project Schedule
  4. Meeting Notes

Business Plan

  1. User Identification and Interviews
  2. Electronic/ Print Advertisement
  3. Pitch Video with Demonstration

Software Documentation

  1. Introduction
  2. User Manual
  3. Program Description for Developers
  4. Final Program, Flowchart, or Pseudocode
  5. Final Program with Comments
  6. Discussion
  7. Conclusions and Recommendations
  8. References

Executive Summary

Computer developed games are the largest part of today’s gaming community. The development of each game is extremely complex and requires a lot of coding and programming experience. For this project, 2 points of games will need to be created using Matlab. The games that will be developed are assigned a point value based on their difficulty. These games range from one as simplistic as a dice game (1 point) to battleship with artificial intelligence built in (4 points). The plan is for the team to create 6 points worth of functioning and documented games. The first is a simple dice game, the second is Twenty-one Sticks, and the third is Battle-ship with integrated AI.

The dice game that was created, Normtech’s Revenge, was a simple dice game that was created using vectors, random number generators, and text printing. First, a pseudo-code was created in Microsoft which outlined the function of the game. Using the pseudo code, comments were made in Matlab outlining the code to be made. As the pieces were filled in based on the comments, the 5 dice rolls were copied and pasted from the first one to the rest. With the code in place, the debugging process began.  The text printing and vector portion of the code did not cause any issues, however, the random number generation did cause challenges. The “rand” and “randi” functions were tried, but they were causing a lot of issues. Therefore, it was changes to just pick a number from the variable, n, which was set equal to 6.

The Battleship game was made to be like the classic board game, with a player and computer trying to sink the other’s ships. The computer has “AI” that will play differently based on whether a ship has been hit but not yet sunk. A flowchart was made first to organize how the code would be done before the coding could start. We then started coding while using comments with the same structure as the pseudo code.  The program asks the player where they want their ships to be placed, with options for orientation and direction, and then creates a board randomly for the computer. Then the player and computer enter a coordinate to shoot at on the other’s board. The board updates to reflect if there was a hit. If the computer had hit a ship before, then it tries to hit the spaces next to the hit. Once one side gains 17 hits (which is the amount of hits for all 5 ships added up), then the game ends.

21 Sticks was created with two major parts: a while loop and outside of the while loop. Outside of the while loop, there are a series of statements determining if the player wins or loses. First, a flowchart was created using Microsoft which outlined the structure of the game.  As the flowchart was created, the outline of the code was created, which was then implemented with Matlab. When the code was implemented, there were many errors such as the AI being able to enter multiple numbers at the same time, as well as the program crashing if the user did not enter 1 or 2. These were fixed by implementing a turnCounter variable which measured the number of turns and only allowed both the user and AI to enter one number per turn, and another while loop, which kept looping if the user did not enter 1 or 2. 

When the group started this project, it was expected the battleship game to be the most difficult and time consuming game of the three that were made. This was seen to be true, but it wasn’t clear how different the difficulty levels were. The card game and the dice game took one or two days each, while the battleship game took several hours most days of the week until the end of the project timeline. It was also surprising that the parts of the code that would be the most trouble weren’t connected to the AI. It was expected that making the smart AI would be the most difficult to code. The placing of ships ended up being the most difficult to code, since nested if, for, and while statements were used so much. The large effort that went into this project was to code three relatively simple games in Matlab. The experience and skills gained has brought the group to a higher level of understanding and applicable knowledge.