1
0
mirror of https://git.ngram.ca/OpenJam/rc-servers synced 2026-08-23 23:08:52 +00:00

Fix reading vertical_top_speed for movement data in config, rebalance movement to 2025 stats

This commit is contained in:
NG (Graham)
2025-08-17 10:50:55 -04:00
parent 8786a2139b
commit a721aac418
6 changed files with 313 additions and 309 deletions

1
.gitignore vendored
View File

@@ -4,3 +4,4 @@
# files generated by running servers
steam_appid.txt
/data
/assets/robocraft/config.dump.json

File diff suppressed because it is too large Load Diff

View File

@@ -81,7 +81,6 @@ pub struct HoverCategoryData {
pub force_y_offset: f32,
pub turning_scale: f32,
pub small_angle_turning_scale: f32,
pub max_vertical_velocity: f32,
pub hover_damping: f32,
pub angular_damping: f32,
pub deceleration_multiplier: f32,
@@ -94,7 +93,6 @@ impl HoverCategoryData {
(Typed::Str("forceYOffset".into()), Typed::Float(self.force_y_offset)),
(Typed::Str("turningScale".into()), Typed::Float(self.turning_scale)),
(Typed::Str("smallAngleTurningScale".into()), Typed::Float(self.small_angle_turning_scale)),
(Typed::Str("verticalTopSpeed".into()), Typed::Float(self.max_vertical_velocity)),
(Typed::Str("hoverDamping".into()), Typed::Float(self.hover_damping)),
(Typed::Str("angularDamping".into()), Typed::Float(self.angular_damping)),
(Typed::Str("decelerationMultiplier".into()), Typed::Float(self.deceleration_multiplier)),

View File

@@ -25,6 +25,13 @@ impl CubeConfig {
let file = std::fs::File::open(root.as_ref().join(CUBE_CONFIG_FILENAME))?;
let buffered = std::io::BufReader::new(file);
let result = serde_json::from_reader(buffered)?;
#[cfg(debug_assertions)]
{
let filename = root.as_ref().join(format!("{}.dump.json", CUBE_CONFIG_FILENAME.trim_end_matches(".json")));
let file = std::fs::File::create(filename)?;
let buffered = std::io::BufWriter::new(file);
serde_json::to_writer_pretty(buffered, &result)?;
}
Ok(result)
}
}

View File

@@ -74,7 +74,6 @@ pub struct HoverCategoryData {
pub force_y_offset: f32,
pub turning_scale: f32,
pub small_angle_turning_scale: f32,
pub max_vertical_velocity: f32,
pub hover_damping: f32,
pub angular_damping: f32,
pub deceleration_multiplier: f32,
@@ -87,7 +86,6 @@ impl std::convert::Into<crate::data::movement_list::HoverCategoryData> for Hover
force_y_offset: self.force_y_offset,
turning_scale: self.turning_scale,
small_angle_turning_scale: self.small_angle_turning_scale,
max_vertical_velocity: self.max_vertical_velocity,
hover_damping: self.hover_damping,
angular_damping: self.angular_damping,
deceleration_multiplier: self.deceleration_multiplier,

View File

@@ -322,7 +322,7 @@ def is_variant_guess(name: str, sprite: str) -> bool:
return False
FIELD_NAME_EXCEPTIONS = {
"verticalTopSpeed": "max_vertical_velocity",
#"verticalTopSpeed": "vertical_top_speed",
}
def rename_field(original: str) -> str: