diff --git a/common/src/main/kotlin/org/valkyrienskies/eureka/EurekaConfig.kt b/common/src/main/kotlin/org/valkyrienskies/eureka/EurekaConfig.kt index cf8ab3b..b856ba7 100644 --- a/common/src/main/kotlin/org/valkyrienskies/eureka/EurekaConfig.kt +++ b/common/src/main/kotlin/org/valkyrienskies/eureka/EurekaConfig.kt @@ -67,6 +67,9 @@ object EurekaConfig { @JsonSchema(description = "The maximum amount extra each floater will multiply the buoyant force by, irrespective of mass") var maxFloaterBuoyantFactor = 1.0 + @JsonSchema(description = "how much the mass decreases the speed.") + var speedMassScale = 5.0 + // The velocity any ship at least can move at. @JsonSchema(description = "The speed a ship with no engines can move at") var baseSpeed = 3.0 diff --git a/common/src/main/kotlin/org/valkyrienskies/eureka/ship/EurekaShipControl.kt b/common/src/main/kotlin/org/valkyrienskies/eureka/ship/EurekaShipControl.kt index 7ce1238..ee1e0f3 100644 --- a/common/src/main/kotlin/org/valkyrienskies/eureka/ship/EurekaShipControl.kt +++ b/common/src/main/kotlin/org/valkyrienskies/eureka/ship/EurekaShipControl.kt @@ -289,7 +289,7 @@ class EurekaShipControl : ShipForcesInducer, ServerTickListener { // Player controlled forward and backward thrust private fun getPlayerForwardVel(control: ControlData, physShip: PhysShipImpl): Vector3d { - val mass10 = physShip.inertia.shipMass * 10 + val scaledMass = physShip.inertia.shipMass * EurekaConfig.SERVER.speedMassScale val vel: Vector3dc = physShip.poseVel.vel // region Player controlled forward and backward thrust @@ -311,7 +311,7 @@ class EurekaShipControl : ShipForcesInducer, ServerTickListener { // This is the speed that the ship is always allowed to go out, without engines val baseForwardVel = Vector3d(forwardVector).mul(EurekaConfig.SERVER.baseSpeed) - val forwardForce = Vector3d(baseForwardVel).sub(velOrthogonalToPlayerUp).mul(mass10) + val forwardForce = Vector3d(baseForwardVel).sub(velOrthogonalToPlayerUp).mul(scaledMass) if (extraForceLinear != 0.0) { // engine boost @@ -320,7 +320,7 @@ class EurekaShipControl : ShipForcesInducer, ServerTickListener { // This is the maximum speed we want to go in any scenario (when not sprinting) val idealForwardVel = Vector3d(forwardVector).mul(EurekaConfig.SERVER.maxCasualSpeed) - val idealForwardForce = Vector3d(idealForwardVel).sub(velOrthogonalToPlayerUp).mul(mass10) + val idealForwardForce = Vector3d(idealForwardVel).sub(velOrthogonalToPlayerUp).mul(scaledMass) val extraForceNeeded = Vector3d(idealForwardForce).sub(forwardForce) forwardForce.fma(min(extraForceLinear / extraForceNeeded.length(), 1.0), extraForceNeeded)