Exercises


1. ‚  

Is game testing important?

2. ‚  

Which of the defect types do you think is the hardest for testers to find? Explain why.

3. ‚  

List five situations where assignments are likely to occur in a simulation game, such as The SIMS or Zoo Tycoon .

4. ‚  

List five types of algorithms that you might find in a simulation game.

5. ‚  

From the following code example from the publicly available source code for Castle Wolfenstein: Enemy Territory , identify line numbers (added in parentheses) that might be a source of a defect for each of the ODC defect types.

 /* =============== RespawnItem =============== */ (0) void RespawnItem( gentity_t *ent ) { (1)         // randomly select from teamed entities (2)         if (ent->team) { (3)                 gentity_t        *master; (4)                 int count; (5)                 int choice; (6)                 if ( !ent->teammaster ) { (7)                      G_Error("RespawnItem: bad teammaster"); (8)                 } (9)                 master = ent->teammaster; (10)                 for ( count = 0, ent = master; (11)                       ent; (12)                       ent = ent->teamchain, count++) (13)                       ; (14)                 choice = rand() % count; (15)                 for (        count = 0, ent = master; (16)                          count < choice; (17)                          ent = ent->teamchain, count++) (18)                          ; (19)        } (20)        ent->r.contents = CONTENTS_TRIGGER; (21)        //ent->s.eFlags &= ~EF_NODRAW; (22)        ent->flags &= ~FL_NODRAW; (23)        ent->r.svFlags &= ~SVF_NOCLIENT; (24)        trap_LinkEntity (ent); (25)        // play the normal respawn sound only to nearby clients (26)        G_AddEvent( ent, EV_ITEM_RESPAWN, 0 ); (27)        ent->nextthink = 0; } 

6. ‚  

That was fun! Let's do it again with another Wolfenstein example:

 /* ============ G_SpawnItem Sets the clipping size and plants the object on the floor. Items can't be immediately dropped to floor, because they might be on an entity that hasn't spawned yet. ============ */ (0) void G_SpawnItem (gentity_t *ent, gitem_t *item) { (1)     char      *noise; (2)     G_SpawnFloat( "random", "0", &ent->random ); (3)     G_SpawnFloat( "wait", "0", &ent->wait ); (4)     ent->item = item; (5)     // some movers spawn on the second frame, so delay item (6)     // spawns until the third frame so they can ride trains (7)     ent->nextthink = level.time + FRAMETIME * 2; (8)     ent->think = FinishSpawningItem; (9)     if(G_SpawnString("noise", 0, &noise)) (10)          ent->noise_index = G_SoundIndex(noise); (11)     ent->physicsBounce = 0.50;           // items are bouncy (12)     if(ent->model) { (13)          ent->s.modelindex2 = G_ModelIndex(ent->model); (14)     } (15)     if (item->giType == IT_TEAM) { (16)         G_SpawnInt( "count", "1", &ent->s.density ); (17)         G_SpawnInt( "speedscale", "100", &ent->splashDamage ); (18)         if( !ent->splashDamage ) { (19)             ent->splashDamage = 100; (20)         } (21)     } } 

Answers

1. ‚  

Yes.

2. ‚  

The answer is specific to the reader.

3. ‚  

Correct answers to this question should be along the lines of: when you are placed in a particular location in the game world, when you type in a name for something in the game (a player, town, pet, etc.), when you change a game option (language, difficulty, etc.), when you gain a new ability (skill, level, job, unlocked item, etc.), when you set the selling price of an item.

4. ‚  

Correct answers should relate to dynamic processes in the game, such as: aging (people, creatures , the environment, etc.), movement of objects in the environment (due to wind, gravity, etc.), the formation and effects of disasters (earthquakes, fire, flood, etc.), population growth (people, animals, plants, etc.), planetary cycles (sun, moon, meteors, etc.), weather (rain, snow, lightning, etc.).

5. ‚  

RespawnItem defect type opportunities:

  • Function ‚ 1 through 19 (random selection), 20 ‚ 24 (setup and use flags), 25 ‚ 26 (play respawn sound)

  • Assignment ‚ 9, 10 (2), 12 (2), 15 (2), 17 (2), 20, 27

  • Checking ‚ 2, 6, 11, 16

  • Timing ‚ 26

  • Build/Package/Merge ‚ 21

  • Algorithm ‚ 14, 22, 23

  • Documentation ‚ 7 (a literal string is used to report an error)

    • Interface ‚ 0, 7, 24, 26

6. ‚  

And again for G_SpawnItem :

  • Function ‚ 2-8 (spawn item), 9 ‚ 10 (make sound), 15 ‚ 20 (apply damage). The other lines, such as 11, set values but don't perform the function in this routine.

  • Assignment ‚ 1 (possible missing initialization of local variable), 4, 8, 10, 13, 19

  • Checking ‚ 9, 12, 15, 18

  • Timing ‚ 7 (if this line is not there, spawn timing could be wrong)

  • Build/Package/Merge ‚ none

  • Algorithm ‚ 7

  • Documentation ‚ none (strings passed to functions in this routine are not intended to be displayed as text)

  • Interface ‚ 0, 2, 3, 8, 9, 10, 13, 16, 17




Game Testing All in One
Game Testing All in One (Game Development Series)
ISBN: 1592003737
EAN: 2147483647
Year: 2005
Pages: 205

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net