feat: more proto

This commit is contained in:
tresabhi committed 2025-01-29 19:14:46 -06:00
1 parent 5881b5b533
commit 67f312075a
5 files changed
+79 -75

No files matched your search

@@ -5,3 +5,5 @@
`Blitz/Config/DefaultDlc.ini` contains DLC info; essentially extra `pak` containers `Blitz/Config/DefaultDlc.ini` contains DLC info; essentially extra `pak` containers
`Blitz/Content/TanksStuff/Common/DT_TankClasses.uasset` seems to have all tank classes `Blitz/Content/TanksStuff/Common/DT_TankClasses.uasset` seems to have all tank classes
`C:\Users\coola\AppData\Local\Blitz\Saved\PersistentDownloadDir\http\dl-wotblitz-gc.wargaming.net\dlc\p14y73c7_p5e_b10gg3RS_big_play\ue_localizations\development\general` has all localization files
+1 -1
View File
@@ -2,6 +2,6 @@ syntax = "proto2";
package blitzkit; package blitzkit;
message I18nString { message I18n {
map<string, string> locales = 1; map<string, string> locales = 1;
} }
+58 -59
View File
@@ -1,83 +1,82 @@
syntax = "proto2"; syntax = "proto2";
import "packages/core/src/protos/i18n.proto";
package blitzkit; package blitzkit;
message Tank { message Tank {
required ModuleHealth turret_rotator_health = 1; required string id = 1;
required ModuleHealth surveying_device_health = 2; required I18n name = 2;
required ModuleHealth gun_health = 3; required string set = 3;
required ModuleHealth chassis_health = 4; required string class = 4;
required ModuleHealth ammo_bay_health = 5; // nations have been renamed to factions
required ModuleHealth engine_health = 6; required string faction = 5;
required ModuleHealth fuel_tank_health = 7;
map<string, float> crew_healths = 8; required ModuleHealth turret_rotator_health = 6;
required ModuleHealth surveying_device_health = 7;
required ModuleHealth gun_health = 8;
required ModuleHealth chassis_health = 9;
required ModuleHealth ammo_bay_health = 10;
required ModuleHealth engine_health = 11;
required ModuleHealth fuel_tank_health = 12;
map<string, float> crew_health = 13;
required float max_health = 14;
required float health_burn_per_second = 15;
required float fire_starting_chance = 16;
required float max_health = 9; required float concealment_stationary = 17;
required float concealment_stationary = 10; required float concealment_moving = 18;
required float concealment_moving = 11; required float concealment_factor_on_shot = 19;
required float concealment_on_shot = 12;
repeated PitchLimit up_pitch_limits = 13; required float turret_turn_rate = 20;
repeated PitchLimit down_pitch_limits = 14; required float circular_vision_radius = 21;
required float turret_turn_rate = 15; repeated Shell shells = 22;
required float spotting_range = 16; required float reload_time = 23;
required float dispersion_angle = 24;
required float shot_dispersion_factor = 25;
required float turret_rotation_dispersion_factor = 26;
required float aiming_time = 27;
required float gun_turn_rate = 28;
repeated Shell shells = 17; required float mass = 29;
required float engine_power = 30;
required float reload_time = 18; required float forward_max_speed = 31;
required float backward_max_speed = 32;
required float dispersion_stationary = 19; required float rotation_speed = 33;
required float dispersion_turret_rotation = 20; required float terrain_resistance_hard = 34;
required float dispersion_moving = 21; required float brake_force = 35;
required float dispersion_hull_rotation = 22; required bool b_rotation_is_around_center = 36;
required float gun_turn_rate = 23;
required float mass = 24;
required float engine_power = 25;
required float max_speed_forwards = 26;
required float max_speed_backwards = 27;
required float rotation_speed = 28;
required float terrain_resistance_hard = 29;
required float terrain_resistance_medium = 30;
required float terrain_resistance_soft = 31;
required float brake_force = 32;
} }
message Shell { message Shell {
required float speed = 1; required float speed = 1;
required float armor_damage = 2; required float gravity = 2;
required float module_damage = 3; required float armor_damage = 3;
required float caliber = 4; required float module_damage = 4;
required float penetration = 5; required float caliber = 5;
required float penetration_500m = 6; required float piercing_power = 6;
required float normalization = 7; required float piercing_power_500m = 7;
required float range = 8; required float normalization = 8;
required float ricochet = 9; required float max_distance = 9;
required float penetration_loss_by_distance = 10; required float ricochet_angle = 10;
required float explosion_radius = 11; required float piercing_power_loss_factor_by_distance = 11;
required int32 max_count = 12; required float explosion_radius = 12;
} required int32 max_count = 13;
message PitchLimit {
required float angle = 1;
required float value = 2;
} }
message ModuleHealth { message ModuleHealth {
// max health, assigned by default at the start of the battle // max health, assigned by default at the start of the battle
required float max = 1; required float max_health = 1;
// max health reached as the module regenerates after breaking // max health reached as the module regenerates after breaking
required float max_regen = 2; required float max_regen_health = 2;
// the range from 0 to this where the module is "red" and doesn't function // the range from 0 to this where the module is "red" and doesn't function
// all the while healing; after surpassing this, the "yellow" phase is reached // all the while healing; after surpassing this, the "yellow" phase is reached
required float hysteresis = 3; required float hysteresis_health = 3;
// the heal rate (per second); this won't apply if the health is at or above // the heal rate (per second); this won't apply if the health is at or above
// max_regen hence always leaving it in the "yellow" phase until repaired // max_regen hence always leaving it in the "yellow" phase until repaired
required float heal_rate = 4; required float health_regen_per_second = 4;
// damage received (per second) to the modules when caught on fire // damage received (per second) to the modules when caught on fire; this can
required float burn_rate = 5; // be undefined for some modules like the gun or chassis
optional float health_burn_per_second = 5;
} }
+17 -14
View File
@@ -1,6 +1,9 @@
using Blitzkit;
using BlitzKit.CLI.Models; using BlitzKit.CLI.Models;
using BlitzKit.CLI.Utils; using BlitzKit.CLI.Utils;
using CUE4Parse.FileProvider.Objects; using CUE4Parse.FileProvider.Objects;
using Google.Protobuf;
using Newtonsoft.Json.Linq;
namespace BlitzKit.CLI.Functions namespace BlitzKit.CLI.Functions
{ {
@@ -8,6 +11,7 @@ namespace BlitzKit.CLI.Functions
{ {
public static void Mangle() public static void Mangle()
{ {
Tanks tanks = new();
BlitzProvider provider = new(); BlitzProvider provider = new();
foreach (var nation in provider.RootDirectory.GetDirectory("Blitz/Content/Tanks").Directories) foreach (var nation in provider.RootDirectory.GetDirectory("Blitz/Content/Tanks").Directories)
@@ -20,13 +24,14 @@ namespace BlitzKit.CLI.Functions
if (tank.Key != "R90_IS_4") if (tank.Key != "R90_IS_4")
continue; continue;
tanks.Tanks_.Add(tank.Key);
var attributeFileName = $"DA_{tank.Key}_Attributes.uasset"; var attributeFileName = $"DA_{tank.Key}_Attributes.uasset";
var hasAttributesFile = tank.Value.HasFile(attributeFileName); var hasAttributesFile = tank.Value.HasFile(attributeFileName);
GameFile? attributes = null; GameFile? attributesFile = null;
if (hasAttributesFile) if (hasAttributesFile)
{ {
attributes = tank.Value.GetFile(attributeFileName); attributesFile = tank.Value.GetFile(attributeFileName);
} }
else else
{ {
@@ -38,12 +43,12 @@ namespace BlitzKit.CLI.Functions
{ {
if (file.Key.EndsWith("_Attributes.uasset")) if (file.Key.EndsWith("_Attributes.uasset"))
{ {
attributes = file.Value; attributesFile = file.Value;
break; break;
} }
} }
if (attributes == null) if (attributesFile == null)
{ {
PrettyLog.Error( PrettyLog.Error(
$"No suffixed attributes file found for {nation.Key}/{tank.Key}; skipping..." $"No suffixed attributes file found for {nation.Key}/{tank.Key}; skipping..."
@@ -52,20 +57,18 @@ namespace BlitzKit.CLI.Functions
} }
} }
var objects = provider.LoadAllObjects(attributes.Path); var exports = provider.LoadAllObjects(attributesFile.Path);
var objectsCount = objects.Count();
if (objectsCount != 1) var tankAttributesDataAsset =
{ exports.First((export) => export.ExportType == "TankAttributesDataAsset")
throw new Exception($"Expected 1 object for attribute objects, got {objectsCount}"); ?? throw new Exception("TankAttributesDataAsset not found");
} var attr = JObject.FromObject(tankAttributesDataAsset);
foreach (var obj in objects) Console.WriteLine(attr);
{
Console.WriteLine(obj.Properties);
}
} }
} }
var tanksBytes = tanks.ToByteArray();
} }
} }
} }
+1 -1
View File
@@ -76,7 +76,7 @@ namespace BlitzKit.CLI.Models
var directory = var directory =
directoryPath == null || directoryPath.Length == 0 ? this : GetDirectory(directoryPath); directoryPath == null || directoryPath.Length == 0 ? this : GetDirectory(directoryPath);
return directory.Files[name]; return directory.Files[fileName];
} }
public bool HasDirectory(string name) => Directories.ContainsKey(name); public bool HasDirectory(string name) => Directories.ContainsKey(name);