Project Proposal v3.0

Cimaron Shanahan
cshanaha@ucsc.edu

 

AI, Beholdeth Thy Power!

 

This project will be an extension of the Tag game used in class to 3D.  The main point of this project will be to create an intelligent camera which will change views depending on the current situation of the game.  The camera will consist of at least 3 settings available to the user:

 

Fixed Overhead

Mostly identical to the 2D Tag game.  This will help in debugging the 3D engine as well as components that may be added later

Revision: In addition to a fixed overhead camera, also implemented is a dynamic camera that simply hovers directly over the
player character.  This was to test the ability of the camera to make the necessary transformations prior to object rendering.

 

First Person

This setting will be used for "fair" play against the opponents who themselves are limited by a restricted field of view.  The parameters
should be identical to those for the opponents (a.k.a. a 90 degree field of view and limited viewing/draw distance).  Should include ability
to look behind player while moving. (1. At least that would be so if I started from my yucky first project code. 2. 90 degree FOV doesn't
really look all that great.  60 seems better, though perhaps even smaller would be best...)

The importance of this step is to be able to get the perspective view working, as well as getting a more robust input working for the player
character, since input based on a global position does not work outside a fixed view.

 

Dynamic

This will be the most interesting setting from a player and technical point of view.  It will consist of several animations or behaviors depending
on what is happening in the game (i.e. the camera zooms out when an NPC starts chasing the player character, etc...)
I plan on implementing this in a similiar way to the player controllers in that the camera will select a desired position as well as a desired
viewing point.  It will be constrained in a similiar way as the character controllers, specifically it may not be allowed to simply move in a straight
path, but perhaps more of an arc.

The camera should move such that no objects will be occluding the players view. (If only...)

 

The final project will consist of a modified version of the Tag game source code, including new camera modules that interact with the GUI and game state for the
transition to 3D, as well as modified NPC A.I. routines based on the first project. (<--- Never mind that last bit, too much hassle.  Besides, I wanted to start from
a clean code base :)

Anticipated checkpoints:

If I create anything of reasonable use, I would be willing to contribute it to the ai4games open source project.

 

Completed So Far

Created camera class which keeps track of camera "renderers", special classes which apply correct transformations
to view the scene correctly during each rendering pass.  Also, when switching camera modes, these setup initial
viewing modes (i.e. orthographic, perspective projections, lighting, etc...)

Created new viewing modes as each new part of the project was implemented.
First is simple flat model, integrated with the generic camera model.
Second is fixed overhead view in 3D.
Third is overhead orthographic view which follows the player character to demonstrate the cameras ability
to change viewing transforms.
Fourth is first person view to test perspective modes.
Fifth is over-shoulder perspective to further test perspective, as well as correct control.
Sixth is "dynamic" mode which implements a new camera model that allows for abstraction of the camera
controller(s) in a similiar manner as the tagGame for increased efficiancy (hopefully :)

Controls in tgControllerPC have been adjusted to account for different viewing angles.  In order to do this
we first must find the vector described by the position of the camera and the position of the camera lookat
point.  By finding the angle of this vector and rotating the input vector by this angle, the controls will work
correctly on any arbitrary viewing angle.  Note: it is now necessary for the 2D cameras to set the viewing
vector pointing straight up for this to work for all cases (<0, 1, 0> will work just fine).

The final part is also the most difficult.  Whereas before, the camera object kept track of its own position
and lookat vectors, it now contains two new objects of type tgCameraMovement for position and lookat.
These are mostly the same as tgCharacter, which allows control of the camera position and lookat points
independently and in a similiar manner as the characters.  They now have the same constraints, i.e. they have
have mass, velocity, maximum speed, etc...
This eliminates the "jerkiness" associated with the other cameras that can instantaneously appear in new positions.
This ensures that the camera behaves as a real world object that has to move from point a to b and rotate around
to change viewing angles.

Currently, I should be working on a new camera perception model that should allow for some interesting things,
make various tweaks on this viewing model, and clear out the old camera position and lookat code.  Theoretically,
this new model should be able to accommodate the older models dependencies, it is simply a matter of poring back
through every camera "renderer" and making the relevant changes (as well as in tgControllerPC).

update 6/5:
The project is now as complete as I want to make it.

The source and powerpoint presentation with more information can be found
here and here

 

Screens