Skip to content

Commit

Permalink
Defs 10 3 23 (1.9.0) (#712)
Browse files Browse the repository at this point in the history
* Revert accidental MSBReadWrite.cs change

* MSBE unk

* AC6 def

* AC6 row names

* AC6 upgrade version 1.03.1

* AC6 defs

* Increase param meta imgui graph length max

* AC6 defs
  • Loading branch information
kingborehaha authored Oct 5, 2023
1 parent 3c72e75 commit 37585b7
Show file tree
Hide file tree
Showing 17 changed files with 71 additions and 58 deletions.
22 changes: 8 additions & 14 deletions SoulsFormats/SoulsFormats/Formats/MSB/MSBE/PartsParam.cs
Original file line number Diff line number Diff line change
Expand Up @@ -218,19 +218,15 @@ public enum UnkEnabledStateType : int
public uint EntityID { get; set; }

/// <summary>
/// Unknown.
/// </summary>
public byte UnkE04 { get; set; }

/// <summary>
/// Unknown.
/// Enables use of PartsDrawParamID. If false, asset param is used instead.
/// </summary>
public byte LodParamID { get; set; }
public byte isUsePartsDrawParamID { get; set; }

/// <summary>
/// Unknown.
/// </summary>
public byte UnkE09 { get; set; }
[MSBParamReference(ParamName = "PartsDrawParam")]
public short PartsDrawParamID { get; set; }

/// <summary>
/// Unknown.
Expand Down Expand Up @@ -472,12 +468,11 @@ private protected Part(BinaryReaderEx br)
private void ReadEntityData(BinaryReaderEx br)
{
EntityID = br.ReadUInt32();
UnkE04 = br.ReadByte();
isUsePartsDrawParamID = br.ReadByte();
br.AssertByte(0);
br.AssertByte(0);
br.AssertByte(0); // Former lantern ID
LodParamID = br.ReadByte();
UnkE09 = br.ReadByte();
PartsDrawParamID = br.ReadInt16();
IsPointLightShadowSrc = br.ReadSByte(); // Seems to be 0 or -1
UnkE0B = br.ReadByte();
IsShadowSrc = br.ReadBoolean();
Expand Down Expand Up @@ -665,12 +660,11 @@ internal override void Write(BinaryWriterEx bw, int id)
private void WriteEntityData(BinaryWriterEx bw)
{
bw.WriteUInt32(EntityID);
bw.WriteByte(UnkE04);
bw.WriteByte(isUsePartsDrawParamID);
bw.WriteByte(0);
bw.WriteByte(0);
bw.WriteByte(0);
bw.WriteByte(LodParamID);
bw.WriteByte(UnkE09);
bw.WriteInt16(PartsDrawParamID);
bw.WriteSByte(IsPointLightShadowSrc);
bw.WriteByte(UnkE0B);
bw.WriteBoolean(IsShadowSrc);
Expand Down
6 changes: 3 additions & 3 deletions StudioCore/Assets/Paramdex/AC6/Defs/AtkParam.xml
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@
<Field Def="u16 pulseInterferenceDamage">
<Description>Bonus damage dealt to most sources of pulse armor and pulse barriers. Doesn't affect shields, nor weapons that create AEG-based pulse barriers.</Description>
</Field>
<Field Def="s32 weaponImpactDamage">
<Field Def="s32 impactDamage">
<Description>ACS overload performance. This corresponds to immediate ACS strain, which resets within a short period.</Description>
</Field>
<Field Def="s32 UnkInt0x214"></Field>
Expand Down Expand Up @@ -370,7 +370,7 @@
<Field Def="s32 UnkInt0x328"></Field>
<Field Def="u8 Unk0x32C"></Field>
<Field Def="u8 UnkByte0x32D"></Field>
<Field Def="u16 UnkUshort0x32E"></Field>
<Field Def="u16 attack_Object"></Field>
<Field Def="u8 UnkByte0x330"></Field>
<Field Def="s8 UnkSbyte0x331"></Field>
<Field Def="s16 UnkShort0x332"></Field>
Expand Down Expand Up @@ -451,7 +451,7 @@
<Field Def="s32 UnkInt0x3D0"></Field>
<Field Def="f32 UnkFloat0x3D4"></Field>
<Field Def="f32 UnkFloat0x3D8"></Field>
<Field Def="s32 weaponChargedAccumulativeImpact">
<Field Def="s32 accumulativeImpactDamage">
<Description>Accumulative ACS overload performance for charge attacks. This corresponds to sustained ACS strain, which is alleviated over time.</Description>
</Field>
<Field Def="s32 sfxModelParamId">
Expand Down
4 changes: 2 additions & 2 deletions StudioCore/Assets/Paramdex/AC6/Defs/AttackActionParam.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,13 @@
<Field Def="s32 Unk0x34"></Field>
<Field Def="u8 UnkByte0x38"></Field>
<Field Def="u8 UnkByte0x39"></Field>
<Field Def="u8 UnkByte0x3A"></Field>
<Field Def="u8 unkShootWarning0x3A"></Field>
<Field Def="s8 UnkSbyte0x3B"></Field>
<Field Def="f32 UnkFloat0x3C"></Field>
<Field Def="f32 UnkFloat0x40"></Field>
<Field Def="s32 Unk0x44"></Field>
<Field Def="s32 Unk0x48"></Field>
<Field Def="u8 UnkByte0x4C"></Field>
<Field Def="u8 unkShootWarning0x4C"></Field>
<Field Def="u8 UnkByte0x4D"></Field>
<Field Def="s16 Unk0x4E"></Field>
<Field Def="s32 UnkInt0x50"></Field>
Expand Down
6 changes: 3 additions & 3 deletions StudioCore/Assets/Paramdex/AC6/Defs/Bullet.xml
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@
<Field Def="f32 UnkFloat0xE4"></Field>
<Field Def="f32 UnkFloat0xE8"></Field>
<Field Def="s16 UnkShort0xEC"></Field>
<Field Def="s16 UnkShort0xEE"></Field>
<Field Def="f32 UnkFloat0xF0"></Field>
<Field Def="s16 unkLoseHomingLineupTime"></Field>
<Field Def="f32 randomMoveAngle"></Field>
<Field Def="f32 UnkFloat0xF4"></Field>
<Field Def="u8 UnkByte0xF8"></Field>
<Field Def="u8 UnkByte0xF9"></Field>
Expand Down Expand Up @@ -281,7 +281,7 @@
<Field Def="s8 UnkSbyte0x301"></Field>
<Field Def="s8 UnkSbyte0x302"></Field>
<Field Def="s8 UnkSbyte0x303"></Field>
<Field Def="f32 UnkFloat0x304"></Field>
<Field Def="f32 lifeDist"></Field>
<Field Def="f32 UnkFloat0x308"></Field>
<Field Def="f32 UnkFloat0x30C"></Field>
<Field Def="f32 UnkFloat0x310"></Field>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@
<Field Def="f32 Unk0x2B4"></Field>
<Field Def="f32 Unk0x2B8"></Field>
<Field Def="f32 Unk0x2BC"></Field>
<Field Def="f32 Unk0x2C0"></Field>
<Field Def="f32 unkAttitudeStability"></Field>
<Field Def="f32 Unk0x2C4"></Field>
<Field Def="f32 Unk0x2C8"></Field>
<Field Def="f32 Unk0x2CC"></Field>
Expand Down
8 changes: 4 additions & 4 deletions StudioCore/Assets/Paramdex/AC6/Defs/EquipParamWeapon_PC.xml
Original file line number Diff line number Diff line change
Expand Up @@ -394,8 +394,8 @@
<Field Def="f32 chargeTime">
<Description>Time it takes to complete charging, for weapons that support charging.</Description>
</Field>
<Field Def="f32 UnkFloat0x3A4"></Field>
<Field Def="f32 UnkFloat0x3A8"></Field>
<Field Def="f32 partialChargeDrainDelay"></Field>
<Field Def="f32 partialChargeFullDrainTime"></Field>
<Field Def="s32 UnkInt0x3AC"></Field>
<Field Def="s32 UnkInt0x3B0"></Field>
<Field Def="f32 Unk0x3B4"></Field>
Expand Down Expand Up @@ -451,7 +451,7 @@
<Field Def="f32 UnkFloat0x444"></Field>
<Field Def="s8 UnkSbyte0x448"></Field>
<Field Def="u8 Unk0x449"></Field>
<Field Def="u16 unkCoreExpansion0x44A"></Field>
<Field Def="u16 coreExpansionEffect_Display"></Field>
<Field Def="u16 unkCoreExpansion0x44C"></Field>
<Field Def="u16 UnkUshort0x44E"></Field>
<Field Def="f32 unkCoreExpansion0x450"></Field>
Expand Down Expand Up @@ -533,7 +533,7 @@
<Field Def="u8 Unk0x54E"></Field>
<Field Def="u8 Unk0x54F"></Field>
<Field Def="f32 UnkFloat0x550"></Field>
<Field Def="s32 UnkInt0x554"></Field>
<Field Def="s32 projectedBarrierHealth"></Field>
<Field Def="f32 UnkFloat0x558"></Field>
<Field Def="u16 UnkUshort0x55C"></Field>
<Field Def="u16 UnkUshort0x55E"></Field>
Expand Down
2 changes: 1 addition & 1 deletion StudioCore/Assets/Paramdex/AC6/Defs/MissionParam.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<Field Def="s8 UnkSbyte0x10"></Field>
<Field Def="u8 Unk0x11"></Field>
<Field Def="u16 UnkUshort0x12"></Field>
<Field Def="u8 UnkByte0x14"></Field>
<Field Def="s8 missionType"></Field>
<Field Def="s8 UnkSbyte0x15"></Field>
<Field Def="u8 Unk0x16"></Field>
<Field Def="u8 Unk0x17"></Field>
Expand Down
2 changes: 1 addition & 1 deletion StudioCore/Assets/Paramdex/AC6/Defs/SpEffectParam.xml
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@
<Field Def="s32 UnkInt0x35C"></Field>
<Field Def="s32 UnkInt0x360"></Field>
<Field Def="f32 UnkFloat0x364"></Field>
<Field Def="f32 UnkFloat0x368"></Field>
<Field Def="f32 damageCutRate_Impact"></Field>
<Field Def="f32 UnkFloat0x36C"></Field>
<Field Def="f32 UnkFloat0x370"></Field>
<Field Def="f32 Unk0x374"></Field>
Expand Down
1 change: 1 addition & 0 deletions StudioCore/Assets/Paramdex/AC6/Meta/AtkParam.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<recoilVelocity_Grounded Name="Recoil Velocity (Grounded)" Wiki="Backwards velocity applied to the shooter when using a weapon on the ground. Applies conditionally, such as not applying when AC has tank legs."/>
<recoilVelocity_Airborne Name="Recoil Velocity (Airborne)" Wiki="Backwards velocity applied to the shooter when using a weapon in the air."/>
<hitboxShape Name="Hitbox Shape" Enum ="ATKPARAM_HIT_CREATE_TYPE" Wiki="Backwards velocity applied to the shooter when using a weapon in the air."/>
<attack_Object Name="Attack damage (Object)" Wiki="Base object damage. Responsible for damage dealt to assets, including EULE/60D barriers."/>
</Field>
<Self />
</PARAMMETA>
1 change: 1 addition & 0 deletions StudioCore/Assets/Paramdex/AC6/Meta/Bullet.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
<spEffectId2 AltName="Target SpEffect ID [2]" Wiki="SpEffect applied to hit targets." Refs="SpEffectParam" />
<spEffectId3 AltName="Target SpEffect ID [3]" Wiki="SpEffect applied to hit targets." Refs="SpEffectParam" />
<spEffectId4 AltName="Target SpEffect ID [4]" Wiki="SpEffect applied to hit targets." Refs="SpEffectParam" />
<lifeDist AltName="Expire Distance" Wiki="Distance travelled before bullet expires." />
</Field>
<Self />
</PARAMMETA>
2 changes: 1 addition & 1 deletion StudioCore/Assets/Paramdex/AC6/Meta/CalcCorrectGraph.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<PARAMMETA XmlVersion="0">
<Field></Field>
<Self />
<Self Wiki="Handles value curve functions for various mechanics." CalcCorrectDef="stageMaxVal0,stageMaxVal1,stageMaxVal2,stageMaxVal3,stageMaxVal4,stageMaxGrowVal0,stageMaxGrowVal1,stageMaxGrowVal2,stageMaxGrowVal3,stageMaxGrowVal4,adjPt_maxGrowVal0,adjPt_maxGrowVal1,adjPt_maxGrowVal2,adjPt_maxGrowVal3" SoulCostDef="init_inclination_soul,adjustment_value,boundry_inclination_soul,boundry_value,200,713" />
</PARAMMETA>
11 changes: 10 additions & 1 deletion StudioCore/Assets/Paramdex/AC6/Meta/MissionParam.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<PARAMMETA XmlVersion="0">
<Enums>
<Enum Name="MISSION_TYPE" type="s8">
<Option Value="0" Name="Story" />
<Option Value="1" Name="Free Exploration" />
<Option Value="2" Name="AC TEST" />
<Option Value="3" Name="Training" />
</Enum>
</Enums>
<Field>
<forcedLoadoutCharaInitParamID AltName="Forced Loadout (CharaInitParam ID)" Refs="CharaInitParam" />
<forcedLoadoutCharaInitParamID AltName="Forced Loadout (CharaInitParam ID)" Refs="CharaInitParam" />
<missionType AltName="Mission Type" Enum ="MISSION_TYPE"/>
</Field>
<Self />
</PARAMMETA>
11 changes: 11 additions & 0 deletions StudioCore/Assets/Paramdex/AC6/Names/CalcCorrectGraph.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
260 Boost Speed (Weight)
261 Boost Speed (Weight)
262 Boost Speed (Weight)
263 Boost Speed (Weight)
264 Boost Speed (Weight)
265 Boost Speed (Weight)
266 Boost Speed (Weight)
267 Boost Speed (Weight)
268 Boost Speed (Weight)
269 Boost Speed (Weight)
278 Attitude Recovery (Weight)
6 changes: 6 additions & 0 deletions StudioCore/Assets/Paramdex/AC6/Names/SpEffectParam.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
9303 Repair Kit (Default)
9304 Repair Kit (Upgrade 0)
9305 Repair Kit (Upgrade 1)
9306 Repair Kit (Upgrade 2)
9307 Repair Kit (Upgrade 3)
200001630 TERMINAL ARMOR / PULSE ARMOR
200001631 TERMINAL ARMOR / PULSE ARMOR
200001640 During Assault Boost
2 changes: 1 addition & 1 deletion StudioCore/Assets/Paramdex/AC6/Upgrader/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1_03_0_0151
1_03_1_0185
4 changes: 2 additions & 2 deletions StudioCore/ParamEditor/ParamUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,8 @@ public static (float[], int, float, float) getCalcCorrectedData(CalcCorrectDefin
if (ccd.adjPoint_maxGrowVal != null)
adjPoint_maxGrowVal = ccd.adjPoint_maxGrowVal.Select((x, i) => (float)row[x].Value.Value).ToArray();

int length = (int)(stageMaxVal[stageMaxVal.Length-1] - stageMaxVal[0] + 1);
if (length <= 0 || length > 1000)
int length = (int)(stageMaxVal[stageMaxVal.Length - 1] - stageMaxVal[0] + 1);
if (length <= 0 || length > 1000000)
return (new float[0], 0, 0, 0);

if (ccd.fcsMaxdist != null)
Expand Down
39 changes: 15 additions & 24 deletions StudioCore/Tests/MSBReadWrite.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,42 +5,33 @@
using System.Threading.Tasks;
using System.IO;
using SoulsFormats;
using StudioCore.ParamEditor;
using StudioCore.TextEditor;

namespace StudioCore.Tests
{
public static class MSBReadWrite
{
public static bool Run(AssetLocator locator)
{
List<string> output = new();

Dictionary<int, string> nameDict = new(); // behaviorVariationID, weapon name

var wepParam = ParamBank.PrimaryBank.Params["EquipParamWeapon"];
var behParam = ParamBank.PrimaryBank.Params["BehaviorParam_PC"];
var entries = FMGBank.GetFmgEntriesByCategoryAndTextType(FmgEntryCategory.Weapons, FmgEntryTextType.Title);

foreach (var wep in wepParam.Rows)
var msbs = locator.GetFullMapList();
foreach (var msb in msbs)
{
var entry = entries.Find(e => e.ID == wep.ID);
if (entry != default)
nameDict[(int)wep["behaviorJudgeId"].Value.Value] = entry.Text;
}

foreach (var beh in behParam.Rows)
{
if (nameDict.TryGetValue((int)beh["behaviorJudgeId"].Value.Value, out string name))
var path = locator.GetMapMSB(msb);
var bytes = File.ReadAllBytes(path.AssetPath);
var decompressed = DCX.Decompress(bytes);
MSBE m = MSBE.Read(decompressed);
var written = m.Write(DCX.Type.None);
if (!decompressed.Span.SequenceEqual(written))
{
output.Add($"{beh.ID} {name}");
var basepath = Path.GetDirectoryName(path.AssetPath);
if (!Directory.Exists($@"{basepath}\mismatches"))
{
Directory.CreateDirectory($@"{basepath}\mismatches");
}
Console.WriteLine($@"Mismatch: {msb}");
File.WriteAllBytes($@"{basepath}\mismatches\{Path.GetFileNameWithoutExtension(path.AssetPath)}", written);
}
}

File.WriteAllLines("BehaviorParam_PC.txt", output);

return true;
}
}

}

0 comments on commit 37585b7

Please sign in to comment.