Sunday, November 17, 2013

Update (November 17, 2013)

I've been offline for the past few days.  I went on trip and spent a lot of time in a car without any internet access.  Before my trip, my computer crashed and required a complete refresh.  I managed to save my game files for this prototype and the previous prototype.  Unfortunately, I couldn't save the programs; I had to reformat and reinstall Windows. 

I've been spending a lot of time reinstalling important programs.  Unity3D is reinstalled; I just reinstalled 3DS Max.  Those are the two important programs.  At this point, I can start making progress again. 

Wednesday, November 13, 2013

Scorpion Class Fighter

I'm going to be extremely busy for, at least, the next week.  I probably won't be able to post for awhile.  I'll probably get to work some on the project, but that time will be limited.  At this point, I got a functional, well hopefully, flight control script.  There really isn't any great way of testing it at this point.  I need a couple of things to start testing.

First, I need to import the "official" Scorpion fighter.  I got the mesh done.  I still need to create a collider system for it, and I need to create "damaged" parts for the model.  These are the pics of finalized Scorpion:

I still haven't textured this model.  I do plan on getting a decent texturing program this month.  Once I get this model fully imported, I still need to work on a couple of scripts.

I will need a PlayerControl script.  This script will allow me to input movement commands and test FlightControl.  After PlayerControl, I will work on the FireControl and DamageControl scripts.  HUDControl will be the final script developed for the game object.  I might have to develop a level wide FactionManager to make HUDControl functional though. 

So, this week will involve prepping the Scropion to be imported in Unity3D and developing a good flow for the PlayerControl script. 

Saturday, November 9, 2013

The New FlightControl

FlightControl is up next.  I just wanted to make some quick points on the new direction of the script. 

First, FlightControl will become a universal script.  Every interactible object will have a flight control script attached to it.  This is to standardize the access of various types of game objects.

Second, this script will receive its inputs from PlayerControl, FighterControl or some other script.  While this script is in charge with the "physical" movement of a vehicle, it cannot move a vehicle without being told to do so by another script.  This means that I will have to move the player control elements from the old FlightControl into the new PlayerControl.  As a side note, FlightControl will end up being an "input" for most scripts attached to a vehicle.

Third, it will use an applied thrust and turn variable like the previous version.  These values will range from -1 to 1 and will be used like percentages.  The turn variable will be a Vector3 with each coordinate representing a different turn component.  X will represent yaw.  Y will represent pitch.  Z will represent roll.  Applied thrust, like the previous prototype, will be a float; however, I want to make significant changes to the thrusting system with this prototype.  There will not be a set maximum speed in this iteration; the maximum speed value stored in the Vehicle type will represent a speed increment.  The amount of applied thrust will be dependent on current speed of the craft.  This equation will be the basis for determining the amount of thrust to apply to the craft:

      applied thrust = (1/(2^(current speed / maximum speed)))thrust

As a vehicle travels faster, it will become more difficult to turn the craft.  On the flip side, craft can travel faster.

Fourth, setting whether a player is in charge of the script will be removed from FlightControl.  The existence of the PlayerControl script will be sufficient to designate a player controlled craft.  This "setting" will occur as part of the triggering process.

Fifth, FlightControl will continue to have the basic collider listeners from previous prototypes.  This will make DamageControl very dependent on FlightControl.  I'm just not prepared to make the alteration of separating the listeners from FlightControl at this point.  I will note that the FlightControl script, in itself, will not touch the structure values.  This will be left up to DamageControl.

Depsite these changes, I don't anticipate FlightControl going through a major coding rewrite.  Most code from the previous prototypes will be lifted straight out of the previous version.  Except for the thrusting rewrite, FlightControl will mostly see a cut in the amount of code in it.  Alot of the past code will be cut and pasted into other scripts.

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. 

Friday, November 1, 2013


No, I haven't finished the scropion.  I'm getting closer though.  I'll probably be offline for a couple of days; so, I figured I would make one post before then.  I finished most of the model.  I still have to do the gun mounts on the bottom of plane, and I want to setup the model properly.  Currently, the wings are a single mesh.  I want to divide them into a left and right mesh.  That way, I can display wing damage as it occurs. 

Here's a quick picture of the new Scorpion model:

The engines are a different color because I haven't made a final decision on how I want to combine these parts.  I might keep each part separate; I might combine the engines into a single mesh.  I'm just not sure how I want to do that part quite yet.  In other words, anything that doesn't look grey is something that I haven't made a decision on.

I placed my model, the one closest in the picture next to a high resolution model made by Smallworld.  I didn't add any textures to these models.  So far, I think my version is looking acceptable.  Currently, it has fewer than 4,000 vertices.  My budget is 5,000 or so.  I can go over, espeically if you take into account some of the less visible features like the landing gears...