System Design : Objectives - IAMColumbia/gp2portfoliogame-JSchoppe GitHub Wiki

Architectural Goals

To allow for more diverse game modes in the future, the objective system/sequencing is built with these considerations in mind:

  1. Objectives should be interchangeable and reorderable
  2. No objective should directly depend on another objective. Order should be handled by a sequencing device that knows nothing about specific objectives, while specific objectives should only be aware of their own state.

Challenges

The scalability/reusability of this system has not been thoroughly tested as there is only one objective implementation in the current build of the game. In theory there should be at least one more objective for not being destroyed; and an implementation for an objective manager that can run both of these objectives in parallel(and in the long run should be generalized to any objective tree in a way that is designer accessible).

Design Goals

Some common design goals for objectives in the future:

  1. Objectives should have better visual telegraphing. This can be done through a bindable event on the prospective objective manager core class.
  2. Objectives should have clear start and end conditions; should be tested to be sure objectives cannot get stuck in a state where they will never invoke completed or failed events.

Current UML

The UML below shows the single objective implemented in the current build. The visual implementation is injected via interface; the Unity specific implementation for this is shown on the right hand side. In the bootstrapper code that is currently implemented the Objective is created and observed directly by the bootstrapper; this should be handled by a manager class. uml for objective implementation