WCSO Bullet.Iff

Iceblade

Admiral
I'm doing some weapon importing to FC and I noticed a detail in the bullet.iff entries that is unknown.

It definitely has nothing to do with the Hud image nor does it appear to have an impact on whether the weapon damage type. I thought it might be mass, but even large values have no impact on other ships.

Does anybody have any idea what this value does?

The other two unknown values (the ones that always appear to be one) I thought might state whether there is a gun flash or whether there is a bullet; but I when changing to zero, it had no impact. (pretty minor detail anyway, I guess)

Code:
CHUNK "DATA"
    {
      long 0                    //bullet ID
      long 230                //name (points to a string in spacefli.eng)
      long 167                //sound
      float 4000.0           //speed
      float 5000.0           //range
      float 0.0                //charge time
      float 10.0              //energy
      float 20.0              //damage
      float 0.25              //refire delay
      long 0                   //needs ammo
      float 180.0            //No clue
      long 1                   //always 1
      float 1.0                //red flash
      long 0                   //green flash
      long 0                   //blue flash
      float 1.0                //always 1
      long 2                   //bullet appearance type (mesh, parallel, tilted forward)
      long 20625            //mat
      float 0.8                //mat width
      float 14.0              //mat height
    }
 
Somewhat related.

I've run into a problem with conversion of the one of the SoundFX files from WCSO (specially the sound for the dust cannon, though a few other files have the same problem).

Decoding it with WCPPascal, I find that the file looks a lot different from the other sound files:

Code:
IFF "C:\DataTre\Audio\SoundFX\00000165.iff"
{
  FORM "SAMP"
  {
    CHUNK "FRMT"
    {
      long 65537
      long 22050
      long 44100
      float 0.0
    }
    CHUNK "DATA"
    {
      // offset: 24
      // size: 3DA2
      file "C:\Users\Phillip\AppData\Local\Temp\_DATA_24"
    }
  }
}

Obviously, this sound file is not in C XA format nor in any format, so no wonder HCl's audio tools don't work.

I've also tried Popsicle Pete's IFFtoWav converter. While this does return a wav that actually contains some bytes, the file doesn't work in any media player I've tried. I'm not really sure how to get the sound file from this iff. Any ideas?

For reference here is what a normal sound FX file looks like decoded:

Code:
IFF "C:\DataTre\Audio\SoundFX\00000177.iff"
{
  FORM "SAMP"
  {
    CHUNK "FRMT"
    {
      long 65537
      long 22050
      long 44100
      float 0.0
    }
    CHUNK "LENG"
    {
      long 83424
    }
    CHUNK "C XA"
    {
      // offset: 30
      // size: 5768
      file "C:\Users\Phillip\AppData\Local\Temp\_C XA_30"
    }
  }
}
 
I'm doing some weapon importing to FC and I noticed a detail in the bullet.iff entries that is unknown.

It definitely has nothing to do with the Hud image nor does it appear to have an impact on whether the weapon damage type. I thought it might be mass, but even large values have no impact on other ships.

Does anybody have any idea what this value does?

The other two unknown values (the ones that always appear to be one) I thought might state whether there is a gun flash or whether there is a bullet; but I when changing to zero, it had no impact. (pretty minor detail anyway, I guess)

Code:
CHUNK "DATA"
    {
      long 0                    //bullet ID
      long 230                //name (points to a string in spacefli.eng)
      long 167                //sound
      float 4000.0           //speed
      float 5000.0           //range
      float 0.0                //charge time
      float 10.0              //energy
      float 20.0              //damage
      float 0.25              //refire delay
      long 0                   //needs ammo
      float 180.0            //No clue
      long 1                   //always 1
      float 1.0                //red flash
      long 0                   //green flash
      long 0                   //blue flash
      float 1.0                //always 1
      long 2                   //bullet appearance type (mesh, parallel, tilted forward)
      long 20625            //mat
      float 0.8                //mat width
      float 14.0              //mat height
    }

I believe 180.0 has to do with how fast the weapon rotates about its heading vector.
 
Digging into that Dev CD, I finally found some source info on bullets and this actually helps me understand why some of my weapon conversions (namely the dust cannon look way off). Obviously appearance 0 (mesh) has a parameter for scale and appearance 2 has two parameters of width and length. However the dust cannon had an appearance 1 (which has only one parameter), which I had thought meant width. It is actually size, so it looks like FC weapons will need some additional parameters.

Code:
// BULLET_APPEARANCE_MESH(mesh_name, scale)
#define BULLET_APPEARANCE_MESH(a,b) \
	long 0     \
	cstring a  \
	float b

// BULLET_APPEARANCE_BITMAP(material_index, size_in_meters)
#define BULLET_APPEARANCE_BITMAP(a,b) \
	long 1     \
	long a     \
	float b
	
// BULLET_APPEARANCE_BEAM(material_index, width in meters, length_in_meters)
#define BULLET_APPEARANCE_BEAM(a,b,c) \
        long 2     \
	long a     \
        float b    \
        float c

The entry I was wondering about is indeed weapon rotation "spin rate in degrees per second," which is probably part of what goes into weapon convergence.

The entry after that is just always 1, no reason given. Then after the red, green, and blue flash intensities is a fourth flash intensity "m", which I'm guessing refers to overall intensity of the flash.
 
Digging into that Dev CD, I finally found some source info on bullets and this actually helps me understand why some of my weapon conversions (namely the dust cannon look way off). Obviously appearance 0 (mesh) has a parameter for scale and appearance 2 has two parameters of width and length. However the dust cannon had an appearance 1 (which has only one parameter), which I had thought meant width. It is actually size, so it looks like FC weapons will need some additional parameters.

Code:
// BULLET_APPEARANCE_MESH(mesh_name, scale)
#define BULLET_APPEARANCE_MESH(a,b) \
	long 0     \
	cstring a  \
	float b

// BULLET_APPEARANCE_BITMAP(material_index, size_in_meters)
#define BULLET_APPEARANCE_BITMAP(a,b) \
	long 1     \
	long a     \
	float b
	
// BULLET_APPEARANCE_BEAM(material_index, width in meters, length_in_meters)
#define BULLET_APPEARANCE_BEAM(a,b,c) \
        long 2     \
	long a     \
        float b    \
        float c

The entry I was wondering about is indeed weapon rotation "spin rate in degrees per second," which is probably part of what goes into weapon convergence.

The entry after that is just always 1, no reason given. Then after the red, green, and blue flash intensities is a fourth flash intensity "m", which I'm guessing refers to overall intensity of the flash.

Right, so FC doesn't handle camera-facing weapons (appearance 1). FC only does beams or meshes. I've handled this by just making a spherical mesh myself (like for the mass drivers). And FC doesn't scale meshes, but that's something one could do with a 3d program usually, if you have the .obj file.
 
Okay, so I'm going to need to take .obj's for each, scale them, and use those, but it would appear that the game can't even fathom the idea of an obj bullet and it just crashes to desktop with no message or error. (exactly the same as if the game just quit on its own)

It is actually doing this before I get into the mission to fire the gun. So how do you convert .obj/.mtl files into mesh.bins?
 
Okay, so I'm going to need to take .obj's for each, scale them, and use those, but it would appear that the game can't even fathom the idea of an obj bullet and it just crashes to desktop with no message or error. (exactly the same as if the game just quit on its own)

It is actually doing this before I get into the mission to fire the gun. So how do you convert .obj/.mtl files into mesh.bins?

Let's get that fixed, I want .obj bullets to work. Please file a bug report, and please do attach the .obj file to the bug report.
 
Sounds good, I'll attach the original from the conversion to avoid there being problems from my resizing and material rebuilding.
 
Back
Top