WWF: Difference between revisions

From wowdev
Jump to navigation Jump to search
mNo edit summary
 
(11 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Template:SectionBox/VersionRange|min_expansionlevel=8}}
{{Template:SectionBox/VersionRange|min_expansionlevel=8}}
[[WWF]] files are used to control particles in the particulate weather system that was introduced in {{Template:Sandbox/PrettyVersion|expansionlevel=8}}.
[[WWF]] files are used to control particles in the particulate weather system that was introduced in {{Template:Sandbox/PrettyVersion|expansionlevel=8}}.
Unlike most other files, the [[WWF]] format uses a binary header with JSON data. This has the advantage that all field names are documented within the data itself. Additionally, the client also contains meta-style information which includes the human-readable variant of these names.
Unlike most other files, the [[WWF]] format uses a binary header with JSON data. This has the advantage that all field names are documented within the data itself. Additionally, the client contains meta-style information which includes the human-readable variant of these names.


Particulate based weather is enabled for [[DB/Weather]] records with a <tt>m_type</tt> of 5 that either join to the [[DB/WeatherXParticulate]] table or have their <tt>particulateFileDataID</tt> set. Both joins reference the required [[WWF]] files by fileDataId.
Particulate based weather is enabled for [[DB/Weather]] records with a <tt>m_type</tt> of 5 {{Template:Unverified| and/or }} a <tt>m_effectType</tt> of 4, that either join to the [[DB/WeatherXParticulate]] table or have their <tt>particulateFileDataID</tt> set. Both joins reference the required [[WWF]] files by fileDataId.
 
While standalone [[WWF]] files exist (documented below), the [[WWF]] specification itself is much larger and is used client-wide e.g. [[WDT#mpv|mpv.wdt]]. As such, changes to <tt>WWFParticulateGroup</tt> correlate with [[WDT#PVMI|PVMI]] size changes and usually incur a [[WDT#mpv|mpv.wdt]] version change.


=Header=
=Header=
  char[4] unk1;  // always 0 filled
  uint32_t type;  // 0: json; 4: binary
  uint32_t magic; // fnv1a(type_as_string), i.e. for "WWFParticulateGroup", 0x932c64b4
  uint32_t magic; // fnv1a(type_as_string), i.e. for "WWFParticulateGroup", 0x932c64b4
  char data[];
  char data[];


Line 13: Line 15:
C-style representation of the [https://gist.github.com/barncastle/b69ea85208456789e5299798b02c7990 JSON data]. All enum values are stored as their string representation.
C-style representation of the [https://gist.github.com/barncastle/b69ea85208456789e5299798b02c7990 JSON data]. All enum values are stored as their string representation.


Note: Only the implemented parts of the WWF specification, as of {{Template:Sandbox/PrettyVersion|expansionlevel=8|build=8.0.1.26287}}, are documented.
Note: Only the standalone [[WWF]] file structure is documented below.


==WWFParticulateGroup==
==WWFParticulateGroup==
Line 27: Line 29:
   WWFParticulateRenderMode renderMode;
   WWFParticulateRenderMode renderMode;
   int32_t particleCount;
   int32_t particleCount;
   float strength;                 // Default Particulate Strength
   float strength;                     // Default Particulate Strength
   char enableEmissionGraph;       // Enable Particulate Strength Graph
   char enableEmissionGraph;           // Enable Particulate Strength Graph
   WWFGraphNodeVec3 graphNodes[]; // Particulate Strength Graph
   WWFGraphNodeVec3 graphNodes[];       // Particulate Strength Graph
   char occlusion;                 // Enable Occlusion Testing
   char occlusion;                     // Enable Occlusion Testing
   float occlusionFadeDistance;
   float occlusionFadeDistance;
   float occlusionIgnoreChance;
   float occlusionIgnoreChance;
   char enableGroundParticulate;
   char enableGroundParticulate;
   char depthFading;               // Enable Depth Buffer Fading
  #if {{Template:Sandbox/VersionRange|min_expansionlevel=8|min_build=8.0.1.26567}}
  WWFParticulateGeoType groundGeometryType;
  WWFParticulateRenderMode groundRenderMode;
  uint32_t groundTextureID;            // fileDataId
  uint32_t groundSheetWidth;          // Ground Cell X Count
  uint32_t groundSheetHeight          // Ground Cell Y Count
  uint32_t groundAnimationCount;
  float groundAnimationSpeed;
  char groundEnableAngularTransition;  // Ground Enable Texture Angle Fading
  float groundDecayTime;
  WWFVec2 groundParticulateSize;
  WWFVec2 groundParticulateSizeVariance;
  #endif
   char depthFading;                   // Enable Depth Buffer Fading
   float depthFadeDistance;
   float depthFadeDistance;
   char useLookDirectionOffset;
   char useLookDirectionOffset;
Line 47: Line 62:
   float speed;
   float speed;
   WWFVec3 velocityVariance;
   WWFVec3 velocityVariance;
   char enableCompute;             // Enable Dynamic Rendering
   char enableCompute;                 // Enable Dynamic Rendering
   char enableWindEffects;
   char enableWindEffects;
  #if {{Template:Sandbox/VersionRange|min_expansionlevel=8|min_build=8.0.1.26433}}
  WWFVec2 massRange;
  #endif
   char useWandering;
   char useWandering;
   float wanderSpeed;
   float wanderSpeed;
   WWFVec2 wanderAmount;
   WWFVec2 wanderAmount;
   WWFParticulateConstraintType constraint; // Volume Constraint
   WWFParticulateConstraintType constraint; // Volume Constraint
   char inclusiveRestraint;       // Use Inclusive Constraint
   char inclusiveRestraint;             // Use Inclusive Constraint
   float groupSize;               // Particulate Group Size
   float groupSize;                     // Particulate Group Size
   WWFVec3 particulateSize;
   WWFVec3 particulateSize;
   WWFVec2 particulateSizeVariance;
   WWFVec2 particulateSizeVariance;
   char randomRotation;           // Randomize Initial Particle Orientation
   char randomRotation;                 // Randomize Initial Particle Orientation
   char useParticleRotation;
   char useParticleRotation;
   float rotationSpeedMean;       // Particle Rotation Speed
   float rotationSpeedMean;             // Particle Rotation Speed
   float rotationSpeedVariance;   // Particle Rotation Speed Variance
   float rotationSpeedVariance;         // Particle Rotation Speed Variance
   char randomizeRotationDirection;
   char randomizeRotationDirection;
   float useParticleFading;
   float useParticleFading;
   float particleFadeTotalTime;   // Fade Loop Length
   float particleFadeTotalTime;         // Fade Loop Length
   float particleFadeTimeBegin;   // Fade Start Time
   float particleFadeTimeBegin;         // Fade Start Time
   float particleFadeTimeEnd;     // Fade End Time
   float particleFadeTimeEnd;           // Fade End Time
   float particleFadeTimeVariance;
   float particleFadeTimeVariance;
   char enableHeightFading;
   char enableHeightFading;
   WWFParticulateHeightFadeMode heightFadeMode;
   WWFParticulateHeightFadeMode heightFadeMode;
   float heightFadeStartDistance; // Height Fade Max Height
   float heightFadeStartDistance;       // Height Fade Max Height
   float heightFadeVariance;
   float heightFadeVariance;
   float heightFadeTransitionDistance;
   float heightFadeTransitionDistance;
Line 75: Line 93:
   float deltaCullingMax;
   float deltaCullingMax;
   WWFParticulateBlendMode blendMode;
   WWFParticulateBlendMode blendMode;
  #if {{Template:Sandbox/VersionRange|min_expansionlevel=8|min_build=8.0.1.26433}}
  char useSkyFogColor;                // Use Sky Fog Color As Diffuse
  #endif
  #if {{Template:Sandbox/VersionRange|min_expansionlevel=8|min_build=8.0.1.26567}}
  char useAmbientLighting;
  #endif
   WWFArgb color;
   WWFArgb color;
   uint32_t textureID;             // fileDataId
   uint32_t textureID;                 // fileDataId
   char useAnimation;
   char useAnimation;
   int32_t sheetWidth;             // Cell X Count
   int32_t sheetWidth;                 // Cell X Count
   int32_t sheetHeight;           // Cell Y Count
   int32_t sheetHeight;                 // Cell Y Count
   int32_t animationCount;
   int32_t animationCount;
   float animationSpeed;
   float animationSpeed;
   char enableAngularTransition;   // Enable Texture Angle Fading
   char enableAngularTransition;       // Enable Texture Angle Fading
  }
  }
   
   

Latest revision as of 01:11, 19 May 2023

This section only applies to versions ≥ Battle.

WWF files are used to control particles in the particulate weather system that was introduced in Battle. Unlike most other files, the WWF format uses a binary header with JSON data. This has the advantage that all field names are documented within the data itself. Additionally, the client contains meta-style information which includes the human-readable variant of these names.

Particulate based weather is enabled for DB/Weather records with a m_type of 5 and/or a m_effectType of 4, that either join to the DB/WeatherXParticulate table or have their particulateFileDataID set. Both joins reference the required WWF files by fileDataId.

While standalone WWF files exist (documented below), the WWF specification itself is much larger and is used client-wide e.g. mpv.wdt. As such, changes to WWFParticulateGroup correlate with PVMI size changes and usually incur a mpv.wdt version change.

Header

uint32_t type;   // 0: json; 4: binary
uint32_t magic;  // fnv1a(type_as_string), i.e. for "WWFParticulateGroup", 0x932c64b4
char data[];

Data

C-style representation of the JSON data. All enum values are stored as their string representation.

Note: Only the standalone WWF file structure is documented below.

WWFParticulateGroup

typedef C2Vector WWFVec2;
typedef C3Vector WWFVec3;
typedef C3Vector WWFGraphNodeVec3;
typedef CImVector WWFArgb;

struct WWFParticulateGroup
{
  int32_t placeHolder;
  WWFParticulateGeoType geometryType;
  WWFParticulateRenderMode renderMode;
  int32_t particleCount;
  float strength;                      // Default Particulate Strength
  char enableEmissionGraph;            // Enable Particulate Strength Graph
  WWFGraphNodeVec3 graphNodes[];       // Particulate Strength Graph
  char occlusion;                      // Enable Occlusion Testing
  float occlusionFadeDistance;
  float occlusionIgnoreChance;
  char enableGroundParticulate;
 #if ≥ Battle (8.0.1.26567)
  WWFParticulateGeoType groundGeometryType;
  WWFParticulateRenderMode groundRenderMode;
  uint32_t groundTextureID;            // fileDataId
  uint32_t groundSheetWidth;           // Ground Cell X Count
  uint32_t groundSheetHeight           // Ground Cell Y Count
  uint32_t groundAnimationCount;
  float groundAnimationSpeed;
  char groundEnableAngularTransition;  // Ground Enable Texture Angle Fading
  float groundDecayTime;
  WWFVec2 groundParticulateSize;
  WWFVec2 groundParticulateSizeVariance;
 #endif
  char depthFading;                    // Enable Depth Buffer Fading
  float depthFadeDistance;
  char useLookDirectionOffset;
  float groupEdgeFadeDistance;
  float cameraNearFade;
  float cameraFarFade;
  char useForceDirection;
  WWFVec3 velocityMean;
  WWFVec3 forceDirection;
  float rotation;
  float tilt;
  float speed;
  WWFVec3 velocityVariance;
  char enableCompute;                  // Enable Dynamic Rendering
  char enableWindEffects;
 #if ≥ Battle (8.0.1.26433)
  WWFVec2 massRange;
 #endif
  char useWandering;
  float wanderSpeed;
  WWFVec2 wanderAmount;
  WWFParticulateConstraintType constraint; // Volume Constraint
  char inclusiveRestraint;             // Use Inclusive Constraint
  float groupSize;                     // Particulate Group Size
  WWFVec3 particulateSize;
  WWFVec2 particulateSizeVariance;
  char randomRotation;                 // Randomize Initial Particle Orientation
  char useParticleRotation;
  float rotationSpeedMean;             // Particle Rotation Speed
  float rotationSpeedVariance;         // Particle Rotation Speed Variance
  char randomizeRotationDirection;
  float useParticleFading;
  float particleFadeTotalTime;         // Fade Loop Length
  float particleFadeTimeBegin;         // Fade Start Time
  float particleFadeTimeEnd;           // Fade End Time
  float particleFadeTimeVariance;
  char enableHeightFading;
  WWFParticulateHeightFadeMode heightFadeMode;
  float heightFadeStartDistance;       // Height Fade Max Height
  float heightFadeVariance;
  float heightFadeTransitionDistance;
  char enableDeltaCulling;
  float deltaCullingMax;
  WWFParticulateBlendMode blendMode;
 #if ≥ Battle (8.0.1.26433)
  char useSkyFogColor;                 // Use Sky Fog Color As Diffuse
 #endif
 #if ≥ Battle (8.0.1.26567)
  char useAmbientLighting;
 #endif
  WWFArgb color;
  uint32_t textureID;                  // fileDataId
  char useAnimation;
  int32_t sheetWidth;                  // Cell X Count
  int32_t sheetHeight;                 // Cell Y Count
  int32_t animationCount;
  float animationSpeed;
  char enableAngularTransition;        // Enable Texture Angle Fading
}

enum WWFParticulateGeoType
{
  Quads,
  Triangles
}

enum WWFParticulateRenderMode
{
  VelocityBillboard,
  CameraBillboard
}

enum WWFParticulateConstraintType
{
  Center,
  Nearest,
  None
}

enum WWFParticulateHeightFadeMode
{
  Flat,
  Relative,
  RelativeFollow
}

enum WWFParticulateBlendMode
{
  Additive,
  Blended
}