Starting from:

$30

Assignment 4 CS 381: Game Engine Architecture

Assignment 4
CS 381: Game Engine Architecture

Max Score: 100
Assignment
You will work on creating and using your own game loop and escape from dependence on
ogre’s frame listener and the sample framework. We have talked extensively about the
architecture of the game engine in class and your design and implementation will fit within
the game engine architecture that we have been discussing in class. All pre-written code for
this assignment is here. Your mission:
• Re-implement assignment three in this new architecture
Architecture (90 points)
The game engine will now be implemented in a class called Engine. Your main program (in
main.cpp) will create, initialize, run, and cleanup your 381 game engine as shown below.
#include <Engine.h
int main(int argc, char *argv[]){
Engine *engine = new Engine();
engine-Init();
engine-Run();
engine-Cleanup();
return 0;
}
The Engine class is defined here: Engine.cpp. The Engine class
1. Constructs manager instances
2. Initializes manager instances
3. Implements the game tick. It computes the time for one tick, and passes this on to all
your Manager instances.
1
4. Brings the engine down gracefully
It should be clear from the Engine implementation code that the game engine contains
the following Managers.
1. An EntityMgr to create and keep track of all game entities. This will change from my
posted solution to assignment three (15 points)
2. A GfxMgr to initialize ogre graphics (as in Tutorial 6), and initialize the camera. This
class’ tick function calls ogre’s renderOneFrame as shown in Tutorial 6 (20 points)
3. An InputMgr to initialize the keyboard, mouse, and setup buffered input. Handle tab
selection, handle camera movemement, and handle user input to change entity desired
speed and desired heading. (20 points)
4. A GameMgr to initialize the game level (scene) and create game entities (15 points)
You have to design and implement EntityMgr, GfxMgr, InputMgr, GameMgr. All managers inherit from the Mgr class and call their superclass (Mgr’s) constructor to store a
pointer to the game engine.
You may use and modify EntityMgr from my solution to assignment three. Most of the
functionality and code for GfxMgr and InputMgr can be found in Tutorial 6 on the ogre
website and in the solutions to prior assignments on our class website. Note that, apart
from the class constructor, each manager implements the following methods: Init, Tick,
LoadLevel, Stop.
You will also need to design and implement two aspects to be attached to each entity.
1. Physics (10 points): Implements the same physics from our prior assignment three
2. Renderer (10 points): Creates and manages a 381 entity’s ogre scene node and takes
care of copying the 381 entity’s position and orientation to its scene node. Exactly like
in assignment three.
You may copy these from the posted solution to assignment three. You will need some
changes to my Entity381. I would use the following signature for an Entity38’s constructor:
Entity381::Entity381(Engine *engine, std::string meshfname, Ogre::Vector3 pos, int ident)
This assignment is very similar to the prior assignment and you are to choose and load
at least one example of each of five (5) different types of ship models (entity types) at
http://www.cse.unr.edu/~sushil/models/381/ into your evolving game engine.
Camera control (5 points)
You will now control the camera with the WASD and PgUp and PgDown keys (get my
permission if you would like to use different keys).
2
Quitting
Hitting the escape key should shut down your running game engine.
Tab selection (5 points)
Bind the tab key to selection - that is - pressing the tab key will select the ”next” entity.
Only selected entities have visible axis aligned bounding boxes.
Design contraints (-100 points)
You may not change main.cpp, Mgr.cpp, Mgr.h, Engine.cpp, Engine.h.
Cumulative Extra Credit
• Add flying entities (a class that inherits from entities) and make the alien ship a
subclass of the class of flying entities. Make the alien fly (+5).
• Add a first person or third person view for the camera. Switch between RTS and first
person view with a hotkey.
• Add mouse selection (+5)
• Add shift-selection, where pressing the left-shift-key and tab key, adds the next entity
to the list of selected entities. User control applies to all selected entities (+5)
• Add a specific selection sound for each different type of entity. For example, when an
entity of type, say, destroyer gets selected, it says Ready to destroy while when the
frigate gets selected it says Let’s go. Nothing obscene please (+10).
• Third person view forward from a selected entity’s point of view (+5)
• Add group mouse selection (+5)
• Add the ability for selected entities to intercept another entity. Use right-mouse click
to indicate the target ship to be intercepted (+5)
• Add wakes to all entities. This code should be added to Renderer (+5)
Turning in your assignment
Assume that this format will be used for all your laboratory assignments throughout the
semester unless otherwise specified.
1. Demonstrate your working program in the lab on the due date. You will be graded on
your demonstration.
3
2. In lab, submit the assignment using canvas
(a) Make a subdirectory in your workspace named as4.
(b) Place all your project files in as4 (you will demo from this folder in lab).
(c) Tar and gzip or Zip the entire folder and submit using Canvas
Ask me (sushil@cse.unr.edu) if you have questions.
Objectives
1. Demonstrate an ability to apply knowledge of computing, mathematics, science, and
engineering by learning and applying knowledge of C++ and game engine architecture
to solve the problem of implementing a game engine
2. Demonstrate an ability to analyze a problem, and identify, formulate and use the
appropriate computing and engineering requirements for obtaining its solution by using
inheritance, callbacks, and polymorphism
3. Demonstrate an ability to use the techniques, skills, and modern engineering tools
necessary for engineering practice by using the ogre engine framework and the eclipse
IDE
4. Demonstrate an ability to apply design and development principles in the construction
of software systems or computer systems of varying complexity such as our game engine
4

More products