Sunday, July 8, 2012

Waypoint Manager Overview

The waypoint manager is next on the list for development.  It's a key feature in the game (and just about every flight simulator out there).  It does not need to be difficult; however, it needs to interact with multiple modules without any issues.  Many of these modules, like the HUD script and fighter AI script, are already written and need to incorporate the new waypoint system without interfering with the current scripts.  The waypoint system will consist of a waypoint manager and a series of physical waypoints. 

The waypoint manager will manage the waypoint system.  It will keep a list of fighters (and/or capital ships) that can use the system (to keep colonial forces from using cylon waypoints and vice versa).  Referencing the waypoint manager,will unlock access to the series of waypoints attached to the manager.

Each waypoint will be a physical sphere with a collider turned into a trigger.  As a fighter enters the waypoint, it triggers a waypoint update that affects other scripts (like the fighter AI script).  As a NPC fighter enters waypoint #1, the AI routines update to travel to waypoint #2.  In addition, the waypoint system needs to be robust enough to include non-waypoint positions into the system.  For example, the approach position for a landing bay associated with the Battlestar Galactica needs to be an acceptable parameter that can be passed to a fighter instead of an actual waypoint.  In addition, players like to skip waypoints at time.  If a player enters waypoint #2 (without triggering waypoint#1), the system needs to update to waypoint #3 without any issues.

The key scripts that will be affected by the waypoint system are the HUD script and fighter AI script.  In addition, the future event manager will rely on the waypoint system.  Integration into existing scripts should be a matter of addition (in case of the HUD) and replacement (in the case of the fighter AI).  The fighter AI is patched together and in need of redevelopment; this redevelopment will occur with the waypoint development. 

The basic variables need to create a waypoint system are:

List of fighters that can use the waypoints
List of waypoints

The basic methods and procedures are:

Add a fighter to the access list
Remove a fighter from the access list
Output a fighter from the access list

Add a waypoint
Remove a waypoint
Change a waypoint
Output (or find) a waypoint
  Output the curent waypoint
  Output the next waypoint

Waypoint entry trigger (which should output the next waypoint)

Beyond these parameters, I don't think much more will be needed for a decent waypoint sytem.  I might be wrong, and I may have to add variables and routines to the list.  However, I'll design the system based on these parameters.

3 comments:

  1. Looks pretty good, although personally I find it very difficult to assess these kinds of plans up front. My general methodology is to bash things out as fast as possible and then firefight small issues until I can somehow see the bigger picture. Then I throw the first version away and start on the next version that incorporates those insights ... Chapter 6 in "Artificial Intelligence for Games" on Tactical and Strategic AI, has it's first section on waypoints: http://ai4g.com/ We have free access to the electronic version of the book through the HPU library ...

    ReplyDelete
  2. Thanks for the book informtion...

    I'll look into it when I get some free time...

    ReplyDelete
  3. Now that I think of it, I need a waypoint manager to handle the above information, and a waypoint control script attached to the waypoint. The manager will handle most of the work with the control handling the trigger affect.

    ReplyDelete