-
Notifications
You must be signed in to change notification settings - Fork 2
Collision Box Functional Testing Plan
This page documents the testing taken to validate the Sprint 4 changes to the hitbox/collision boxes. As the code regarding this feature concerns visual alignments and gameplay elements it was not properly testable using JUnit tests. As such, functional testing was conducted.
The ColliderComponent class had several methods that revolved around the collision boxes, but the interaction with these methods was concentrated on two PhysicsUtils methods. As such, these were the methods that were tested (for both hitbox and collision box). These methods were:
PhysicsUtils.setColliderShape()PhysicsUtils.setColliderOffset()
Replacing Collider with Hitbox for the equivalents.
The tests were quite simple, involving comparing the result after calling the method to a baseline value. These tests can be performed on any entity, so for ease of conducting, the player was chosen as the focus.
Steps:
- Enter game with base player
ColliderComponentandHitboxComponentsizes, for reference. - Alter the
ColliderComponentwith sides2, 1to test a non-square shape.- Enter the game to check.
- Alter the
ColliderComponentwith sides2, 2to test a square shape.- Enter the game to check.
- Reset the
ColliderComponentto a shape with sides0.5, 0.5and give it an offset of0.5, 0.5.- Enter the game to check.
- Repeat steps 2-4 with
HitboxComponent.
The following screenshots correspond to the steps taken during the testing plan. These tests focused on the shape of the (quite hard to see) grey wireframes surrounding the placer. First is the base reference.

ColliderComponent:
Non-square:

Square:

Offset:

Upon testing the offset value, it is was seen that the collider box had shrunk in size, by approximately a factor of two. This was unintended behaviour and led the the finding of a bug in the code regarding retrieval of box size values. After fixing this bug, the results matched expectations.
Offset Ammended:

HitboxComponent:
Non-square:

Square:

Offset:

Entities and Components
Interaction System
Unit Testing
Input Handling
UI
Game Screens and Areas
Map Generation
Basic Interactable Objects Design