woo-client-statistics

					                          Project: The Watson Game
                              Function: (Client)
                      Subsystem: Game Statistics Button
                             Author: WooJin Lee
                                Date: 12/06/04




Class: CS-495 Fall 2004                                   Author: Woo Jin Lee
Project: The Watson Game                                      Date:12/06/2004
Function: Client
Subsystem: Game Statistics Button
1      Introduction ................................................................................................................. 3
    1.1 Goals and objectives ............................................................................................. 3
    1.2 Statement of scope ................................................................................................ 3
    1.3 Software context ................................................................................................... 3
    1.4 Major constraints .................................................................................................. 3
2      Data design.................................................................................................................. 4
    2.1 Internal software data structure ............................................................................. 4
    2.2 Global data structure ............................................................................................. 4
    2.3 Temporary data structure ...................................................................................... 4
    2.4 Database description ............................................................................................. 4
3      Architectural and component-level design ................................................................. 4
    3.1 Program Structure ................................................................................................. 5
       3.1.1 Architecture diagram ..................................................................................... 5
       3.1.2 Alternatives .................................................................................................... 5
    3.2 Description for Component statPanel ................................................................... 6
       3.2.1 Processing narrative (PSPEC) for statPanel ................................................. 6
       3.2.2 statPanel interface description. ...................................................................... 6
       3.2.3 statPanel processing detail ............................................................................. 6
    3.3 Description for Component wagGLOBALSTATS .............................................. 7
       3.3.1 Processing narrative (PSPEC) for wagGLOBALSTATS ............................. 7
       3.3.2 wagGLOBALSTATS interface description. .................................................. 7
       3.3.3 wagGLOBALSTATS processing detail ........................................................ 7
    3.4 Software Interface Description ............................................................................. 8
       3.4.1 External machine interfaces ........................................................................... 8
       3.4.2 Human interface ............................................................................................. 8
4      User interface design................................................................................................... 8
    4.1 Description of the user interface ........................................................................... 8
       4.1.1 Screen images ................................................................................................ 8
       4.1.2 Objects and actions ...................................................................................... 10
    4.2 Interface design rules .......................................................................................... 10
    4.3 Components available ......................................................................................... 10
5      Restrictions, limitations, and constraints .................................................................. 11
6      Testing Issues ............................................................................................................ 11
    6.1 Classes of tests .................................................................................................... 11
    6.2 Expected software response ................................................................................ 11
    6.3 Performance bounds............................................................................................ 11
    6.4 Identification of critical components .................................................................. 11




Class: CS-495 Fall 2004                                                                                    Author: Woo Jin Lee
Project: The Watson Game                                                                                       Date:12/06/2004
Function: Client
Subsystem: Game Statistics Button
SOFTWARE DESIGN SPECIFICATION



1             Introduction
This document holds the specification for the game statistics button in
the client side of the WAG.


1.1            Goals and objectives
       The goal of the game statistics button function in the WAG is to
      display a set of relevant statistics retrieved from the server.
      The statistics shown will help the player see how he/she is
      progressing in contrast to how everyone else is performing.

1.2            Statement of scope
      The game statistics button will created using already defined
      objects from the 3D engine, which will consist of mainly the
      CGUIButton and CGUIPanel objects.

      When the statistics button is clicked on during game play, the
      client will make a request to the server to send the statistics
      information to the client, which will then be interpreted and
      displayed on the screen.


1.3            Software context
       Game statistics is a function that is only to be available to
       players that are already logged in. Given the limited nature of
       the information that is being passed from the server the client,
       the display will also include the Game status information on the
       same screen to reduce clutter.


1.4            Major constraints
       The WAG as it currently stands is seeing major deletions and
       additions to the database, which in turn will affect what kind of
       statistics can be garnered. As the program develops it is
       expected that the statistics function will be updated to reflect
       these additions.

         Also, since the button is reliant on the server to properly pass
         on the statistical information, it is possible that the wrong
         statistics will be displayed if the server either sends
         information in the wrong format or fails to calculate the
         statistics properly.
Class: CS-495 Fall 2004                                     Author: Woo Jin Lee
Project: The Watson Game                                        Date:12/06/2004
Function: Client
Subsystem: Game Statistics Button
2                Data design
The statistics button function will only be using two temporary strings
to perform its function. One will parse the message while the other
will temporarily hold a portion of the data that is being sent from the
server before it is displayed.


2.1                Internal software data structure
      Every GlobalStat object currently holds the following data
      structures:

      string    avgGPA;                  //holds the   Average GPA
      string    avgTime;                 //holds the   Avg Session Time
      string    avgNumSessions;          //holds the   Average number of sessions.
      string    avgNumChallenges;        //holds the   average number of challenges
                                           passed.
      string popmajor;                   //holds the   most popular major
      string popclass;                   //holds the   most popular class.

2.2                Global data structure
      None


2.3                Temporary data structure
      String parsed                 //parses the message being sent from the server
      String tempstring             //temporarily holds part of the statistical
                                    //information before it is displayed on screen.




2.4                Database description
      None




3                 Architectural and component-level design



Class: CS-495 Fall 2004                                               Author: Woo Jin Lee
Project: The Watson Game                                                  Date:12/06/2004
Function: Client
Subsystem: Game Statistics Button
3.1                  Program Structure
        A detailed description the program structure chosen for the
        application is presented.


3.1.1                          Architecture diagram



                                         Graphic Interface




                                                             Database
           CGUIPanel statPanel




                                     wagGLOBALSTATS           Server
          DisplayGlobalStats
                                         mystats




                                              avgGPA
                                              avgTime
                                          avgNumSessions
                                         avgNumChallenges
                                         popmajor popclass




3.1.2                          Alternatives
         It was possible to hold all the variables in an array like
structure but this was abandoned to keep readability to a maximum.




Class: CS-495 Fall 2004                                                 Author: Woo Jin Lee
Project: The Watson Game                                                    Date:12/06/2004
Function: Client
Subsystem: Game Statistics Button
3.2                Description for Component statPanel
3.2.1                  Processing narrative (PSPEC) for statPanel
             The statPanel is shown when the Statistics button or the F1
key clicked on during the game. It will stay present on screen until
the user cicks on “OK”. When statPanel is called, it will set the
characteristics of the panel (ie. Size, font color) and then will call
on the DisplayGlobalstats function to fill the panel up with
information.

3.2.2                   statPanel interface description.
            The user clicks on the “Statisiccs” button or presses the
F1 key to bring up the panel. Clicking on the “OK” button will get rid
of the panel.

3.2.3                 statPanel processing detail


3.2.3.1          Interface description
          See 3.2.2

3.2.3.2          Algorithmic model (e.g., PDL)
          N/A

3.2.3.3          Restrictions/limitations
          None

3.2.3.4          Local data structures

          statPanel.Init
          statPanel.SetSize
          statPanel.SetPosition
          statPanel.SetColor
          statPanel.SetBorderColor
          statPanel.SetOpacity;
          statPanel.SetBorderThickness
          statPanel.SetTextColor
          statPanel.SetTextPosition
          statPanel.SetTextShadowColor
          statPanel.SetLineSpacing
          statPanel.AddLine
          statPanel.SetTextFont


Class: CS-495 Fall 2004                                     Author: Woo Jin Lee
Project: The Watson Game                                        Date:12/06/2004
Function: Client
Subsystem: Game Statistics Button
3.2.3.5          Performance issues
          None

3.2.3.6          Design constraints
          Must be designed with the formatting of the other portions of the program in mind.


3.3                 Description for Component wagGLOBALSTATS
3.3.1                  Processing narrative (PSPEC) for wagGLOBALSTATS
            wagGLOBALSTATS is called by the statPanel. Its main
function is fLoadGLOBALSTATS(), which is used to load up all the
information that is then printed on the screen.

3.3.2                   wagGLOBALSTATS interface description.
                 N/A

3.3.3                  wagGLOBALSTATS processing detail
                 fLoadGLOBALSTATS() checks first to see if the server is
                 active. If so, it requests for the needed information,
                 parses it, saves it to the local variables, and then
                 returns a copy of the wagGLOBALSTATS object to the
                 statPanel.

                 In the absence of an active server fLoadGLOBALSTATS() is
                 set to pass a preset string in its place.

3.3.3.1          Interface description
          N/A

3.3.3.2          Algorithmic model (e.g., PDL)
          N/A

3.3.3.3          Restrictions/limitations
          None

3.3.3.4          Local data structures

          string avgGPA;
          string avgTime;
          string avgNumSessions;
          string avgNumChallenges;
          string popmajor;
Class: CS-495 Fall 2004                                                  Author: Woo Jin Lee
Project: The Watson Game                                                     Date:12/06/2004
Function: Client
Subsystem: Game Statistics Button
          string popclass;


3.3.3.5          Performance issues
          None

3.3.3.6          Design constraints
          Must be designed with the formatting of the other portions of the program in mind.


3.4                      Software Interface Description

       The interface to the world is all done via the GUI engine. The statistics function
      can be accessed by either the F1 key or by clicking on the button with the mouse.

3.4.1                   External machine interfaces
          Each client interfaces with the server in order to get the
          information from the database.

3.4.2                   Human interface
          The only way a player can interface with the game statistics
          button is by clicking on the statistics button.

4                 User interface design
4.1                 Description of the user interface
      Clicking on either the statistics button or pressing the F1 key
      brings up the Global Game Statistics screen. Pressing OK once
      you’re in the screen brings the user back to the game.

4.1.1                Screen images




Class: CS-495 Fall 2004                                                  Author: Woo Jin Lee
Project: The Watson Game                                                     Date:12/06/2004
Function: Client
Subsystem: Game Statistics Button
Class: CS-495 Fall 2004             Author: Woo Jin Lee
Project: The Watson Game                Date:12/06/2004
Function: Client
Subsystem: Game Statistics Button
4.1.2               Objects and actions
             Clicking on the Statistics button of pressing the F1 button
will bring up the Global Game Statistics screen. Once in the Global
Game Statistics Screen, the game statistics will be shown on the bottom
portion of the menu, with an OK button that will bring the player out
of the menu.

The empty space on the top of the screen will eventually be filled with
the Game status information.


4.2                Interface design rules
      All the button sizes have been made to follow the sizes being used
      by all the other functions. The color and size of the font is also
      the same as the one used in the other parts of the program.


4.3                Components available
      N/A
Class: CS-495 Fall 2004                                   Author: Woo Jin Lee
Project: The Watson Game                                      Date:12/06/2004
Function: Client
Subsystem: Game Statistics Button
5                Restrictions, limitations, and constraints
      With the current lack of any scrolling feature in the text boxes
      used, there is currently a limit on how much information can be
      displayed at once.

      Unless this capability is added soon, future iterations of the
      statistics function must either be implemented in a different screen
      from the Active players list or get rid of some of the current
      metrics being used.



6                Testing Issues

6.1                Classes of tests
        Given the fact that the server is still not functional, the Game
        Stats Button was tested by sending predetermined message into the
        function and seeing if the proper result was shown.

6.2                Expected software response
        Once the statistics button is pressed, it should display the game
       statistics in the correct areas, with the input string properly
       parsed.

6.3                Performance bounds
       None


6.4                Identification of critical components
       The Command component and the message handler are the most
       important part in testing this function.




Class: CS-495 Fall 2004                                    Author: Woo Jin Lee
Project: The Watson Game                                       Date:12/06/2004
Function: Client
Subsystem: Game Statistics Button