Chedister - Client - 3D Character Display

Project: The Watson Game
Function: Client
Subsystem: 3D Character Display
Author: Matt Chedister
Date: 12-10-04
Class: CS-495 Spring 2004
Project: The Watson Game
Function: Client
Subsystem: 3D Character Display
Author: Matt Chedister
Date:12/10/2004
1
2
3
4
5
6
7
Introduction ................................................................................................................. 3
1.1
Goals and objectives ........................................................................................... 3
1.2
Statement of scope .............................................................................................. 3
1.3
Software context ................................................................................................. 3
1.4
Major constraints ................................................................................................ 3
Data design.................................................................................................................. 3
2.1
Internal software data structure ........................................................................... 3
2.2
Global data structure ........................................................................................... 4
2.3
Temporary data structure .................................................................................... 4
2.4
Database descriptio ............................................................................................. 4
Architectural and component-level design ................................................................. 4
3.1
Program Structure ............................................................................................... 4
3.1.1
Architecture diagram .................................................................................. 4
3.1.2
Alternatives ................................................................................................. 5
3.2
Description for Component n.............................................................................. 6
3.2.1
Processing narrative (PSPEC) for component n ......................................... 6
3.2.2
Component n interface description. ............................................................ 6
3.2.3
Component n processing detail ................................................................... 6
3.3
Software Interface Description ........................................................................... 7
3.3.1
External machine interfaces ........................................................................ 7
3.3.2
External system interfaces .......................................................................... 7
3.3.3
Human interface .......................................................................................... 7
User interface design................................................................................................... 7
4.1
Description of the user interface ......................................................................... 8
4.1.1
Screen images ............................................................................................. 8
4.1.2
Objects and actions ..................................................................................... 8
4.2
Interface design rules .......................................................................................... 8
4.3
Components available ......................................................................................... 9
4.4
UIDS description ................................................................................................ 9
Restrictions, limitations, and constraints .................................................................... 9
Testing Issues .............................................................................................................. 9
6.1
Classes of tests .................................................................................................... 9
6.2
Expected software response ................................................................................ 9
6.3
Performance bounds.......................................................................................... 10
6.4
Identification of critical components ................................................................ 10
Appendices ................................................................................................................ 10
7.1
Requirements traceability matrix ...................................................................... 10
7.2
Packaging and installation issues ...................................................................... 10
7.3
Design metrics to be used ................................................................................. 10
7.4
Supplementary information (as required) ......................................................... 10
Class: CS-495 Spring 2004
Project: The Watson Game
Function: Client
Subsystem: 3D Character Display
Author: Matt Chedister
Date:12/10/2004
SOFTWARE DESIGN SPECIFICATION
1
Introduction
This section provides an overview of the entire design document. This
document describes all data, architectural, interface and
component-level design for the software.
1.1
Goals and objectives
The goal of this assignment involved adding the functionality of a
user who is logged into the Watson game to see other logged in
players walking around the building as well.
1.2
Statement of scope
The added code requires input sent from the server, namely 3D
coordinates of all players in the game. The added code then
processes these coordinates, and displays a visual representation
of each player on the screen.
1.3
Software context
This added code will add a further dimension of realism to the
Watson Game, and if further developed, could present the ability to
have fully animated 3D virtual people walking the corridors of the
Watson building.
1.4
Major constraints
There are no major constraints that will affect the added code that
will not affect the program as a whole.
2
Data design
A description of all data structures including internal, global, and
temporary data structures.
2.1
Internal software data structure
Class: CS-495 Spring 2004
Project: The Watson Game
Function: Client
Subsystem: 3D Character Display
Author: Matt Chedister
Date:12/10/2004
There are no data structures that are passed in my portion of the
code.
2.2
Global data structure
At its current developmental stage, my code does not make use of
the messages that pass back and forth in-between the client and
server. Once the communication is fixed, my portion of the code
should make use of wagMsgHandler.fStatsRequest(wagMsg msg) method
to get the 3D coordinates from the server.
2.3
Temporary data structure
Three floats, f1, f2, f3, are used temporarily to hold the 3D
coordinates of the other person that’s logged in.
2.4
Database description
No database functionality was added in my code.
3
Architectural and component-level design
A description of the program architecture is presented.
3.1
Program Structure
The added code is placed inside of the CWatsonGamePlay.cpp file,
under the function RunScene. This function is called when the
player is in play mode, and its responsibility is to render the
Watson building to the screen. The added code is in this function,
inside of the push pop block that surrounds the rendering of the
terrain.
3.1.1
Architecture diagram
Class: CS-495 Spring 2004
Project: The Watson Game
Function: Client
Subsystem: 3D Character Display
Author: Matt Chedister
Date:12/10/2004
start
Is there an
internet connection
Yes, poll the server for the
next set of coordinates
No, simulate a user
Are there more coordinates?
stop
3.1.2
Alternatives
No alternatives were considered. The above structure should be
the most logical and ideal to fulfill the objective of the code.
It is a fairly simple and straightforward solution to a fairly
simple and straightforward functionality. Some alternatives were
considered, however, as to the location of the added code.
Again, CWatsonGamePlay.cpp seemed to be the most logical
location.
Class: CS-495 Spring 2004
Author: Matt Chedister
Project: The Watson Game
Date:12/10/2004
Function: Client
Subsystem: 3D Character Display
3.2
Description for Component n
A
detailed description of each software component contained
within the architecture is presented. All of the components will be
described in this section.
3.2.1
Processing narrative (PSPEC) for component n
Firstly, the code checks to see if an internet connection is
working. If so, it polls the server for the coordinates of all the
other logged in players, and in a for the amount of players that
there are, displays a triangle on the screen for each one. If
there is no internet connection, the code simulates a user by
displaying a triangle going back and forth between two points every
few seconds.
3.2.2
Component n interface description.
The input of the added code is the coordinates of all other
players in the game, given by the server. The output is the
visible triangles within the game.
3.2.3
Component n processing detail
If there is an internet connection
Poll server for 3D coordinates
For every person logged in
Display a triangle on the screen
If there is no internet connection
Simulate a person walking around the building.
3.2.3.1
Interface description
The only interface involvement from the added code is the visual representations
of the other players.
3.2.3.2
Algorithmic model (e.g., PDL)
From an algorithmic point of view, the added code is not terribly demanding.
The for loop will repeat n times, with n being the number of players logged in to
the game. The if/else block will execute once every iteration.
Class: CS-495 Spring 2004
Project: The Watson Game
Function: Client
Subsystem: 3D Character Display
Author: Matt Chedister
Date:12/10/2004
3.2.3.3
Restrictions/limitations
If there are a large number of players logged in at the same time, it’s a possibility
that the user will see nothing but triangles, and will not be able to play the game
effectively.
3.2.3.4
Local data structures
None.
3.2.3.5
Performance issues
Currently, if the client-server connection works, the added code will execute
every time a refresh of the screen is needed. This will severely slow down
performance. This issue will have to handled in the future.
3.2.3.6
Design constraints
None.
3.3
Software Interface Description
The software's interface(s) to the outside world are described.
3.3.1
External machine interfaces
The added code makes use of the wagMsgHandler.cpp class, which
uses an interface to the machine that runs the server.
3.3.2
External system interfaces
None.
3.3.3
Human interface
The human user will visibly see the other players walking around
in the game. The interface is purely output.
4
User interface design
A description of the user interface design of the software is
presented.
Class: CS-495 Spring 2004
Project: The Watson Game
Function: Client
Subsystem: 3D Character Display
Author: Matt Chedister
Date:12/10/2004
4.1
Description of the user interface
A detailed description of user interface including screen images
or prototype is presented.
4.1.1
Screen images
The following is the triangular shape that the user will see.
This triangle represents another player.
4.1.2
Objects and actions
The triangular shape seen above was rendered using test
coordinates in the code.
4.2
Interface design rules
The two triangles that were used were simple OpenGL triangle
renderings, made by the glBegin(GL_TRIANGLES) function call.
Class: CS-495 Spring 2004
Project: The Watson Game
Function: Client
Subsystem: 3D Character Display
Author: Matt Chedister
Date:12/10/2004
4.3
Components available
No GUI components are available from the added code.
4.4
UIDS description
No user interface development system was used.
5
Restrictions, limitations, and constraints
Without an internet connection, or without any other players in the
game, this added functionality is essentially useless.
6
Testing Issues
Test strategy and preliminary test case specification are presented in
this section.
6.1
Classes of tests
Most of the tests below are tests that should be run after the
server-client connection is working.
Primary black box testing
- Ensure successful connection to the server
- Ensure appropriate response from server
- Ensure correct data from server
- Ensure data from server is correctly used to triangulate the
triangles
Primary white box testing
- Ensure proper instantiation of objects
- Ensure that no infinite loops exist
- Ensure that there are no memory leaks
6.2
Expected software response
Once the server-client connection is up, testing should result in
minimal errors and bugs, due to the simplicity of the code.
Class: CS-495 Spring 2004
Project: The Watson Game
Function: Client
Subsystem: 3D Character Display
Author: Matt Chedister
Date:12/10/2004
6.3
Performance bounds
As stated previously, if the client-server connection works, the added code will
execute every time a refresh of the screen is needed. This will severely slow
down performance. This issue will have to handled in the future.
6.4
Identification of critical components
There are no critical components in the added code, as this added
feature does not add to the working functionality of the game as a
whole. It is cosmetic. That being stated, the critical components
in the scope of the added code include the server-client
communication and the messages that pass between both.
7
Appendices
Presents information that supplements the design specification.
7.1
Requirements traceability matrix
Components and structures
Floats for 3D coordinates
Message handlers
7.2
location
CWatsonGamePlay.cpp
wagMsgHandler.cpp
Packaging and installation issues
The added code does not affect the previous method of installation
and execution that existed prior.
7.3
Design metrics to be used
Integrity of the server-client connection and frames per second are
the two metrics that would be most beneficial to test the added
code.
7.4
Supplementary information (as required)
Class: CS-495 Spring 2004
Project: The Watson Game
Function: Client
Subsystem: 3D Character Display
Author: Matt Chedister
Date:12/10/2004
None.
Class: CS-495 Spring 2004
Project: The Watson Game
Function: Client
Subsystem: 3D Character Display
Author: Matt Chedister
Date:12/10/2004