From 41d8e29632d62ddeae939c07e47a25d1512dd4b1 Mon Sep 17 00:00:00 2001 From: megaproxy Date: Sat, 11 Jul 2026 00:39:07 +0100 Subject: [PATCH] M1: tune bot physics to stop launch/tip (playtest finding) First 2-pilot test: bot was too hot (1200N cruise) and top-heavy -> launched off on any nudge. Tamed in-scene: cruiseForce 1200->450, linearDamping 1.5, angularDamping 6, maxAngularVelocity capped at 3, and lowered centerOfMass to (0,-0.6,0) so it's bottom-heavy and resists cartwheeling. Added a host-only debugAutoDriveFull flag on TreadPart to feel two-tread coordination solo. Co-Authored-By: Claude Opus 4.8 (1M context) --- Assets/Scenes/M1_Arena.unity | 24 +++++++++++++----------- Assets/Scripts/Bot/TreadPart.cs | 14 ++++++++++++++ 2 files changed, 27 insertions(+), 11 deletions(-) diff --git a/Assets/Scenes/M1_Arena.unity b/Assets/Scenes/M1_Arena.unity index 5280a85..3b72652 100644 --- a/Assets/Scenes/M1_Arena.unity +++ b/Assets/Scenes/M1_Arena.unity @@ -396,10 +396,10 @@ Rigidbody: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 781174154} serializedVersion: 5 - m_Mass: 1 - m_LinearDamping: 0 - m_AngularDamping: 0.05 - m_CenterOfMass: {x: 0, y: 0, z: 0} + m_Mass: 60 + m_LinearDamping: 1.5 + m_AngularDamping: 6 + m_CenterOfMass: {x: 0, y: -0.6, z: 0} m_InertiaTensor: {x: 1, y: 1, z: 1} m_InertiaRotation: {x: 0, y: 0, z: 0, w: 1} m_IncludeLayers: @@ -408,7 +408,7 @@ Rigidbody: m_ExcludeLayers: serializedVersion: 2 m_Bits: 0 - m_ImplicitCom: 1 + m_ImplicitCom: 0 m_ImplicitTensor: 1 m_UseGravity: 1 m_IsKinematic: 0 @@ -636,12 +636,13 @@ MonoBehaviour: ShowTopMostFoldoutHeaderGroup: 1 side: 0 chassis: {fileID: 0} - cruiseForce: 1200 + cruiseForce: 450 throttleDeadzone: 0.08 - pivotAnchorStrength: 2500 + pivotAnchorStrength: 1500 pivotAngularResistance: 400 - leanTorque: 800 + leanTorque: 500 leanDeadzone: 0.08 + debugAutoDriveFull: 0 --- !u!23 &1147751745 MeshRenderer: m_ObjectHideFlags: 0 @@ -770,12 +771,13 @@ MonoBehaviour: ShowTopMostFoldoutHeaderGroup: 1 side: 1 chassis: {fileID: 0} - cruiseForce: 1200 + cruiseForce: 450 throttleDeadzone: 0.08 - pivotAnchorStrength: 2500 + pivotAnchorStrength: 1500 pivotAngularResistance: 400 - leanTorque: 800 + leanTorque: 500 leanDeadzone: 0.08 + debugAutoDriveFull: 0 --- !u!23 &1190106217 MeshRenderer: m_ObjectHideFlags: 0 diff --git a/Assets/Scripts/Bot/TreadPart.cs b/Assets/Scripts/Bot/TreadPart.cs index 5739538..50c6e0d 100644 --- a/Assets/Scripts/Bot/TreadPart.cs +++ b/Assets/Scripts/Bot/TreadPart.cs @@ -80,6 +80,11 @@ namespace Jankenbots.Prototype [Range(0f, 0.5f)] public float leanDeadzone = 0.08f; + // ---- Debug / testing ----------------------------------------------------- + [Header("Debug / testing")] + [Tooltip("HOST ONLY: when true, this tread ignores seat/input and drives at full cruise every FixedUpdate. Lets ONE machine feel two-tread coordination — the host auto-drives one tread while a friend/clone drives the other. Leave OFF for real play.")] + public bool debugAutoDriveFull = false; + // The seat this tread maps to, resolved once from `side`. SeatManager.Seat MySeat => side == Side.Left ? SeatManager.Seat.Left : SeatManager.Seat.Right; @@ -149,6 +154,15 @@ namespace Jankenbots.Prototype if (!IsServer) return; // authority guard — clients never simulate if (chassis == null) return; + // Test affordance: drive full-forward regardless of seat/input, so one + // machine can feel two-tread coordination (host drives this tread, a + // clone/friend drives the other). Off for real play. + if (debugAutoDriveFull) + { + chassis.AddForceAtPosition(transform.forward * cruiseForce, transform.position, ForceMode.Force); + return; + } + // Un-piloted tread goes limp: no pilot → no cached force. (Also clears any // stale input the instant a pilot leaves, so the bot doesn't coast on it.) if (_seats == null || _seats.PilotOf(MySeat) == SeatManager.NoPilot)