Introduction
The goal of this assignment is to allow students to demonstrate their understanding of the advanced features of C++ through the proper use of the languages’ object-oriented properties. To achieve this goal the student will be required to complete the following steps:
- Design a simple interactive game (can be based on an existing game)
- Develop code to implement this game design (primarily your own, original code)
- Test your implemented game for functionality and bugs, and
- Document the design/implementation/testing process as well as a user/start-up guide.
There are two key dimensions to this assignment: (1) a demonstration of the software design and development process used by the student; and (2) the completed game that meets a minimum set of requirements. The assignment will require the submission of all documentation and source code for the game.
The following sections detail both the required/expected features of the game and the required documentation. A breakdown of marks to be awarded to each component is also given.
Demonstration of C++ Proficiency
To achieve the goal of demonstrating a sufficient understanding of the C++ language, the submitted game software must contain appropriate examples the following C++ mechanisms and features:
- Demonstration of C++ programming features (standard & advanced). Appropriate use of:
- variable and constant types
- loops and branch statements
- dynamic memory allocation
- pointers and references to variables and functions
- functions and modularisation
- Demonstration of OO programming principles. Appropriate use of:
- a class hierarchy and inheritance
- pure virtual base classes
- object polymorphism
- Rigorous error checking and handling through:
- error checking/validation of function arguments
- error checking of function return values
- validation of input data
- Console and File I/O – appropriate use of:
- Standard Library input/output streams (use of log/error streams)
- console API for detailed ASCII/screen output
- external data files for both input and output
Game Concept
The style and setting for this game is left up to you. The type of game you choose must be sufficient to demonstrate the programming features listed above. Our recommendation is for you to constrain your software to a console application using ASCII characters (text) for display. Games suited to this format may include an adventure game, a simple simulation/strategy game, a maze/platform style game.
Some online examples of games that can be used for ‘inspiration’, include:
- Hammurabi http://www.hammurabigame.com/hammurabi-game.php
- Zork http://thcnet.net/error/index.php
- Star Trek http://www.vavasour.ca/jeff/level1/entry6_preview.html
Also, think of some traditional games that may be used for inspiration:
- Cluedo http://en.wikipedia.org/wiki/Cluedo
- Risk http://en.wikipedia.org/wiki/Risk_(game)
- Battleship http://en.wikipedia.org/wiki/Battleship_game
PLEASE NOTE: most of these games require two players; it is not expected that students implement a complex “AI” computer opponent. Allowing for a second (or more) player to have their turn at input would be sufficient. That is, alternating turns is fine; it is not necessary to have concurrent player access (two players sharing a keyboard). If you wished to implement a computer based opponent, then one that provides simple, random actions is sufficient.
Required Game Features/Functionality
In providing the required features (listed in the Demonstration of C++ Proficiency section above), the game must support a set of minimum features – that must be present to gain a passing grade for the assignment. These minimum features include:
- Game Software Features
- Implementation of an appropriate game loop
- Changeable game states based on user input
- Basic/Simple User Interface
- Accepts user input via keyboard input as commands/directions
- Is able to display/present the current game state in simple text based form (either as descriptive text or simple ASCII graphics)
- Multiple game (software) states
- At least 3 game states – (1) menu/start; (2) play; and (3) end game states.
- A single, playable level
- This may take the form of a single map/region/level/etc.
- File input/output
- Loading of maps (a level, or a previously saved game)
- Saving and loading of game state
- Various in game items/entities
- Collection of game items with varying properties/attributes (e.g., gold, money, keys, swords, armour, etc.)
- Items that support gameplay (e.g., a non-player character, monster, enemy, etc.)
- Features appropriate to the game genre
- Dialogue to engage the player (interesting/funny) for an RPG style game
- Potentially dynamic/random text (e.g., for a text adventure game)
Additional features that are expected to gain full marks (100%) include:
- Additional game states
- Other states can include: end game, credits, options
- Multiple levels (game play advances once a level is completed):
- Levels have varied content (entities) or difficulties, for example: Level 1 – a single map Level 2 – 2 maps (passing through a doorway leads you onto the 2nd map) Level 3 – 5 maps in a cross pattern (centre map, with maps above/below and left/right)
- Inventory – with collectable items. This will enable gameplay mechanisms such as:
- Collection of game items (e.g., gold, money, keys, swords, armour, etc.)
- Ordering of items (e.g., you need to collect the key before opening the chest)
- Special game items, that add to/enhance the game play, such as:
- Portals in the level which transport you to another location in the level
- Non-player characters (opponents) controlled by the computer, i.e., they move
- Relationship between game items, i.e., they have different attributes (strength, requiring more powerful swords)
The combination of the minimum features and additional features are needed to gain full marks (100%). If you wish, you can go for bonus marks (additional 10%) by adding the following features (please note, that if your game does not provide the minimum/additional features listed above, then you are not eligible for the bonus marks – so only attempt this once you have completed the other features):
- Extended/advanced control of the non-player characters
- Dialogue to engage the player (interesting/funny) Dynamic/changing text – that is context relevant
- Option to have the game played in different languages (English, French, Spanish, etc.)
- Development of a Win32 application
- Use of Win32 Event System to provide asynchronous I/O
- Use of mouse and/or joystick/gamepad for input
- Use of GDI to provide static 2D graphics
- Use of GDI to provide animated 2D graphics