Friday, October 25, 2013

Turret class

At this point, I have the basic data classes done.  The Entity and Vehicle classes are ready for Unity3D and SQO.  The Structure, Thrust and Expendable classes used by the two big classes are, obviously, done and ready for the next prototype.  In addition, I have the Bullet, Missile and CounterMeasure classes ready for the next iteration.  These classes are derived from an Ordnance class to help organize the similarties.

So, what's next?  I'm thinking that the turret class should be next.  I plan on implementing turrets that use the basic flight control script despite being a child object to a battlestar or other larger entity.  Destroying turrets will be a key part of the game afterall.  So, I should develop turrets keeping this in mind.  To properly implement turrets, flight control will attempt to load any turret data, if the object is an actual flying entity, the turret variable will be a null.  The turret class will contain just the fire cutout zones.  The ammo, turn speed and other variables used in past iterations will be contained in the Vehicle class; however, each turret will need a reference variable to its parent vessel.  This reference variable will be the OID of parent battlestar. 

That way, a loading function can take the parent's OID and load a list of turrets.  Unity3D will iterate through the list to load the actual data into individual turrets.  This will require additional variables to implement.  First, it will need an OID of the flight control variable related to the turret.  Second, it will need the physical name of the turret attached to battlestar or other object. 

So, we get:

OID
Name
VehicleOID
Minimum.X
Minimum.Y
Maximum.X
Maximum.Y

Additionally, I will put the standard Delete, Save and Load routines in class.  The game probably won't utilize the Load function often, if ever; however, it might and standardization shouldn't hurt anything.

After that, I will want to create a Squadron class for the battlestars and basestars in the game.  My plan is to have two different instantiate methods for fighters.  The first is identical to the prior prototype.  The trigger manager loads the fighter into a specified location.  The second will involve the battlestar or basestar actually launching fighters.  These fighters will be instantiated by the individual battlestars or basestars in the game.  I guess I can figure out the handling of that after I finish the Turret class.

No comments:

Post a Comment