Thursday, November 8, 2012

Capital Ships: Launching and Landing Fighters

I've been busy the last few days; so, I haven't had time to flesh out exactly how to approach the capital ship's role in launching and landing fighter craft.  This blog will, hopefully, give me a clear road map as to how to to handle this aspect of the game.

First, landing isn't a big concern at this point.  The current system needs alot of polish; however, it does represent a functional, bare-bones skeleton.  Adding features to this can come later in the development process.  Right now, it is more important to get all the capital ship's features a skeleton for future development.  Consequently, this round of priorities will not see any additions to the landing of fighter craft on a battlestar.

Second, launching fighters needs some significant additions to the game. 

First, I need to add launch points associated with each launch tube on the current destroyer model.  This will be a simple empty game object oriented 90 degrees off from forward.  Obviously, the 90 degree offset will depend on whether the launch tube is located on the port or starboard side of the ship.  The launch points will be used as instantiation points for launching fighters. 

In addition, I need to create a dedicated fighter manager script for the battlestar.  This script will be attached to main battlestar game object.  It needs to contain a pilot list at the very least.  It probably will need a pilot list (representing all pilots attached to the battlestar), an active list (all pilots current launched and in space), a reserve list (all pilots that are still onboard the battlestar) and a killed list (list of pilots shot down during the mission).  The script will need methods to move pilots from list to list as necessary.  The full pilot list should contain the pilot's name (first and last), rank and fighter type.  The combination of fighter type and rank would point the script to retrieve a record from the database.  This data would represent the baseline data for a non-player character flying a certain fighter of a certain rank.  The name fields from the database file would be replaced by the first and last name of the pilot list's record. 

This script will also need a method to launch a fighter.  This is a simple instantiation process and will probably be similar to the one currently used in the trigger manager.  A more complex instantiation process will be necessary for the fighters that are already launched at the start of the mission.  This will lead to a change in the trigger manager and will possibly lead to a new trigger type.

To make this model happen, here are the steps that I will use to make things happen.

1.  Add launch points to the launch tube locations.
2.  Create a new FighterManager to be added to the battlestar's game object.
3.  Create a list for all, active, reserve and killed pilots with methods to move members between lists.
4.  Create an instantiation process to launch a fighter.
5.  Create an instantiation process for fighter's launched prior to the start of the mission.
6.  Create a dummy script to test all of these functions

This shouldn't be too hard to implement at this point.  It might take alittle time though...

1 comment:

  1. I think I got the basic framework down. There are a few areas of concern, and I have to add some additional functionality to the script. In other words, I have a good portion done, but it needs alittle more before adding it the Battestar game object for testing.

    The lists, for the most part, are done, and the functionality to move pilots between the lists is there. In addition, it should be able to instantiate a fighter at the proper location and rotation.

    ReplyDelete