Wednesday, November 6, 2013

The Player Game Object

I'm pretty close to finalizing the Scorpion model.  There are a few things that need to get done.  I'll add a quick preview of the Scropion since people seem to like pictures...  Well, I like pictures...

Right now, I want to map out what the player's fighter will have to have script wise to function.

Mulling it over, I've come up with: a flight control, fire control, player control (input), HUD control and damage control script.  Each of these scripts would handle key parts, some of which will apply to non-player craft, of the game.

Flight control (FlightControl) will handle the movement of the fighter or other craft.  It will receive input from the PlayerControl script, or a dedicated AI script for non-player objects.  The output will be the actual movement of the vehicle. 

Fire control (FireControl) will handle the discharge of weapons by the vehicle.  Like FlightControl, it will receive its inputs from the PlayerControl script.  The output will be the release of ordnance.

HUD control (HUDControl) will manage the display of data to the player.  There will be two primary modes, a game and cockpit mode.  The player can select a metagame or a "realistic" display system.  This script will receive inputs from various sources.  Dradis contacts will be received by a "triggered" spherical collider around the player's fighter.  As objects enter or exit the sphere, they will be added to the player's detectable objects list.  In addition, FlightControl will pass data about the vehicle for display.  The output, obviously, is the actual HUD.

The player control (PlayerControl) script is a new script being implemented this prototype.  Its purpose is to manage keyboard and mouse inputs and pass that data to the appropriate scripts.  It will also allow for the customization of keyboard layout.  So, it receives inputs from the player.  Its output are the FlightControl, FireControl and HUDControl scripts.

Damage control (DamageControl) is primarily an event handler for collisions.  Its inputs are from collisions from various colliders.  It also takes damage data from objects that caused the collision to calculate the amount of damage dealt to the player's vehicle.  It outputs to FlightControl and HUDControl scripts.  It also outputs to the trigger manager for the game if the player's vehicle is destroyed. 

So, there will be five scripts to control the player's vehicle.  I just wanted to outline the general inputs and outputs for each of these scripts.  As I start to develop each script, I will created a post dedicated to that script.  I do know that I want to change some fundamental things with this prototype.  For example, I want to eliminate the "hard" maximum speed for fighters.  I will outline these changes in the appropriate scripts. 

1 comment:

  1. Actually, all of the scripts will have FlightControl as an "input". The basic vehicle and entity data is stored in that script. I'll go over that, probably, when I start to tackle FlightControl. I'm going to be busy through Monday, but I hope to post my basic outline for FlightControl before Monday. Worst case scenario, I get it done on Monday...