Capship Components and Weapons in the making

Discussion in 'Flight Commander' started by Iceblade, May 6, 2011.

  1. Iceblade

    Iceblade Admiral

    Messages:
    1,953
    Likes Received:
    11
    Trophy Points:
    36,985
    Gender:
    Male
    Hello friends,

    This thread will be my progress through importation and tuning of a capship with primary focus on components both in creating new components and dealing with turrets. No doubt, I will run into difficulties, so I will from time to time ask for help or suggestions.

    The first target on my list is the Murphy class destroyer. First task is to get it imported and making sure it renders in FC without missing components or crashes. In addition, it is a good idea to check out the turrets and make sure their bases are orientated correctly. Next up, I will show means of going about creating a Capship weapon, namely the Murphy's Centerline Plasma Cannon.

    So what I've done is import the Murphy using the tools provided at the FC website. Since, these are outdated somewhat, I need to go in and correct for changes in capship xmls, which means replacing all "jointconstraint"s with "constraint"s and replacing each turret's weapon mount from a weapon number to a weapon tag. Then I need to check it out in-game, which can easily be done by taking a current mission and changing the nearest capship to the Murphy (in this case).

    The ship looks good and the turrets are in place. There are a few issues with component reticules in the wrong location and for some reason when the ship is destroyed, the destoryed component meshes end up at odd locations (like the center of the ship). These are currently bugs in FC 1.7 and will be ironed out or correctable in the xml with the release of FC 1.7.

    So now what I want to do is create a firing point for the plasma to shoot from. There are several ways to go about this.

    • Alter the model such that there is a Plasma Cannon component mesh (with corresponding destroyed mesh) and incorporate it with model. Somewhat rather involved and outside of my skill set.
    • Create an invisible turret and place it at the right location. A very simple, jury-rigged method, but it works.
    • Or try adding a weapon mount to the ship as if it was fighter, which may or may not work with capships in general.

    While capship weapons tend to be turrets (like the cerberus and plunkett), it is not really the case with the Murphy since it is more of a keel-mounted weapon. Still, in WCSO, these massive weapons have been fighter-destroyable, so it might make sense that a fighter's weapons could destroy it (at least fictionally to the point where the opening is too mangled for the weapon to be fired). Still a component or even a turret with the bowl as a mesh would still be the best case scenario.

    But for those without modeling talents, there are two possible options left. One is to have use the hardpoint method. Unfortunately, it is not clear if the AI for the capship would react correctly to having a gun. Also, this method would mean the weapon couldn't be destroyed.

    The last option is however pretty good as it allows the weapon to be destroyed, look good, and you can even add a destroyed mesh that give the appearance of messed up barrel. I am refering to an invisible turret that would react like the turret, but have a very limited field of fire. Still, with the Murphy, that is the whole point.

    So what I've done so far is create a regular, single barrel turret, positioned it to exactly within the bowl on the front of the Murphy, and rotated it and its barrel. The rotation part, however, is not easy to deal with. So I will go into a little depth on altered the matrix.

    First off, the identification matrix (shown below) aligns the turret towards the front with flat portion on the bottom.
    [1 0 0 ]
    [0 1 0 ]
    [0 0 1 ]

    Now to describe the coordinate system that the game uses. If you are looking at the rear of the ship, then left and right are negative and positive x, up and down are positive and negative y, and forward and backward are positive and negative z. Within the matrix, rotations around a particular axis are accomplished by keeping that's axis's row and column constant and changing the remaining four values, which would appear as 2x2 matrix.

    So if we wanted to rotate about the x-axis, then the first row and column are ignored and we alter the remaining four values. (y-axis is the second row and column, z-axis is the third row and column) The basic rotations of the 90 degree turns are the following:

    0 degrees
    [1 0]
    [0 1]

    90 degrees
    [0 -1]
    [1 0]

    180 degrees
    [-1 0]
    [ 0 -1]

    270 degrees
    [ 0 1]
    [-1 0]

    The in-between angles require some calculation and is dependent on axis to be rotated around.
    x-axis
    [cos(angle) -sin(angle)]
    [sin(angle) cos(angle)]

    y-axis
    [cos(angle) sin(angle)]
    [-sin(angle) cos(angle)]

    z-axis
    [cos(angle) -sin(angle)]
    [sin(angle) cos(angle)]

    Once the rotation is done, it needs to be presented in a single line with the first row followed by the second and then third: 1 0 0 0 1 0 0 1 0

    Now that the turret and its barrel are facing and pointed in the right direction, the constraints need to be adjusted. Each constraint (in values of degrees) governs how much the barrel can move rotate about each axis. With our turret, however, these values should theoritically be zero. We might however need to increase it a few degrees in each direction if we find that the turret AI needs a little room to actually fire at something. Now the turret is placed and ready to go, but there are two more issues left (excluding needing turret AI). One is that the weapon tag needs to be changed to the correct one. Currently there isn't one appropiate, so we will just leave it as "fighterturret."

    The other issue is that the turret is still visible. Attempting to leave the mesh blank will only cause the game to crash, so we need another solution. This solution actually comes from Unknown Enemy. During the losing ending, the Dauntless fires a full broadside of torpedoes; however, they didn't come from hardpoints or turrets. In fact, they didn't even come from the Dauntless as far as the game is concerned. They were fired from invisible boxes set up to be fighters (totally script controlled). A similar tactic can be used here with a mesh that has none or transparent textures.

    So with that taken care of, we know have Murphy Capship with an (in the future) functional weapon. Next time we will be creating a targetable hull component that will allow other capships to destroy a capital ship without having to specificially target the ship's components.

    Code:
          <turret type="Plasma Cannon" mesh="box.mesh.bin" damaged_mesh="" hit_points = "1500" >
             <turretlocation>
                <point x = "0"  y = "-6"  z = "425" />
                <rotation matrix = "1 0 0 0 0 -1 0 1 0 " />
             </turretlocation>
             <barrel barrel_mesh="box.mesh.bin">
                <point x = "0"  y = "3.53641"  z = "0" />
                <rotation matrix = "1 0 0 0 0 1 0 -1 0 " />
             </barrel>
             <turretmounts>
                <mount>
                   <point x = "0"  y = "0"  z = "9" />
                   <weapon tag="FighterTurret" />
                </mount>
             </turretmounts>
             <constraint>
                <point x = "0"  y = "0"  z = "0" />
             </constraint>
          </turret>
     
  2. Iceblade

    Iceblade Admiral

    Messages:
    1,953
    Likes Received:
    11
    Trophy Points:
    36,985
    Gender:
    Male
    Well, apparently you can't make a texture transparent, so I'm going to have to attempt another solution for the plasma cannon. (Probably a mesh of some kind)
     
  3. eddieb

    eddieb Vice Admiral

    Messages:
    975
    Likes Received:
    2
    Trophy Points:
    32,385
    Location:
    Los Angeles
    Are you trying to hack in corvettes? That is, fighters that are slow, have lots of turrets, but have the color of a capship? Just make them fighters. And then make a feature request to add an attribute to the ship xml to for the color show up as the capship color.

    I'm sorry, but I don't really follow what you're trying to accomplish with this strange invisible turret/component idea.
     
  4. AD

    AD Finder of things, Doer of stuff

    Messages:
    4,891
    Likes Received:
    99
    Trophy Points:
    36,885
    Location:
    BC, Canada
    I beleive he's trying to make the big crystal hanging between the Midway's pant legs as seen in the Prophecy FMV show up transparent/translucent in-game.
     
  5. Iceblade

    Iceblade Admiral

    Messages:
    1,953
    Likes Received:
    11
    Trophy Points:
    36,985
    Gender:
    Male
    Actually, I'm trying to add a capship weapon to the Murphy destroyer that wasn't implemented in WCSO.

    I'm also trying to add in some simple capship combat (probably going to require a new feature on this one)
     
  6. eddieb

    eddieb Vice Admiral

    Messages:
    975
    Likes Received:
    2
    Trophy Points:
    32,385
    Location:
    Los Angeles
    Just a suggestion: Since the capship weapons don't fire, why not concentrate on another area?
     

Share This Page