Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions Editors/BmdEditor/ViewModels/BmdEditorViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -358,11 +358,11 @@ private string GenerateComponentDetails(BmdElementViewModel component)
details.AppendLine("VFX Details:");
details.AppendLine($" Version: {vfx.Vfx.VfxInfoVersion}");
details.AppendLine($" VFX String: {vfx.Vfx.VfxString}");
details.AppendLine($" Flag Version: {vfx.Vfx.FlagVersion}");
details.AppendLine($" Allow In Outfield: {vfx.Vfx.AllowInOutfield}");
details.AppendLine($" Clamp To Water: {vfx.Vfx.ClampToWaterSurface}");
details.AppendLine($" Visible In Tactical: {vfx.Vfx.VisibleInTactical}");
details.AppendLine($" Only Visible In Tactical: {vfx.Vfx.OnlyVisibleInTactical}");
details.AppendLine($" Flag Version: {vfx.Vfx.Flags.FlagVersion}");
details.AppendLine($" Allow In Outfield: {vfx.Vfx.Flags.AllowInOutfield}");
details.AppendLine($" Clamp To Water: {vfx.Vfx.Flags.ClampToWaterSurface}");
details.AppendLine($" Visible In Tactical: {vfx.Vfx.Flags.VisibleInTactical}");
details.AppendLine($" Only Visible In Tactical: {vfx.Vfx.Flags.OnlyVisibleInTactical}");
details.AppendLine($" Autoplay: {vfx.Vfx.Autoplay}");
details.AppendLine($" Visible In Shroud: {vfx.Vfx.VisibleInShroud}");
details.AppendLine($" Parent ID: {vfx.Vfx.ParentId}");
Expand All @@ -380,9 +380,9 @@ private string GenerateComponentDetails(BmdElementViewModel component)
details.AppendLine($" Animation Speed 2: {light.Light.AnimationSpeedScale2:F2}");
details.AppendLine($" Color Min: {light.Light.ColorMin:F2}");
details.AppendLine($" Random Offset: {light.Light.RandomOffset:F2}");
details.AppendLine($" WPLFT Type: {light.Light.WPLFTType}");
details.AppendLine($" Falloff Type: {light.Light.FalloffType}");
details.AppendLine($" Height Mode: {light.Light.HeightMode}");
details.AppendLine($" For Light Probe Only: {light.Light.ForLightProbeOnly}");
details.AppendLine($" Light Probe Only: {light.Light.LightProbeOnly}");
break;

case SpotLightInfoViewModel spotLight:
Expand Down
19 changes: 19 additions & 0 deletions Editors/Reports/Bmd/BmdReportGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,13 @@ public void Create(string outputDir = null)
vfxRecord.PositionY = vfx.Transform.M42;
vfxRecord.PositionZ = vfx.Transform.M43;
vfxRecord.VfxString = vfx.VfxString;
vfxRecord.EmissionRate = vfx.EmissionRate;
vfxRecord.InstanceName = vfx.InstanceName;
vfxRecord.ClampToSurface = vfx.Flags.ClampToSurface;
vfxRecord.SeasonSpring = vfx.Flags.SeasonSpring;
vfxRecord.SeasonSummer = vfx.Flags.SeasonSummer;
vfxRecord.SeasonAutumn = vfx.Flags.SeasonAutumn;
vfxRecord.SeasonWinter = vfx.Flags.SeasonWinter;
vfxRecords.Add(vfxRecord);
}

Expand Down Expand Up @@ -326,6 +333,10 @@ public void Create(string outputDir = null)
pointLightRecord.PositionY = pointLight.Position.Y;
pointLightRecord.PositionZ = pointLight.Position.Z;
pointLightRecord.Color = $"{pointLight.Red},{pointLight.Green},{pointLight.Blue}";
pointLightRecord.FalloffType = pointLight.FalloffType;
pointLightRecord.LFRelative = pointLight.LFRelative;
pointLightRecord.LightProbeOnly = pointLight.LightProbeOnly;
pointLightRecord.PdlcMask = pointLight.PdlcMask;
pointLightRecords.Add(pointLightRecord);
}

Expand All @@ -346,9 +357,17 @@ public void Create(string outputDir = null)
{
dynamic playableAreaRecord = new ExpandoObject();
playableAreaRecord.Path = path;
playableAreaRecord.PlayableAreaVersion = parsedFile.PlayableArea.PlayableAreaVersion;
playableAreaRecord.BoundingBoxMinX = parsedFile.PlayableArea.BoundingBox.Length > 0 ? parsedFile.PlayableArea.BoundingBox[0] : 0;
playableAreaRecord.BoundingBoxMinY = parsedFile.PlayableArea.BoundingBox.Length > 1 ? parsedFile.PlayableArea.BoundingBox[1] : 0;
playableAreaRecord.BoundingBoxMaxX = parsedFile.PlayableArea.BoundingBox.Length > 2 ? parsedFile.PlayableArea.BoundingBox[2] : 0;
playableAreaRecord.BoundingBoxMaxY = parsedFile.PlayableArea.BoundingBox.Length > 3 ? parsedFile.PlayableArea.BoundingBox[3] : 0;
playableAreaRecord.HasBeenSet = parsedFile.PlayableArea.HasBeenSet;
playableAreaRecord.FlagVersion = parsedFile.PlayableArea.FlagVersion;
playableAreaRecord.Flag1 = parsedFile.PlayableArea.Flag1;
playableAreaRecord.Flag2 = parsedFile.PlayableArea.Flag2;
playableAreaRecord.Flag3 = parsedFile.PlayableArea.Flag3;
playableAreaRecord.Flag4 = parsedFile.PlayableArea.Flag4;
playableAreaRecords.Add(playableAreaRecord);
}

Expand Down
85 changes: 59 additions & 26 deletions Shared/GameFiles/Bmd/BmdFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ public class BmdFile
public List<TreeListReference> TreeListReferences { get; set; } = new();
public List<GrassListReference> GrassListReferences { get; set; } = new();
public List<WaterOutline> WaterOutlines { get; set; } = new();

//Pharaoh Exclusive classes (for Pharaoh's version of the version 25 BMD format)
public CameraZoneNew CameraZoneNew { get; set; } = new();
public MiscParams MiscParams { get; set; } = new();
}

public class FastBinHeader
Expand Down Expand Up @@ -91,6 +95,20 @@ public struct CultureMask
public bool CultMaskChd { get; set; }
}

public class BmdComponentFlags
{
public ushort FlagVersion { get; set; }
public bool AllowInOutfield { get; set; }
public bool ClampToSurface { get; set; } //Flag version 2 only
public bool ClampToWaterSurface { get; set; }
public bool SeasonSpring { get; set; }
public bool SeasonSummer { get; set; }
public bool SeasonAutumn { get; set; }
public bool SeasonWinter { get; set; }
public bool VisibleInTactical { get; set; }
public bool OnlyVisibleInTactical { get; set; }
}

public class BattlefieldBuilding
{
public ushort Version { get; set; }
Expand Down Expand Up @@ -186,8 +204,8 @@ public class BmdInfo
public ushort Version { get; set; }
public string BmdString { get; set; } = string.Empty;
public Matrix Transform { get; set; } = Matrix.Identity;
public byte[] SeasonsMaybe { get; set; } = new byte[4]; //is this <property_overrides/>?
public CultureMask CultureMask { get; set; }
public byte[] SeasonsMaybe { get; set; } = new byte[4]; //this has to correspond to <property_overrides/>
public CultureMask CultureMask { get; set; } //"campaign_type_mask"?
public string RegionString { get; set; } = string.Empty;
public string HeightMode { get; set; } = string.Empty;
public byte[] Uid { get; set; } = new byte[8];
Expand Down Expand Up @@ -229,7 +247,6 @@ public class CivilianShelter
public ushort Version { get; set; }
}


public class PropInfo
{
public ushort PropInfoVersion { get; set; }
Expand All @@ -247,16 +264,7 @@ public class PropInfo
public float DecalTiling { get; set; }
public bool DecalOverrideGbufferNormal { get; set; }

public ushort FlagsVersion { get; set; }
public bool AllowInOutfield { get; set; }
public bool ClampToWaterSurface { get; set; }
public bool FlagBool3 { get; set; } //Flag version 3/4 or something
public bool SeasonSpring { get; set; }
public bool SeasonSummer { get; set; }
public bool SeasonAutumn { get; set; }
public bool SeasonWinter { get; set; }
public bool VisibleInTactical { get; set; }
public bool OnlyVisibleInTactical { get; set; }
public BmdComponentFlags Flags { get; set; } = new();

public bool VisibleInShroud { get; set; }
public bool ApplyToTerrain { get; set; }
Expand Down Expand Up @@ -285,14 +293,11 @@ public class VfxInfo
public ushort VfxInfoVersion { get; set; }
public string VfxString { get; set; } = string.Empty;
public Matrix Transform { get; set; } = Matrix.Identity;
public byte[] Booleans { get; set; } = new byte[6];
public ushort FlagVersion { get; set; }
public bool AllowInOutfield { get; set; }
public bool ClampToWaterSurface { get; set; }
public bool Version2ExtraBool { get; set; }
public byte[] Seasons { get; set; } = new byte[4];
public bool VisibleInTactical { get; set; }
public bool OnlyVisibleInTactical { get; set; }
public float EmissionRate { get; set; }
public string InstanceName { get; set; } = string.Empty;

public BmdComponentFlags Flags { get; set; } = new();

public string HeightMode { get; set; } = string.Empty;
public byte[] CultureMask { get; set; } = new byte[8];
public bool Autoplay { get; set; }
Expand Down Expand Up @@ -380,12 +385,11 @@ public class PointLightInfo
public float AnimationSpeedScale2 { get; set; }
public float ColorMin { get; set; }
public float RandomOffset { get; set; }
public string WPLFTType { get; set; } = string.Empty;
public byte SomeZero { get; set; }
public string FalloffType { get; set; } = string.Empty;
public byte LFRelative { get; set; }
public string HeightMode { get; set; } = string.Empty;
public bool ForLightProbeOnly { get; set; }
public byte[] MoreData { get; set; } = new byte[4];
public byte[] EvenMoreData { get; set; } = new byte[4];
public bool LightProbeOnly { get; set; }
public ulong PdlcMask { get; set; }
public byte[] MoreData2 { get; set; } = new byte[10];
}

Expand Down Expand Up @@ -557,4 +561,33 @@ public class WaterOutline
//TODO: Not properly implemented
public ushort Version { get; set; }
}



//Pharaoh Exclusive classes (for Pharaoh's version of the version 25 BMD format)
//This is version hell! They didn't keep the versions consistent!
public class CameraZoneNew
{
//TODO: Not properly implemented
public ushort Version { get; set; }
}
public class MiscParams
{
public ushort Version { get; set; }
public string WaterPlaneMaterial { get; set; } = string.Empty;
public float NormalTiling { get; set; }
public float NormalStrengthScale { get; set; }
public float NormalTimeScale { get; set; }
public float DepthDistortionCoef { get; set; }
public float CausticsScale { get; set; }
public float CausticsMinDepthCoef { get; set; }
public float CausticsMaxDepthCoef { get; set; }
public float WaterOpacity { get; set; }
public float WaterSpeed { get; set; }
public float WaterDirection { get; set; }
public bool ShoreWaves { get; set; }
public RmvVector2 CausticsUvScale { get; set; }
public RmvVector3 WaterColor { get; set; }
public RmvVector3 WaterSpecular { get; set; }
}
}
Loading
Loading