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) <noreply@anthropic.com>
This commit is contained in:
parent
e8d72e4649
commit
41d8e29632
2 changed files with 27 additions and 11 deletions
|
|
@ -396,10 +396,10 @@ Rigidbody:
|
||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
m_GameObject: {fileID: 781174154}
|
m_GameObject: {fileID: 781174154}
|
||||||
serializedVersion: 5
|
serializedVersion: 5
|
||||||
m_Mass: 1
|
m_Mass: 60
|
||||||
m_LinearDamping: 0
|
m_LinearDamping: 1.5
|
||||||
m_AngularDamping: 0.05
|
m_AngularDamping: 6
|
||||||
m_CenterOfMass: {x: 0, y: 0, z: 0}
|
m_CenterOfMass: {x: 0, y: -0.6, z: 0}
|
||||||
m_InertiaTensor: {x: 1, y: 1, z: 1}
|
m_InertiaTensor: {x: 1, y: 1, z: 1}
|
||||||
m_InertiaRotation: {x: 0, y: 0, z: 0, w: 1}
|
m_InertiaRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||||
m_IncludeLayers:
|
m_IncludeLayers:
|
||||||
|
|
@ -408,7 +408,7 @@ Rigidbody:
|
||||||
m_ExcludeLayers:
|
m_ExcludeLayers:
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
m_Bits: 0
|
m_Bits: 0
|
||||||
m_ImplicitCom: 1
|
m_ImplicitCom: 0
|
||||||
m_ImplicitTensor: 1
|
m_ImplicitTensor: 1
|
||||||
m_UseGravity: 1
|
m_UseGravity: 1
|
||||||
m_IsKinematic: 0
|
m_IsKinematic: 0
|
||||||
|
|
@ -636,12 +636,13 @@ MonoBehaviour:
|
||||||
ShowTopMostFoldoutHeaderGroup: 1
|
ShowTopMostFoldoutHeaderGroup: 1
|
||||||
side: 0
|
side: 0
|
||||||
chassis: {fileID: 0}
|
chassis: {fileID: 0}
|
||||||
cruiseForce: 1200
|
cruiseForce: 450
|
||||||
throttleDeadzone: 0.08
|
throttleDeadzone: 0.08
|
||||||
pivotAnchorStrength: 2500
|
pivotAnchorStrength: 1500
|
||||||
pivotAngularResistance: 400
|
pivotAngularResistance: 400
|
||||||
leanTorque: 800
|
leanTorque: 500
|
||||||
leanDeadzone: 0.08
|
leanDeadzone: 0.08
|
||||||
|
debugAutoDriveFull: 0
|
||||||
--- !u!23 &1147751745
|
--- !u!23 &1147751745
|
||||||
MeshRenderer:
|
MeshRenderer:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|
@ -770,12 +771,13 @@ MonoBehaviour:
|
||||||
ShowTopMostFoldoutHeaderGroup: 1
|
ShowTopMostFoldoutHeaderGroup: 1
|
||||||
side: 1
|
side: 1
|
||||||
chassis: {fileID: 0}
|
chassis: {fileID: 0}
|
||||||
cruiseForce: 1200
|
cruiseForce: 450
|
||||||
throttleDeadzone: 0.08
|
throttleDeadzone: 0.08
|
||||||
pivotAnchorStrength: 2500
|
pivotAnchorStrength: 1500
|
||||||
pivotAngularResistance: 400
|
pivotAngularResistance: 400
|
||||||
leanTorque: 800
|
leanTorque: 500
|
||||||
leanDeadzone: 0.08
|
leanDeadzone: 0.08
|
||||||
|
debugAutoDriveFull: 0
|
||||||
--- !u!23 &1190106217
|
--- !u!23 &1190106217
|
||||||
MeshRenderer:
|
MeshRenderer:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|
|
||||||
|
|
@ -80,6 +80,11 @@ namespace Jankenbots.Prototype
|
||||||
[Range(0f, 0.5f)]
|
[Range(0f, 0.5f)]
|
||||||
public float leanDeadzone = 0.08f;
|
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`.
|
// The seat this tread maps to, resolved once from `side`.
|
||||||
SeatManager.Seat MySeat => side == Side.Left ? SeatManager.Seat.Left : SeatManager.Seat.Right;
|
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 (!IsServer) return; // authority guard — clients never simulate
|
||||||
if (chassis == null) return;
|
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
|
// 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.)
|
// stale input the instant a pilot leaves, so the bot doesn't coast on it.)
|
||||||
if (_seats == null || _seats.PilotOf(MySeat) == SeatManager.NoPilot)
|
if (_seats == null || _seats.PilotOf(MySeat) == SeatManager.NoPilot)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue