-
Notifications
You must be signed in to change notification settings - Fork 9
Config Factories Testing Plan
The factories play a vital role due to being responsible for the generation of new entities that make up the core gameplay. As such it is essential that they are tested thoroughly to ensure that they always behave as expected to entity spawning does not break.
Due to the implementation of configuration files to load in entity state data, the tests must be extended to ensure that the correct information is loaded in from the configuration files.
The objective is to ensure that when specifically requested config files are utilised to create enemies they are correctly generated with their corresponding health and base attack damage as expected.
- All the required services for the enemy factory are registered with the
ServiceLocator
.EntityService
PhysicsService
RenderService
Objective: To ensure that when a Melee
enemy type with PlayerTargeting
behaviour enemy is created it has the correct health and base attack.
Steps:
- Get the configuration file for a
Melee
PTE
enemy. - Create an enemy using this configuration file.
- Validate that the health of the created entity is correct
- Validate that the base attack of the created entity is correct.
Objective: To ensure that when a Melee
enemy type with DestructibleTargeting
behaviour enemy is created it has the correct health and base attack.
Steps:
- Get the configuration file for a
Melee
DTE
enemy. - Create an enemy using this configuration file.
- Validate that the health of the created entity is correct
- Validate that the base attack of the created entity is correct.
Objective: To ensure that when a Ranged
enemy type with PlayerTargeting
behaviour enemy is created it has the correct health and base attack.
Steps:
- Get the configuration file for a
Ranged
PTE
enemy. - Create an enemy using this configuration file.
- Validate that the health of the created entity is correct
- Validate that the base attack of the created entity is correct.
Objective: To ensure that when a Ranged
enemy type with DestructibleTargeting
behaviour enemy is created it has the correct health and base attack.
Steps:
- Get the configuration file for a
Ranged
DTE
enemy. - Create an enemy using this configuration file.
- Validate that the health of the created entity is correct
- Validate that the base attack of the created entity is correct.
Objective: To ensure that when a BossMelee
enemy type with PlayerTargeting
behaviour enemy is created it has the correct health and base attack.
Steps:
- Get the configuration file for a
BossMelee
PTE
enemy. - Create an enemy using this configuration file.
- Validate that the health of the created entity is correct
- Validate that the base attack of the created entity is correct.
Objective: To ensure that when a BossRanged
enemy type with PlayerTargeting
behaviour enemy is created it has the correct health and base attack.
Steps:
- Get the configuration file for a
BossRanged
PTE
enemy. - Create an enemy using this configuration file.
- Validate that the health of the created entity is correct
- Validate that the base attack of the created entity is correct.
The objective is to ensure that obstacles that can be created from a configuration file get generated correctly with the appropriate health and base attack as outlined in the config file.
- All the required services for the obstacle factory are registered with the
ServiceLocator
.EntityService
PhysicsService
InputService
ResourceService
RenderService
- All the textures for the obstacles are loaded into the
ResourceService
.
Objective: To ensure that when a LevelOne Turret is created through the obstacle factory using a configuration file it has to appropriate health and base attack expected.
Steps:
- The configuration file for a level one turret is generated.
- A custom turret is created using the configuration file and the
ObstacleFactory
. - Validate that the created
PlaceableEntity
has the expected health. - Validate that the created
PlaceableEntity
has the expected base attack.
Objective: To ensure that when a LevelTwo Turret is created through the obstacle factory using a configuration file it has to appropriate health and base attack expected.
Steps:
- The configuration file for a level two turret is generated.
- A custom turret is created using the
ObstacleFactory
and configuration file. - Validate that the created
PlaceableEntity
has the expected health. - Validate that the created
PlaceableEntity
has the expected base attack.
The objective is to ensure that when a configuration file is used to create a powerup through the powerup factory it is correctly generated and has the correct type.
- All the required services for the powerup factory are registered with the
ServiceLocator
.EntityService
PhysicsService
ResourceService
- All the textures for the powerups are loaded into the
ResourceService
.
Objective: To ensure that when the powerup factory is used to make a health powerup using a configuration file the appropriate powerup is created with the correct type.
Steps:
- The configuration file for a health powerup is generated
- The configuration file is used to generate the powerup in the
PowerupFactory
. - Validate that the powerup was successfully created (Not Null).
- Validate that the powerup has the correct type.
Objective: To ensure that when the powerup factory is used to make a speed powerup using a configuration file the appropriate powerup is created with the correct type.
Steps:
- The configuration file for a speed powerup is generated
- The configuration file is used to generate the powerup in the
PowerupFactory
. - Validate that the powerup was successfully created (Not Null).
- Validate that the powerup has the correct type.
To ensure that when a projectile entity is created by the ProjectileFactory
using a configuration file it is correctly generated with appropriate attack and components.
- All the required services for the projectile factory are registered with the
ServiceLocator
.EntityService
PhysicsService
RenderService
**Objective: ** The objective is to ensure that when a bullet is created using a configuration file it is correctly generated.
Steps:
- An enemy is created to be where the bullet is shot from.
- The configuration file for a bullet is generated.
- The config file is used to create an enemy bullet from the enemy to a target position.
- Validate that the created bullet has the correct attack damage amount.
- Validate that the bullet has an AITaskComponent.
- The
EnemyFactory
must be able to create an enemy entity for the bullet to be shot from.
Escape Earth Game
Interaction Controller and Interactable Components
Game and Entity Configuration Files
Loading Game Configuration Files