前往
大廳
主題

道爾追逐 3

夏洛爾 | 2022-10-24 18:50:09 | 巴幣 2 | 人氣 150

我想實現的:
道爾以強大魔物的氣場,霸氣展開雙臂,兇猛俯身突擊


我真正實現的:
道爾張開雙臂,像鐵達尼號的女主角一樣,少女般的浪漫奔馳


Doyle Chase V3
實驗目標:
1.進入靜立狀態後,進入追逐狀態,在追逐狀態下,要能持續跑至接近目標的距離內
2.動作引導為類似火影跑的開臂奔跑動作

實驗設計:
1.任何弱點觸地皆失敗 (尾巴和劍並非弱點)
2.targetSmoothPosition = targetPositionBuffer.GetSmoothVal();headDir = targetSmoothPosition - stageBase.InverseTransformPoint(doyleHeadRb.position);rootDir = targetSmoothPosition - stageBase.InverseTransformPoint(doyleRootRb.position);flatTargetVelocity = rootDir;flatTargetVelocity.y = 0f;targetDistance = flatTargetVelocity.magnitude;lookAngle = Mathf.InverseLerp(180f, 0f, Vector3.Angle(doyleHead.up, headDir));upAngle = Mathf.InverseLerp(180f, 0f, Vector3.Angle(doyleHead.right * -1f, Vector3.up));aimVelocity = flatTargetVelocity.normalized;aimVelocity.y = 0.2f;//LeanVector3 leanDir = aimVelocity;leanDir.y = 0.6f;spineUpAngle = Mathf.InverseLerp(180f, 0f, Vector3.Angle(doyleSpine.right * -1f, leanDir));rootUpAngle = Mathf.InverseLerp(180f, 0f, Vector3.Angle(doyleRoot.up, leanDir));//Naruto ArmVector3 flatLeftDir = Vector3.Cross(flatTargetVelocity, Vector3.up);leftUpperArmAngle = Mathf.InverseLerp(180f, 0f, Vector3.Angle(doyleLeftUpperArm.right * -1f, flatLeftDir));leftForeArmAngle = Mathf.InverseLerp(180f, 0f, Vector3.Angle(doyleLeftForeArm.right * -1f, flatLeftDir));rightUpperArmAngle = Mathf.InverseLerp(180f, 0f, Vector3.Angle(doyleRightUpperArm.right, flatLeftDir));rightForeArmAngle = Mathf.InverseLerp(180f, 0f, Vector3.Angle(doyleRightForeArm.right, flatLeftDir));avgVelocity = velocityBuffer.GetSmoothVal();velocityAngle = Vector3.Angle(avgVelocity, aimVelocity);velocityAngleCoef = Mathf.InverseLerp(180f, 0f, velocityAngle);flatVelocity = avgVelocity;flatVelocity.y = 0f;flatVelocityManitude = flatVelocity.magnitude;velocityCoef = Mathf.InverseLerp(0f, 10f, Vector3.Project(avgVelocity, aimVelocity).magnitude );flatVelocityAngle = Vector3.Angle(flatVelocity, flatTargetVelocity);if(targetDistance > nearModeRange){if(Time.fixedTime - landingMoment > landingBufferTime){bool outSpeed = flatVelocityManitude < Mathf.Lerp(0f, 7f, (Time.fixedTime - landingMoment - landingBufferTime)/4f);bool outDirection = flatVelocityAngle > Mathf.Lerp(180f, 10f, (Time.fixedTime - landingMoment - landingBufferTime)/4f);float motionLimit = Mathf.Lerp(0f, 0.7f, (Time.fixedTime - landingMoment - landingBufferTime)/4f);bool outMotion = spineUpAngle < motionLimit || rootUpAngle < motionLimit || leftUpperArmAngle < motionLimit || leftForeArmAngle < motionLimit || rightUpperArmAngle < motionLimit || rightForeArmAngle < motionLimit;if( outSpeed || outDirection || outMotion){AddReward(-1f);if(outSpeed){judge.outSpeed++;}if(outDirection){judge.outDirection++;}if(outMotion){judge.outMotion++;}judge.Reset();return;}}lastReward = velocityAngleCoef * velocityCoef * 0.004f + lookAngle * upAngle * 0.002f+ (spineUpAngle+rootUpAngle) * 0.00075f + (leftUpperArmAngle+leftForeArmAngle+rightUpperArmAngle+rightForeArmAngle) * 0.000375f+ (1f - exertionRatio) * 0.001f;totalReward += lastReward;AddReward( lastReward );}// else if(targetDistance > 1.5f)else{// AddReward(1f);judge.survived++;judge.Reset();return;}

//大致來說,
1.獎勵視線
2.獎勵投影至"跑動推薦向量"的速度和角度,並使用Force Sharping
3.獎勵Root和Spine前傾,獎勵雙臂平行前進方向的正交向量,並使用Force Sharping
4.獎勵減少動作變化

3.End episode on maximum of 20s

實驗結果:
實驗結果為成功的失敗了

透過應用Force Sharping,跑法有明顯的改變
因此引導開臂奔跑這個目標的確是成功了,只是結果跟想像的完全不同
超好笑的

蒐集朋友圈的意見加上自己的看法,再來要調整的有幾個
1.腳步內八,而且踩的很開
這裡讓道爾看起來有點扭扭捏捏的
2.上半身可以更前傾
原本以為傾斜度已經很高,但意外的無感,看原作幾乎壓到平行地面,雖然懷疑實際上未必能平衡
3.劍不要亂晃
個人覺得劍會亂晃,導致他看起來完全無法控制那把劍,以致毫無霸氣和力量感,但以這次研究成果來看,不管紅蓮還是道爾,會亂晃亂動的原因,全都是因為沒有被要求就無所謂了

4.視線可以更安定
視線實際上沒有加入Force Sharping,會轉移視線反而沒有鎖定目標的感覺

5.手的動作可能不是平開,而是折翼或後拉
由於抱著"總之先試試看,到底能不能引導Pose怎麼擺",的心態,就先簡單的寫平開引導

因此後續實驗計畫為
1.引導大腿角度
2.上半身前傾角度增加
3.引導劍的角度
4.視線Force Sharping
5.手的角度更像後拉,並允許前臂彎曲

選擇性
6.體力制當前為"抑制動作決策改變",但這可能本身和ML性質牴觸,預計研究Joint Torque的算法,如果能成功,將改為"根據出力情況消耗體力",以"抑制無謂出力"作為亂動抑制對策
7.打飛水月公主

創作回應

更多創作