srs-commented by ashrafp

VIEWS: 6 PAGES: 33

									Software Requirement Specification




   Dragon and Dungeon Game
         On Palm Pilot




                       Authors:
    Michelle Brennan, Daniel Dugi, Adrian Elizondo,
              Robert Hickey, Joey Valdez




                    Revision 1.0
                  February 21, 2001
Michelle Brennan, Daniel Dugi, Adrian Elizondo, Robert Hickey, Joey Valdez   Revision 1.0



                              Table of Contents

1. Introduction                                                4
  1.1 Purpose                                                  4
  1.2 Scope                                                    4
  1.3 Definitions, acronyms, and abbreviations                 4
  1.4 References                                               5
  1.5 Overview                                                 5

2. Overall description                                         6
  2.1 Product perspective                                      6
  2.2 Product functions                                        6
  2.3 User characteristics                                     6
  2.4 Constraints                                              6
  2.5 Assumptions and dependencies                             7

3. Specific Requirements                                       8
  3.1 Functional Requirements                                  8
      3.1.1 The operating system interface                     8
          3.1.1.1 Introduction                                 8
          3.1.1.2 Inputs                                       8
          3.1.1.3 Processing                                   8
          3.1.1.4 Outputs                                      8
      3.1.2 Menu                                               8
          3.1.2.1 Introduction                                 8
          3.1.2.2 Inputs                                       9
          3.1.2.3 Processing                                   9
          3.1.2.4 Outputs                                      9
      3.1.3 Playing field creation (The Dungeon)               9
          3.1.3.1 Introduction                                 9
          3.1.3.2 Inputs                                       9
          3.1.3.3 Processing                                   9
          3.1.3.4 Outputs                                      10
      3.1.4 Maze Creation                                      10
          3.1.4.1 Introduction                                 10
          3.1.4.2 Inputs                                       10
          3.1.4.3 Processing                                   10
          3.1.4.4 Outputs                                      10
      3.1.5 Initial game setup                                 11
          3.1.5.1 Introduction                                 11
          3.1.5.2 Inputs                                       11
          3.1.5.3 Processing                                   11
          3.1.5.4 Outputs                                      11




Dr. Greg Hall                                                                 1 of 32
Michelle Brennan, Daniel Dugi, Adrian Elizondo, Robert Hickey, Joey Valdez   Revision 1.0


      3.1.6 Calculate placement of treasure and dragon         12
          3.1.6.1 Introduction                                 12
          3.1.6.2 Inputs                                       12
          3.1.6.3 Processing                                   12
          3.1.6.4 Outputs                                      12
      3.1.7 Warrior movement                                   12
          3.1.7.1 Introduction                                 12
          3.1.7.2 Inputs                                       12
          3.1.7.3 Processing                                   13
          3.1.7.4 Outputs                                      14
      3.1.8 Dragon movement                                    14
          3.1.8.1 Introduction                                 14
          3.1.8.2 Inputs                                       14
          3.1.8.3 Processing                                   14
          3.1.8.4 Outputs                                      15
      3.1.9 Sound generator                                    15
          3.1.9.1 Introduction                                 15
          3.1.9.2 Inputs                                       15
          3.1.9.3 Processing                                   15
          3.1.9.4 Outputs                                      15
      3.1.10 Warrior vs. Warrior (2 player mode)               16
          3.1.10.1 Introduction                                16
          3.1.10.2 Inputs                                      16
          3.1.10.3 Processing                                  16
          3.1.10.4 Outputs                                     17
      3.1.11 The infrared interface                            17
          3.1.11.1 Introduction                                17
          3.1.11.2 Inputs                                      17
          3.1.11.3 Processing                                  17
          3.1.11.4 Outputs                                     17
      3.1.12 Exiting the game                                  18
          3.1.12.1 Introduction                                18
          3.1.12.2 Inputs                                      18
          3.1.12.3 Processing                                  18
          3.1.12.4 Outputs                                     18
  3.2 External Interface Requirements                          19
      3.2.1 User Interfaces                                    19
      3.2.2 Hardware Interfaces                                19
      3.2.3 Communication Interfaces                           19
  3.3 Performance Requirements                                 19
  3.4 Design Constraints                                       20




Dr. Greg Hall                                                                 2 of 32
Michelle Brennan, Daniel Dugi, Adrian Elizondo, Robert Hickey, Joey Valdez   Revision 1.0


  3.5 Attributes                                               20
      3.5.1 Reliability                                        20
      3.5.2 Availability                                       20
      3.5.3 Security                                           20
      3.5.4 Maintainability                                    20
      3.5.5 Portability                                        21

Appendix A – Project Description                               22
Appendix B – Game Board Layout                                 23
Appendix C – Game Rule Summary                                 26
Appendix D – Game Sounds                                       31
Appendix E – PalmIIIxe Buttons                                 32




Dr. Greg Hall                                                                 3 of 32
Michelle Brennan, Daniel Dugi, Adrian Elizondo, Robert Hickey, Joey Valdez      Revision 1.0



1. Introduction
   1.1 Purpose
       This document specifies to customers and designers the software requirements for
       adapting Mattel Electronics’ computer labyrinth game, Dungeons & Dragons, to
       3Com’s Palm Pilot Personal Digital Assistant.

   1.2 Scope
       The Palm Pilot labyrinth game, Dragons & Dungeons, is played on a 160x160 pixel,
       black and white screen using the stylus and five buttons (see Appendix E) as the
       primary input devices. Memory is limited to 8MB.

   1.3 Definitions, acronyms, and abbreviations (TBA)

          Labyrinth – a structure containing an intricate network of winding passages hard
           to follow without losing one’s way; maze. (Webster’s New World Dictionary,
           Second College Edition).
          Dragon – A mythical gigantic reptilian beast that guards the treasure and tries to
           eliminate the warrior(s) by flying and attacking them. The player's only nemesis in
           a single player game.
          Treasure – the object of the game, which is guarded by the dragon.
          Warrior – a player of the game.
          Secret Room – a square of the grid, chosen by the player, from which to begin the
           game. Also the end point of the game.
          Treasure Room – a square of the grid initially occupied by the dragon, which
           contains the treasure.
          Parameters – an ordered set of information shared by two or more functions of a
           program.
          Application – the software that can be launched by the Palm OS. This SRS
           describes the application named Dragons & Dungeons.
          Launch – the action of the Palm OS calling a new application to run.
          Pass – the action of calling another function within an application. There is an
           option of passing parameters to the function that control is being passed to.
          Call – the action of any function giving up control to another function.
          User Input – selections made by the Palm device user. Either by pressing buttons
           or taps on the Palm device screen with a stylus.
          API – Application Programmer’s Interface
          GCC – GNU Compiler Collection
          IR – infrared
          IrDA – Infrared Data Association
          PDA – Personal Digital Assistant
          SRS - Software Requirement Specification



Dr. Greg Hall                                                                    4 of 32
Michelle Brennan, Daniel Dugi, Adrian Elizondo, Robert Hickey, Joey Valdez       Revision 1.0



   1.4 References (TBA)

          Dungeons & Dragons Computer Labyrinth Game Instructions, Mattel Electronics,
           1980.
          IEEE STD 830-1998, IEEE Recommended Practice for Software Requirements
           Specifications, IEEE Inc., 1998.
          Palm OS Programming Bible, Foster, Lonnon R., 2000.
          Palm Handbook For the Palm III series, Palm Computing Inc., 1998-1999.
          C++ Programming Style Guide
          Palm OS Programmer’s Companion, Palm Computing Inc., 2000.


   1.5 Overview

       The remainder of this document contains the following:

       2.0 Overall Description – general factors which affect Dragons & Dungeons and its
       requirements.
       2.1 Product Perspective – describes the relationship of Dragons & Dungeons to the
       Palm Pilot environment.
       2.2 Product functions – provides a summary of the major functions of Dragons &
       Dungeons and their relationships to each other.
       2.3 User characteristics – describes the general characteristics of the intended users of
       Dragons & Dungeons.
       2.4 Constraints – describes any factors, which limit development options.
       2.5 Assumptions and dependencies – lists changes in design constraints that can affect
       requirements.
       3.0 Specific Requirements – describes all of the software requirements needed to
       implement Dragons & Dungeons.
       3.1 Functional Requirements – the fundamental actions that must take place in the
       software for processing inputs and generating outputs.
       3.2 External Interface Requirements – a detailed description of all inputs received
       and outputs generated by Dragons & Dungeons.
       3.3 Performance Requirements – specifies the static and dynamic numerical
       requirements placed on the Dragons & Dungeons software and human interaction with
       it.
       3.4 Design Constraints – specifies design constraints imposed by existing standards
       and regulations, and hardware limitations.
       3.5 Attributes – specifies requirements defined by software attributes such as
       reliability, availability, security, maintainability, and portability.




Dr. Greg Hall                                                                      5 of 32
Michelle Brennan, Daniel Dugi, Adrian Elizondo, Robert Hickey, Joey Valdez         Revision 1.0




2. Overall description
   2.1 Product perspective
       This product is a fully functional application that must be installed and controlled on a
       handheld PDA device utilizing a Palm OS with a software version of 3.5 or higher.

   2.2 Product functions
       This product is an interactive application with one or two-player modes. In one-player
       mode, the user will challenge the Palm device running the application. In two-player
       mode, the users can launch the application on one PDA device or two PDA devices. If
       two PDA devices are selected, user actions will be coordinated via the infrared ports of
       the devices.

   2.3 User characteristics
       To launch the application effectively, the user should understand how to operate a Palm
       device, be familiar with the control buttons, and understand the game rules and
       directions as described in this SRS.


   2.4 Constraints
       This product is designed for a Palm device with a LCD display. This product will not
       be color enhanced on Palm devices with an 8-bit color display or higher.

       Since the typical memory available on Palm devices is 2MB, the application will have
       to share memory with other applications. Therefore, the size of the application’s
       executable code must be minimized.

       We will assume that this software will be developed using the developer tools that are
       recommended by Palm OS. To date, the developer tools being utilized are Palm OS
       SDK 3.5 and PilRC 2.7a. In addition, applications are typically developed in C. Two
       viable development environments are Metrowerks CodeWarrior for Palm Computing
       platforms and GNU PRC-Tools.




Dr. Greg Hall                                                                       6 of 32
Michelle Brennan, Daniel Dugi, Adrian Elizondo, Robert Hickey, Joey Valdez     Revision 1.0


   2.5 Assumptions and dependencies
       We will assume that the software product described, herein, will run on any handheld
       PDA device utilizing a Palm OS. Portability to other operating systems is not a
       requirement and portability issues are not within the scope of this document.

       The application is dependent on a Palm OS version 3.5 or higher and will not be color
       enhanced.




Dr. Greg Hall                                                                    7 of 32
Michelle Brennan, Daniel Dugi, Adrian Elizondo, Robert Hickey, Joey Valdez         Revision 1.0



3. Specific Requirements
   3.1 Functional Requirements

        3.1.1 The operating system interface

                3.1.1.1 Introduction
                The application requires an interface to the operating system. This will be the
                function of starting the application cleanly. The user will see an icon on the
                “Applications Launcher” screen. When this icon is tapped with the stylus, this
                application will be launched.

                3.1.1.2 Inputs
                The user requests start by tapping the Dragons & Dungeons icon on the
                “Applications Launcher” screen.

                3.1.1.3 Processing
                This function must be visible to the operating system. The parameters from the
                operating system must be properly interpreted to correctly start the application.

                3.1.1.4 Outputs
                Signal the start of a new game.


        3.1.2 Menu

                3.1.2.1 Introduction
                There will be a menu that is accessed by the user tapping on the “Menu Icon” on
                the Palm device screen. This menu will contain “Player Mode”(1 or 2 players),
                “Play Another Palm”, “Play Sounds”, “New Game”, “Help”, “About” and
                “Exit.”

                Any submenus or alert boxes will need a “Done” or “OK” to dismiss them.




Dr. Greg Hall                                                                        8 of 32
Michelle Brennan, Daniel Dugi, Adrian Elizondo, Robert Hickey, Joey Valdez          Revision 1.0


                3.1.2.2 Inputs
                User selections made by taps with the Palm stylus or by the Palm buttons.

                3.1.2.3 Processing
                The menu will need to be accessible anytime this application is running. All
                selections within the menu must be accessible and supported while this
                application is running. The selection made will cause additional functions or
                files to be called to support the selection. Submenus will need to be created as
                necessary and the handling of these submenus will need to be supported.
                Leaving the menu will cause return to the game or exit.

                Tapping a selection with the stylus will call that function. Scrolling with the UP
                – DOWN button will highlight the selection and the SELECT button will call
                that function. (Appendix E – PalmIIIxe Buttons)

                3.1.2.4 Outputs
                Menu and possible submenus are displayed on the Palm screen. Exit selection
                causes return to the operating system.

        3.1.3 Playing field creation (The Dungeon)

                3.1.3.1 Introduction
                A playing field must be created. This is a grid of 64 square cells that are placed
                in 8 columns with 8 rows. These cells are completely bordered and share
                common borders except for the outer perimeter. (Appendix B – Game Board
                Layout)

                3.1.3.2 Inputs
                None.

                3.1.3.3 Processing
                The bordering is calculated to be properly oriented and fit the screen. Lines 1
                pixel in width will be drawn to the screen to form the playing grid.




Dr. Greg Hall                                                                        9 of 32
Michelle Brennan, Daniel Dugi, Adrian Elizondo, Robert Hickey, Joey Valdez        Revision 1.0


                3.1.3.4 Outputs
                This function will draw the dungeon basic grid to the screen.

        3.1.4 Maze Creation

                3.1.4.1 Introduction
                Where the cells share common borders a maze of walls must be created that
                allow the warrior(s) to pass through the dungeon. There never will be more than
                3 walls around any cell so no cell is completely closed off. This maze is
                different each time the game is played.

                3.1.4.2 Inputs
                None.

                3.1.4.3 Processing
                An appropriate algorithm will be used to create an adequately random maze that
                repeating mazes are unlikely. There will always be at least one access point
                between cells in this maze so no cell will be completely closed off. This maze is
                to be stored throughout the game and may be modified by other functions. Once
                the maze is completed, player 1 will be signaled to start.

                3.1.4.4 Outputs
                There is a warrior 1 sound signal (Appendix D – Game Sounds), which indicates
                that the game has started and it is warrior 1’s turn.




Dr. Greg Hall                                                                     10 of 32
Michelle Brennan, Daniel Dugi, Adrian Elizondo, Robert Hickey, Joey Valdez            Revision 1.0


        3.1.5 Initial game setup

                3.1.5.1 Introduction
                The game, after launch, will need to get information about how many players
                and where the selected secret room (s) is (are). Once selections are made, the
                location of the secret room (s) are indicated to the user (s) by placing an
                appropriate icon (each warrior will have a unique icon) in the selected cell (s).
                Since users are allowed to change their minds as to that location until the next
                turn button is pressed, this function must allow changes by each player until the
                next turn button is pressed by the user making the selection. Warrior 1 will
                select and then warrior 2 will select. When a player changes his or her mind the
                secret room icon will need to be moved to the new location if it is still his or her
                turn.

                3.1.5.2 Inputs
                The user (s) make appropriate selections with either buttons or the stylus.

                3.1.5.3 Processing
                This function will need to prompt for the number of players (1 or 2).
                Then the function will need to calculate what cell is (are) the secret room (s)
                using user input. This function will wait until the appropriate selections are
                made or quit if the user aborts. When the secret room (s) have been selected,
                icons will be drawn at the selected cell (s) to indicate to the user (s) where the
                secret room (s) location (s) is (are). If a user changes his or her mind the icon
                will be relocated to the newly selected cell only if it is still that users turn. The
                secret room selection is not permanent until the NEXT TURN button is pressed.

                3.1.5.4 Outputs
                Icons are drawn on the playing field to indicate the location of the secret room.
                This will be where the warrior begins and where he will be returned if he is
                attacked by the dragon.




Dr. Greg Hall                                                                         11 of 32
Michelle Brennan, Daniel Dugi, Adrian Elizondo, Robert Hickey, Joey Valdez         Revision 1.0


        3.1.6 Calculate placement of treasure and dragon

                3.1.6.1 Introduction
                The treasure and dragon are placed in a treasure room, which are at least 3 cells
                away from any warrior. This function will need to determine that location.

                3.1.6.2 Inputs
                None.

                3.1.6.3 Processing
                The relative distances will be calculated and 1 cell will be selected and marked
                as containing treasure and dragon. This selection will meet the requirement of
                being at least 3 cells away from any warrior. Any cell that is outside of the 3
                cell perimeter (s) will be randomly selected as the treasure room.

                3.1.6.4 Outputs
                The location of the treasure room is added to the maze. Upon completion, the
                warrior 1 sound will be made (Appendix D – Game Sounds) to indicate that it is
                his move.


        3.1.7 Warrior movement

                3.1.7.1 Introduction
                Warrior 1 or 2 will be allowed moves according to the rules of the game.
                (Appendix C – Game Rule Summary) This function will handle those
                movements. The number of cells a warrior can move depends on 3 variables:
                Number of dragon attacks, whether he has encountered a wall and if he is
                carrying the treasure. Sounds will be generated according to the game sound
                specification. (Appendix D – Game Sounds)

                3.1.7.2 Inputs
                Move selections by the user (s). Buttons or the stylus can be used to make the
                selection. (Appendix E – PalmIIIxe Buttons)




Dr. Greg Hall                                                                      12 of 32
Michelle Brennan, Daniel Dugi, Adrian Elizondo, Robert Hickey, Joey Valdez          Revision 1.0


                3.1.7.3 Processing
                Upon entry it will be determined if warrior 1 or 2 are moving. The
                corresponding WARRIOR tune will be played to indicate that that player should
                move.

                This function will accept button or stylus input from the user. It will perform
                calculations and decisions if a wall has been encountered or the warrior is
                allowed the move. It must also decide if another warrior has been encountered,
                the dragon has been encountered or the treasure has been discovered.

                At the beginning of the game, each player can move his warrior a maximum of 8
                squares per turn. Once a warrior has been attacked by the dragon, he can make
                6 moves. If twice the dragon has attacked a warrior, he can only make 4 moves.
                If a warrior has the treasure he can only move 4 times.

                A warrior is moved to a new cell by pressing the direction button in that
                direction or by taps with the stylus. A warrior can be moved UP, DOWN, LEFT
                or RIGHT, but cannot move diagonally. The WARRIOR MOVES sound is a
                legal move. When a legal move is made the icon for the warrior moving will be
                redrawn in the selected cell. Skipping over squares, diagonal movement, hitting
                a wall that has been drawn, attempt to cross the outer perimeter or tapping only
                the final square of the move will cause an ILLEGAL MOVE buzz. In the event
                of an illegal move there will be no movement indicated and the player will try
                again.

                A player can turn corners as often as he likes, but he cannot move through walls.
                When he hits a wall that is hidden, he will hear the WALL sound. There will be
                no movement indicated and the wall will be drawn on the grid. His turn is over.
                A player does not have to make all 8 possible moves in one turn. He can stop at
                any time by pressing the NEXT TURN button. This will end his turn.

                Both warriors can safely occupy the same cell, as long as neither of them has the
                treasure. When two warriors temporarily land on the same cell, the second
                warrior may continue to move for his full turn. If it is his final move, he will
                wait until the first warrior moves again. Once the first warrior moves away, the
                second warrior icon will be placed on the cell.

                In the event any warrior moves to 3 cells or closer to the dragon, if the dragon is
                in the treasure room, the DRAGON WAKES sound will be made.

                In the event a warrior enters the treasure room, the TREASURE TUNE is played
                and it is the end of his turn. His icon will be highlighted to indicate he has the
                treasure.




Dr. Greg Hall                                                                       13 of 32
Michelle Brennan, Daniel Dugi, Adrian Elizondo, Robert Hickey, Joey Valdez           Revision 1.0


                If a warrior carries the treasure back to his secret room there will be the
                WINNER tune and the game is over. Draw to the screen “Warrior x Wins.”

                3.1.7.4 Outputs

                A variety of sounds: WARRIOR 1, WARRIOR 2, WARRIOR MOVES,
                ILLEGAL MOVE, WALL, DRAGON WAKES, TREASURE and WINNER.
                The warrior icons are redrawn to cells moved to and hidden walls are drawn
                when encountered.

        3.1.8 Dragon movement

                3.1.8.1 Introduction
                Once the dragon is awake he will chase warriors and try to land on top of them.
                This function will handle the dragon movement.

                3.1.8.2 Inputs
                None.

                3.1.8.3 Processing
                If the dragon has been awakened by any warrior by being 3 cells or closer to the
                treasure room he will be able to move towards the closest warrior 1 cell at a time
                until the game is over. The dragon will only move after the warrior (s) have
                moved. The dragon can move in any direction, including diagonally, and fly
                over walls. When the dragon flies there is the DRAGON FLYING sound and
                when the dragon attacks there is the DRAGON ATTACKS sound. (Appendix D
                – Game Sounds)

                The dragon chases the closest warrior and will alter direction should another
                warrior come closer. Should the dragon land on the cell a warrior occupies, the
                warrior has been attacked. The WARRIOR tune sound and then the DRAGON
                ATTACKS sound are produced. The attacked warrior is sent back to his secret
                room and his moves are reduced to 6 if this is the first attack and to 4 if this is
                the second attack. If the attacked warrior has two previous attacks, the
                DEFEAT TUNE is sounded and the warrior is removed from the game and his
                icon is removed from the dungeon. If there is only one warrior, the game ends.
                The end of the game is indicated by outputting the message “Game Over” to the
                screen.

                If the dragon lands on a warrior with the treasure, then that warrior is defeated.
                The appropriate WARRIOR tune and then the DEFEAT TUNE are sounded.
                The treasure is returned to the treasure room. The defeated warrior’s icon is



Dr. Greg Hall                                                                        14 of 32
Michelle Brennan, Daniel Dugi, Adrian Elizondo, Robert Hickey, Joey Valdez           Revision 1.0


                removed from the dungeon. If there is only one warrior, the game ends. The
                end of the game is indicated by outputting the message “Game Over” to the
                screen.

                In two-player mode, if the dragon lands on a cell occupied by both warriors, the
                weaker warrior will be the one attacked. The strength of the warriors is not a
                function of their ability to move. (Refer to Sec. 3.1.10.4) The dragon and the
                stronger warrior remain on the same cell until the warrior moves away. If the
                stronger warrior chooses to remain in that cell after his turn, he will be attacked.


                3.1.8.4 Outputs
                A variety of sounds: WARRIOR 1, WARRIOR 2, DRAGON FLYING,
                DRAGON ATTACKS and DEFEAT TUNE. Defeated warrior removed from
                the screen. “Game Over” message output to the screen.

        3.1.9 Sound generator

                3.1.9.1 Introduction
                This function will provide the interface and produce the sounds required to play
                Dragons & Dungeons. These sounds will be unique and try to closely emulate
                the sounds generated by the original game. For the list of sounds refer to
                Appendix D – Game Sounds.

                3.1.9.2 Inputs
                The code for the sound required. This can come from the game or user input.

                3.1.9.3 Processing
                The sound code is decoded and the desired sound is produced through the
                system. Various algorithms may be needed to produce the multiplicity of
                sounds.

                3.1.9.4 Outputs
                The sound requested is produced.




Dr. Greg Hall                                                                        15 of 32
Michelle Brennan, Daniel Dugi, Adrian Elizondo, Robert Hickey, Joey Valdez          Revision 1.0


        3.1.10 Warrior vs. Warrior (2 player mode)

                3.1.10.1 Introduction
                In the two-player mode, if one of the warriors has the treasure the other warrior
                can try to take the treasure away. This function will handle warrior-to-warrior
                combat.

                3.1.10.2 Inputs
                Two warriors and a treasure occupy the same cell.

                3.1.10.3 Processing
                Each warrior has a strength value, which is reduced by 1 each time the warrior is
                moved. The strength value determines the stronger warrior. At times
                throughout play these strength values will be reset to maximum.

                When both warriors and the treasure are present in one cell a combat ensues.
                The stronger warrior wins and the appropriate WARRIOR tune is sounded and
                then the TREASURE TUNE. The appropriate warrior icon is redrawn as
                highlighted, indicating he has the treasure. The winner’s ability to move is set to
                4 moves, because he has the treasure. The loser’s ability to move is reset to
                whatever it was before he gained the treasure.

                If both warriors remain on the same cell and the dragon attacks by landing on
                that cell, then the weaker warrior has been attacked and is sent back to his secret
                room. The dragon and the stronger warrior remain on the same cell until the
                warrior moves away. If the stronger warrior chooses to remain in that cell after
                his turn, he will be attacked. Note: This would be unwise because he now has
                the treasure and will be defeated.

                There are a number of ways in which warrior vs. warrior combat can occur.
                Each has a different result.

                WARRIOR WITH TREASURE LANDS ON CELL OCCUPIED BY OTHER
                WARRIOR:
                 1) If warrior with treasure has not used his maximum of 4 moves, whether
                 he wins or loses, the warrior with treasure may continue moving, up to his
                 maximum number of moves. If he wins, that maximum stays at 4 moves. If
                 he loses, that maximum returns to whatever it was before he took the treasure
                 (6 or 8 moves).
                 2) If warrior with treasure has used his maximum of 4 moves, if he wins, he
                 must stop. His turn is over. If he loses, he may continue moving, since his
                 maximum returns to whatever it was before he took the treasure (6 or 8
                 moves).


Dr. Greg Hall                                                                       16 of 32
Michelle Brennan, Daniel Dugi, Adrian Elizondo, Robert Hickey, Joey Valdez       Revision 1.0



                OTHER WARRIOR LANDS ON CELL OCCUPIED BY WARRIOR WITH
                TREASURE:
                 1) If the other warrior has moved less than 4 cells, whether he wins or loses,
                 he may continue moving up to his maximum number of moves. If he loses,
                 that maximum remains whatever it was before combat (6 or 8 moves).

                 2) If other warrior has moved at least 4 cells but less than his maximum, if
                 he wins, he must stop. The treasure reduces his maximum to 4 moves. If he
                 loses, he may continue moving, up to his maximum (6 or 8 moves).

                 3) If other warrior has used his maximum number of moves, whether he
                 wins or loses, he must stop. His turn is over.

                3.1.10.4 Outputs
                The winner is announced by the appropriate WARRIOR tune followed by the
                TREASURE TUNE. The winner’s icon is highlighted to indicate he has the
                treasure.

        3.1.11 The infrared interface

                3.1.11.1 Introduction
                When the option of playing in two-player mode on two Palm devices is selected,
                this function must handle the communication between Palm devices. This will
                use the IR Port on the Palm device.

                3.1.11.2 Inputs
                Infrared signals from the other Palm device.

                3.1.11.3 Processing
                There will need to be two modes of processing - Client and Server. There will
                be one Palm device selected as the server with the home player as client 1 and
                the other Palm device as client 2. The server will synchronize the game and
                pass information to the clients.

                3.1.11.4 Outputs
                Infrared signals are sent to the other Palm device.




Dr. Greg Hall                                                                     17 of 32
Michelle Brennan, Daniel Dugi, Adrian Elizondo, Robert Hickey, Joey Valdez          Revision 1.0


         3.1.12 Exiting the game

                3.1.12.1 Introduction
                When either the user chooses to abort play or there is defeat, then the application
                must exit cleanly.

                3.1.12.2 Inputs
                The user elects to quit or play again.

                3.1.12.3 Processing
                In the event of abort or defeat the user can elect to “Play again” or “Quit.” An
                alert box must be created to allow the user to choose. The user can make his
                selection either with the Palm buttons or the stylus.

                If quitting, then all used resources and files will be closed. If applicable, the
                server must notify the clients to exit and release resources. Then, control will be
                passed back to the system.

                If playing again, then the game must be reinitialized. If applicable, the server
                must notify the clients to exit and release resources. The user will then be
                presented with a new game.


                3.1.12.4 Outputs
                The user will be presented with an alert box to elect to “Play again” or “Quit.”




Dr. Greg Hall                                                                       18 of 32
Michelle Brennan, Daniel Dugi, Adrian Elizondo, Robert Hickey, Joey Valdez         Revision 1.0


   3.2 External Interface Requirements

        3.2.1 User Interfaces
                The application will have a graphical user interface with the following
                characteristics:

                      The interface will be based on the guidelines outlined in chapter 2 of the
                       Palm OS Programmer’s Companion.
                       Screen resolution will be limited to 160 x 160 pixels.
                      An icon for launching the application will be visible to the user as
                       specified in section 3.1.1.
                      A menu bar will appear on every screen with various sub-menus as
                       specified in section 3.1.2.
                      Palm OS alert dialogs will be used to display an error message any time
                       the user’s last action caused an error or could not be completed.

        3.2.2 Hardware Interfaces
                The application will not directly interface with any hardware. Any manipulation
                of the Palm device’s hardware will be accomplished by utilizing the API of the
                Palm OS.

        3.2.3 Communication Interfaces
                The application will utilize the low-level and/or high-level infrared
                communication (IR) interfaces of the Palm OS when the application’s two-
                player mode has been selected. The IR support provided by the Palm OS is
                compliant with the specifications set forth by the IrDA (Infrared Data
                Association). The Palm OS implements all the required protocol layers as
                outlined in Chapter 10 of the Palm OS Programmer’s Companion.

   3.3 Performance Requirements
        The application shall respond to the inputs of one user in one-player mode and to the
        inputs of two users in two-player mode. 100% of all user inputs shall be responded to
        by the application within 1 second. The application shall also have access to
        sufficient system memory to handle all user inputs.




Dr. Greg Hall                                                                      19 of 32
Michelle Brennan, Daniel Dugi, Adrian Elizondo, Robert Hickey, Joey Valdez       Revision 1.0


   3.4 Design Constraints
        This application is designed to run on any hand held device running Palm OS 3.5 or
        higher. The available memory of PDA devices will limit the size of this application.
        Interaction with this application is limited to the input devices available on the PDA
        namely the touch screen, stylus, and shortcut buttons. Maximum screen resolution on
        PDAs is typically near 160 X 160 pixels. This will limit the display capabilities of the
        application. Color support is also limited. Sound will be limited to sound support
        provided by the Palm OS 3.5.

   3.5 Attributes

        3.5.1 Reliability

             A PDA device running Palm OS 3.5 or higher is required to insure the reliability
               of this application.
             Operational shortcut buttons and a stylus are required to reliably interact with
               the application.
             An additional requirement of two-player/two-device mode is an operational
               infrared port.

        3.5.2 Availability

               Once properly installed, this application will always be available to the user.
               The user can expect no down time for maintenance.
               Two player mode:
                  Two PDA devices running Palm OS 3.5 or higher are required for the
                     two-player/two-device mode.
                  Both devices in two-player/two-device mode must have the same version
                     of the application installed on them.

        3.5.3 Security

               This application will safely ignore extraneous stylus taps and button presses.


        3.5.4 Maintainability

               A structural approach will be followed when writing the code. Functions will
                be used to impose order in the code.
               The source code will be written and documented so as to adhere to the C++
                Programming Style Guide provided by Dr. Hall.




Dr. Greg Hall                                                                     20 of 32
Michelle Brennan, Daniel Dugi, Adrian Elizondo, Robert Hickey, Joey Valdez      Revision 1.0


        3.5.5 Portability

               This application will not be portable to PDA’s running any operating system
                other than Palm OS 3.5 or higher.
               Measures will be taken to make this application compatible with later versions
                of Palm OS.




Dr. Greg Hall                                                                   21 of 32
Michelle Brennan, Daniel Dugi, Adrian Elizondo, Robert Hickey, Joey Valdez        Revision 1.0



Appendix A – Project Description

Dragons & Dungeons Board Game
This application will be a Palm OS game that is functionally equivalent to the Mattel Dungeons
& Dragons electronic board game. The object of the game is to find the treasure and take it to
the exit without being caught by the dragon. There are one and two player modes for the
game. The process of the one player game is as follows:
The game board consists of a grid. Players establish one square on the grid as their "home
base." During a player's turn, the player may move up, down, left or right. If a wall blocks the
players movement in the desired direction, a sound is made to indicate the obstruction and the
player's turn ends (they remain on the current square). A wall marker is placed on the board to
indicate where the wall was found. If no obstruction exists, a positive confirmation tone is
made and the player moves to the new square. If the player gets within a certain radius of the
treasure, the dragon awakens (a tone is made that indicates this). From that point on, the
dragon takes a turn (after the player) and chases the nearest player. The player must find the
gold and return to "home base" without being caught by the dragon (the dragon lands on the
same square as the player). A sound is made to indicate the dragon's turn after it is awakened.
An algorithm will be needed that will create a maze at random that has no disconnected
sections (there must be a path from any square on the board to any other square. For more info
on maze generation, visit:
http://www.easystreet.com/~jkirwan/misc004.html
http://www.siteexperts.com/tips/functions/ts20/page3.asp
An algorithm is needed to handle the dragon chasing the nearest player.
In two-player mode, the game will synchronize with another Palm device to allow the players
to take turns.
The original rules and game will be made available to the group so that they may learn more
about how their product should behave.
Graduate Supervisor
Ann Hung - Ann_Hung@Dell.com

Group Members
Michelle Brennan - mbrennan@swt.edu
Daniel Dugi - dandugi@yahoo.com
Adrian Elizondo - aae@gvtc.com
Robert Hickey - rhickey@swt.edu
Joey Valdez - joeyv@satx.rr.com




Dr. Greg Hall                                                                     22 of 32
Michelle Brennan, Daniel Dugi, Adrian Elizondo, Robert Hickey, Joey Valdez       Revision 1.0



Appendix B – Game Board Layout

                                     Dragons & Dungeons
                                        Board Layout


                              CS4398 Project - Robert Hickey 2/3/2001
This information is from the actual (21 year old) Mattel Electronics Dungeon & Dragons game
                                      owned by Dr. Hall.


                                      1    2    3    4    5   6     7   8
                                      9   10   11   12   13   14   15   16
                                     17   18   19   20   21   22   23   24
                                     25   26   27   28   29   30   31   32
                                     33   34   35   36   37   38   39   40
                                     41   42   43   44   45   46   47   48
                                     49   50   51   52   53   54   55   56
                                     57   58   59   60   61   62   63   64

The playing board has 64 squares and is approximately 17cm X 17cm. This example is
approximately 1/3 actual size and is done with the individual cells as 18 pixels square with 1
pixel bordering. This yields an image that is 153 pixels square. Since the Palm screen is 160
pixels square it would fit nicely.
The actual game has small characters in each cell. These characters are apparently from the
original Dungeons & Dragons theme and only serve as decoration. The game uses primarily
sound as cues and the visual play is done with playing pieces and wall segments that are placed
on the playing board. I am not including sound description or rules of play here. The cells are
touch-sensitive and consequently the game "knows" where the playing pieces are.




Dr. Greg Hall                                                                    23 of 32
Michelle Brennan, Daniel Dugi, Adrian Elizondo, Robert Hickey, Joey Valdez        Revision 1.0



                                 There is also a menu column.


                                               Switch
                                                Key
                                             Next Turn
                                             Level 1/2
                                          Dragon Flying
                                           Defeat Tune
                                              Dragon
                                              Attacks
                                          Dragon Wakes
                                                Wall
                                                Door
                                           Illegal Move
                                          Warrior Moves
                                             Warrior 1
                                              Winner
                                             Warrior 2
                                              Winner

I have not been able to get the game to turn on (The 9 volt battery is good) and don't know if
these menu cells light or if they are switches to give sample sounds. From the Box:
Game Includes:
4 die-cast metal playing pieces-
2 warrior figures approx. 1.5"(3.7 cm) tall,
1 dragon figure 2.3" (5.8 cm) tall, and 1 treasure
piece 1.2"(3.1 cm) by .68"(1.7 cm) by .7"(1.8 cm).
3 plastic markers - 2 for secret rooms and 1 for treasure room.
50 plastic pieces to mark walls.




Dr. Greg Hall                                                                     24 of 32
Michelle Brennan, Daniel Dugi, Adrian Elizondo, Robert Hickey, Joey Valdez   Revision 1.0




Dr. Greg Hall                                                                25 of 32
Michelle Brennan, Daniel Dugi, Adrian Elizondo, Robert Hickey, Joey Valdez        Revision 1.0



Appendix C – Game Rule Summary

                        Dungeons & Dragons Rule Summary
                                   (Game Board Version)

      Select your secret room – in two-player mode, flip a coin to see who goes first. Person
       going first is Warrior 1. Press any square on the board that you want as your Secret
       Room. Mark it with one of the Secret Room markers. Then press the NEXT TURN
       key. You will hear the WARRIOR 2 TUNE. Player 2 should then select a Secret
       Room and mark it with the other Secret Room marker. (If only one person is playing,
       press the square for your Secret Room, then press NEXT TURN key TWICE.)

                You can change your Secret Room any time BEFORE you press
                the NEXT TURN key. Just press the new square you want.
                Once you press the NEXT TURN key, your Secret Room is
                locked in for the game.
       Each player should place his warrior figure and marker on his Secret Room square.
       After each player has chosen a Secret Room, the computer will select a hidden Treasure
       Room. This room will be at least 3 squares away from any Secret Room. The
       computer will then generate a random labyrinth. This labyrinth will be different every
       time you play the game.

      Begin your quest – At the beginning of the game, each player can move his warrior a
       maximum of 8 SQUARES PER TURN. Warrior 1 goes first, starting to move from his
       or her Secret Room.

       When you move your warrior over a square, you must press down on that square, either
       with your warrior figure or your finger – until you hear a BEEP. You cannot skip over
       squares or press only the final square of your move or you will hear an ILLEGAL
       MOVE buzz.

       You can move your warrior UP, DOWN, LEFT or RIGHT, but you cannot move
       diagonally. You can turn corners as often as you like, but you cannot move through
       walls.

       When you hit a wall, you will hear the WALL SOUND. You must then back up one
       square and stop. Your turn is over. You will hear the other WARRIOR’S TUNE.
       When you hit a wall, mark it with a plastic wall piece, so you will know where it is if
       you come that way again.

       You do not have to make all 8 possible moves in one turn. You can stop at any time by
       pressing the NEXT TURN key. Mark your final position with your warrior figure.


Dr. Greg Hall                                                                     26 of 32
Michelle Brennan, Daniel Dugi, Adrian Elizondo, Robert Hickey, Joey Valdez         Revision 1.0



       After you press the NEXT TURN key, use your maximum number of moves, or hit a
       wall, you will hear the other WARRIOR TUNE or the DRAGON FLYING SOUND if
       the dragon is awake. (If you are playing alone, you will hear the WARRIOR 1 TUNE
       again. If the dragon isn’t awake yet, just keep moving.)

       Continue moving, taking turns and marking walls wherever you find them. Try to find
       and mark as many walls as possible before the dragon wakes up. Both warriors can
       safely occupy the same square, as long as neither of them has the treasure. When two
       warriors temporarily land on the same square, second warrior on the square should wait
       until the first warrior moves again. Second warrior piece can then be placed on the
       square.

      The dragon wakes – At the beginning of the game, the dragon is asleep in the Treasure
       Room. But the dragon sleeps with one eye open. After each player as taken one turn,
       the dragon checks to see if anyone is approaching too close to the treasure.

       If either player is 3 squares away or closer, in any direction, the dragon wakes
       completely. You hear the DRAGON WAKES sound (a low buzzing). As soon as the
       second player’s turn is over, the dragon moves one square. You hear the DRAGON
       FLYING sound.

       When the dragon is awake, it starts to chase the NEAREST warrior. It always moves 1
       square at a time, after Player 2 takes his or her turn. (If only one person is playing, the
       dragon and player take turns moving, after the dragon wakes.) THE DRAGON CAN
       MOVE DIAGONALLY AND “FLY” OVER WALLS.

       If the dragon is chasing one warrior and the second warrior happens to move closer, the
       dragon will change course, to go after the second, closer warrior. If either warrior gets
       the treasure, the dragon will immediately start after that warrior, even if the other
       warrior is closer.

      The dragon attacks – The dragon is invisible. When you hear it waking, you know
       only that it is 3 squares away or closer in SOME direction. You will not know the
       dragon’s exact location until it attacks a warrior. Use the dragon piece to mark the
       general vicinity of the dragon, until you locate its exact position. Then mark that
       position.

       If you land on the dragon or it lands on your warrior, it will attack and wound your
       warrior. You will hear your WARRIOR TUNE, followed by the DRAGON ATTACKS
       SOUND.

       Either way, your warrior will be returned to your Secret Room where he can no longer
       be seen by the dragon. After each dragon attack, you warrior’s ability to move will
       drop by 2 moves per turn.




Dr. Greg Hall                                                                      27 of 32
Michelle Brennan, Daniel Dugi, Adrian Elizondo, Robert Hickey, Joey Valdez        Revision 1.0


       FIRST DRAGON ATTACK – maximum moves per turn drops from 8 to 6.

       SECOND DRAGON ATTACK – maximum moves per turn drops from 6 to 4.

       THIRD DRAGON ATTACK – your warrior is wounded too severely to continue.
       You’re out of the game. You hear your WARRIOR TUNE, then a mournful DEFEAT
       TUNE.

       After the dragon attacks a warrior, it looks around to see if there are any more warriors
       in the labyrinth. If the second warrior is out of his Secret Room, the dragon starts after
       him. If it cannot find a second warrior, it starts back to the Treasure Room, moving one
       square at a time, until it “sees” a warrior again.

       ONCE THE DRAGON IS AWAKE, IT WILL ALWAYS GO AFTER ANY
       WARRIOR OUTSIDE HIS OR HER SECRET ROOM!

      Treasure found – If you succeed in avoiding the dragon long enough to find the
       treasure (land on the Treasure Room square), you will hear a short TREASURE TUNE.
       Your warrior will then have to stop, even if you have not used your maximum number
       of moves. You cannot move again until the other warrior and the dragon (only the
       dragon if you are playing alone) have moved.

       The treasure is heavy and slows your warrior down to 4 moves per turn, as long as he is
       carrying it. If your warrior is already at a 4 move maximum (has been attacked by the
       dragon twice), his ability to move will not be further reduced.

       Once you locate the Treasure room, mark it with the Treasure Room marker. As long
       as you have the treasure, you keep possession of the treasure piece.

      Get the treasure home – Now that you have found the treasure, you must get it back to
       your Secret Room in order to win the game. In one-player mode, you must avoid the
       dragon. In two-player mode, you must avoid the dragon and keep the other warrior
       from stealing the treasure.

       When you have the treasure, you are particularly vulnerable. If the dragon attacks you
       now, you are immediately out of the game. You will hear your WARRIOR’S TUNE
       and the DEFEAT TUNE. The treasure goes back to the Treasure Room.

       EXCEPTION: If you land on the Treasure room square while the dragon is still there,
       you are not immediately out of the game. You will, however, be attacked and wounded.
       If this is your first or second attack, your warrior will be sent back to your Secret room
       and his ability to move will be decreased in the usual manner. If this is your third
       attack, your warrior will be out of the game. The treasure will remain in the Treasure
       Room unless a warrior is in the labyrinth, outside of his Secret Room.




Dr. Greg Hall                                                                     28 of 32
Michelle Brennan, Daniel Dugi, Adrian Elizondo, Robert Hickey, Joey Valdez       Revision 1.0


       In two-player mode, if one player is knocked out of the game by the dragon, the other
       does not automatically win. The second player must still find the treasure and get it
       back to his or her Secret room without encountering the dragon.

      Survival of the strongest (two-player mode only) – Both warriors in a 2-player game
       start out equally strong. Each time a warrior moves, he loses a little strength. The
       computer will periodically renew your warrior’s strength. You can never be sure when
       this will happen. A warrior’s strength has nothing to do with his ability to move his
       maximum number of moves per turn.

       A warrior’s strength factor determines two things:

       1) The winner in a warrior vs. warrior combat over the treasure.

       2) The loser if the dragon lands on a square occupied by both warriors. The dragon
          attacks and wounds the weaker warrior. The wounded warrior returns to his Secret
          Room. The dragon and second warrior continue to occupy the same square until the
          second warrior moves away. If the second warrior stays on that square after his next
          turn, he will also be attacked and wounded.

      Warrior Vs Warrior combat (two-player mode only) – Once a warrior finds and
       takes the treasure from the Treasure Room, his opponent can try to steal the treasure
       from him.

       Anytime both warriors occupy the same square and one of them has the treasure, they
       engage in combat to determine who gets the treasure. The computer, based on each
       warrior’s strength factor at the time of combat, decides the winner. The winner is
       announced by the TREASURE TUNE. The winner’s ability to move is immediately
       reduced to 4 moves per turn.

       After NEXT TURN has been pressed following combat, that combat is over, even if
       both warriors remain on the same square. If the defeated warrior wants to start the
       combat again, he or she must move off of the square shared with the victor, the move
       back on it again.

       There are a number of ways in which warrior vs. warrior combat can occur. Each has a
       different result.

       WARRIOR WITH TREASURE LANDS ON SQUARE OCCUPIED BY OTHER
       WARRIOR:

                3) If warrior with treasure has not used his maximum of 4 moves, whether he
                   wins or loses, the warrior with treasure may continue moving, up to his
                   maximum number of moves. If he wins, that maximum stays at 4 moves. If
                   he loses, that maximum returns to whatever it was before he took the
                   treasure (6 or 8 moves).



Dr. Greg Hall                                                                    29 of 32
Michelle Brennan, Daniel Dugi, Adrian Elizondo, Robert Hickey, Joey Valdez       Revision 1.0


                4) If warrior with treasure has used his maximum of 4 moves, if he wins, he
                   must stop. His turn is over. If he loses, he may continue moving, since his
                   maximum returns to whatever it was before he took the treasure (6 or 8
                   moves).

       OTHER WARRIOR LANDS ON SQUARE OCCUPIED BY WARRIOR WITH
       TREASURE:

                4) If other warrior has moved less than 4 squares, whether he wins or loses, he
                   may continue moving, up to his maximum number of moves. If he loses,
                   that maximum remains whatever it was before combat (6 or 8 moves).

                5) If other warrior has moved at least 4 squares but less than his maximum, if
                   he wins, he must stop. The treasure reduces his maximum to 4 moves. If he
                   loses, he may continue moving, up to his maximum (6 or 8 moves).

                6) If other warrior has used his maximum number of moves, whether he wins
                   or loses, he must stop. His turn is over.

      The winner – When any player succeeds in getting the treasure back to his or her
       Secret Room without being attacked by the dragon or robbed by the other warrior, that
       player wins. You will hear the WINNER TUNE.




Dr. Greg Hall                                                                     30 of 32
Michelle Brennan, Daniel Dugi, Adrian Elizondo, Robert Hickey, Joey Valdez   Revision 1.0



Appendix D – Game Sounds

Defeat Tune – slow, falling tune

Dragon Attacks – six notes in repeating high-low pattern.

Dragon Flying – series of siren-like, rising and falling notes.

Dragon Wakes – low buzzing.

Illegal Move – one buzz.

Treasure – a shorter version of the Winner’s Tune.

Wall – series of very fast notes at high pitch.

Warrior 1 – two rising notes.

Warrior 2 – three notes in high-low-high pattern.

Warrior Moves – one high beep for each square moved.

Winner – a short, upbeat tune.




Dr. Greg Hall                                                                31 of 32
Michelle Brennan, Daniel Dugi, Adrian Elizondo, Robert Hickey, Joey Valdez       Revision 1.0



Appendix E – PalmIIIxe Buttons

Dr. Hall suggested last week that this is how he thought it would be operated. There also
would be different icons displayed where the secret rooms are and for the warriors. When a
wall is encountered the wall section is displayed. Nothing occurs when an outer perimeter wall
is encountered. The stylus would also be needed to select the secret room. I suppose the game
could be played with just the stylus but we would still need to signal next turn somehow.




    Use stylus
    here for menu
                                                                       Move up


         Move left                                                       Move
                                                                         right




                      Next turn              Move               Menu
                     and Select              down
                      for Secret
                    Room on the
                       first turn




Dr. Greg Hall                                                                    32 of 32

								
To top