diff --git a/core/assets/sounds/mechStepSmall.ogg b/core/assets/sounds/mechStepSmall.ogg new file mode 100644 index 0000000000..7473bc1ca6 Binary files /dev/null and b/core/assets/sounds/mechStepSmall.ogg differ diff --git a/core/assets/sounds/shootAtrax.ogg b/core/assets/sounds/shootAtrax.ogg index 303fbd6027..3e5d0b95c1 100644 Binary files a/core/assets/sounds/shootAtrax.ogg and b/core/assets/sounds/shootAtrax.ogg differ diff --git a/core/assets/sounds/walkerStepSmall.ogg b/core/assets/sounds/walkerStepSmall.ogg new file mode 100644 index 0000000000..bbd16aaec9 Binary files /dev/null and b/core/assets/sounds/walkerStepSmall.ogg differ diff --git a/core/assets/sounds/walkerStepTiny.ogg b/core/assets/sounds/walkerStepTiny.ogg new file mode 100644 index 0000000000..d05992beef Binary files /dev/null and b/core/assets/sounds/walkerStepTiny.ogg differ diff --git a/core/src/mindustry/audio/SoundPriority.java b/core/src/mindustry/audio/SoundPriority.java index 1f865f0b00..9090fb358f 100644 --- a/core/src/mindustry/audio/SoundPriority.java +++ b/core/src/mindustry/audio/SoundPriority.java @@ -55,13 +55,16 @@ public class SoundPriority{ sound.setMinConcurrentInterrupt(Math.min(0.25f, sound.getLength() * 0.5f)); } + mechStepSmall.setMinConcurrentInterrupt(0.5f); mechStep.setMinConcurrentInterrupt(0.5f); walkerStep.setMinConcurrentInterrupt(0.6f); mechStepHeavy.setMinConcurrentInterrupt(0.6f); shieldHit.setMaxConcurrent(4); - max(4, mechStep, mechStepHeavy, walkerStep); + max(4, mechStep, mechStepHeavy, walkerStep, walkerStepSmall, walkerStepTiny, mechStepSmall); + //step sounds are low priority + set(-1f, mechStep, mechStepHeavy, walkerStep, walkerStepSmall, walkerStepTiny, mechStepSmall); } static void max(int max, Sound... sounds){ diff --git a/core/src/mindustry/content/UnitTypes.java b/core/src/mindustry/content/UnitTypes.java index d61fb5f036..02240099f8 100644 --- a/core/src/mindustry/content/UnitTypes.java +++ b/core/src/mindustry/content/UnitTypes.java @@ -102,6 +102,8 @@ public class UnitTypes{ speed = 0.5f; hitSize = 8f; health = 150; + stepSoundVolume = 0.4f; + weapons.add(new Weapon("large-weapon"){{ shootSound = Sounds.shootDagger; reload = 13f; @@ -159,6 +161,8 @@ public class UnitTypes{ armor = 9f; mechFrontSway = 0.55f; ammoType = new ItemAmmoType(Items.graphite); + stepSoundPitch = 0.8f; + stepSoundVolume = 0.65f; weapons.add(new Weapon("artillery"){{ top = false; @@ -372,6 +376,7 @@ public class UnitTypes{ mineTier = 2; mineSpeed = 3f; + stepSound = Sounds.mechStepSmall; abilities.add(new ShieldRegenFieldAbility(20f, 40f, 60f * 5, 60f)); ammoType = new PowerAmmoType(1300); @@ -428,6 +433,8 @@ public class UnitTypes{ mechFrontSway = 0.55f; ammoType = new PowerAmmoType(1500); + stepSoundPitch = 0.9f; + stepSoundVolume = 0.6f; speed = 0.5f; hitSize = 13f; @@ -635,6 +642,8 @@ public class UnitTypes{ mechSideSway = 0.25f; range = 40f; ammoType = new ItemAmmoType(Items.coal); + stepSound = Sounds.walkerStepTiny; + stepSoundVolume = 0.4f; weapons.add(new Weapon(){{ shootOnDeath = true; @@ -672,6 +681,10 @@ public class UnitTypes{ health = 600; immunities = ObjectSet.with(StatusEffects.burning, StatusEffects.melting); + stepSound = Sounds.walkerStepSmall; + stepSoundPitch = 1f; + stepSoundVolume = 0.3f; + legCount = 4; legLength = 9f; legForwardScl = 0.6f; @@ -721,6 +734,10 @@ public class UnitTypes{ shadowElevation = 0.3f; groundLayer = Layer.legUnit; + stepSound = Sounds.walkerStepSmall; + stepSoundPitch = 0.7f; + stepSoundVolume = 0.35f; + weapons.add(new Weapon("spiroct-weapon"){{ shootY = 4f; reload = 14f; @@ -788,7 +805,7 @@ public class UnitTypes{ ammoType = new PowerAmmoType(2000); stepSound = Sounds.walkerStep; - stepSoundVolume = 0.75f; + stepSoundVolume = 0.85f; stepSoundPitch = 1.1f; legSplashDamage = 32; @@ -3043,6 +3060,8 @@ public class UnitTypes{ armor = 4f; legStraightness = 0.3f; stepShake = 0f; + stepSound = Sounds.walkerStepTiny; + stepSoundVolume = 0.7f; legCount = 6; legLength = 8f; @@ -3127,6 +3146,8 @@ public class UnitTypes{ armor = 5f; stepShake = 0f; + stepSound = Sounds.walkerStepSmall; + legCount = 4; legLength = 14f; lockLegBase = true; @@ -3234,6 +3255,9 @@ public class UnitTypes{ fogRadius = 40f; stepShake = 0f; + stepSound = Sounds.walkerStepSmall; + stepSoundPitch = 0.78f; + legCount = 6; legLength = 18f; legGroupSize = 3; @@ -3271,6 +3295,7 @@ public class UnitTypes{ weapons.add(new Weapon("anthicus-weapon"){{ shootSound = Sounds.missileLarge; + shootSoundVolume = 0.8f; x = 29f / 4f; y = -11f / 4f; shootY = 1.5f; diff --git a/core/src/mindustry/entities/comp/LegsComp.java b/core/src/mindustry/entities/comp/LegsComp.java index 6155ede31e..4b5f2a79f5 100644 --- a/core/src/mindustry/entities/comp/LegsComp.java +++ b/core/src/mindustry/entities/comp/LegsComp.java @@ -179,7 +179,7 @@ abstract class LegsComp implements Posc, Rotc, Hitboxc, Unitc{ floor.walkSound.at(x, y, 1f, floor.walkSoundVolume); }else{ Fx.unitLandSmall.at(l.base.x, l.base.y, type.rippleScale, floor.mapColor); - type.stepSound.at(l.base.x, l.base.y, type.stepSoundPitch + Mathf.range(0.1f), type.stepSoundVolume); + type.stepSound.at(l.base.x, l.base.y, type.stepSoundPitch + Mathf.range(type.stepSoundPitchRange), type.stepSoundVolume); } //shake when legs contact ground diff --git a/core/src/mindustry/entities/units/AIController.java b/core/src/mindustry/entities/units/AIController.java index a1fffb3548..c6a5ff0224 100644 --- a/core/src/mindustry/entities/units/AIController.java +++ b/core/src/mindustry/entities/units/AIController.java @@ -379,7 +379,7 @@ public class AIController implements UnitController{ if(arrive){ Tmp.v3.set(-unit.vel.x / unit.type.accel * 2f, -unit.vel.y / unit.type.accel * 2f).add((target.getX() - unit.x), (target.getY() - unit.y)); - if(unit.type.omniMovement){ + if(unit.type.omniMovement || unit.type.rotateMoveFirst){ vec.add(Tmp.v3).limit(speed * length); }else{ //directly move the unit to prevent a backwards movement vector from messing things up diff --git a/core/src/mindustry/type/UnitType.java b/core/src/mindustry/type/UnitType.java index 50b5b1af48..4360b8635c 100644 --- a/core/src/mindustry/type/UnitType.java +++ b/core/src/mindustry/type/UnitType.java @@ -301,11 +301,11 @@ public class UnitType extends UnlockableContent implements Senseable{ /** volume of loop sound */ public float loopSoundVolume = 0.5f; /** sound played when this mech/insect unit does a step */ - public Sound stepSound = Sounds.none; + public Sound stepSound = Sounds.mechStepSmall; /** volume of step sound */ public float stepSoundVolume = 0.5f; /** base pitch of step sound */ - public float stepSoundPitch = 1f; + public float stepSoundPitch = 1f, stepSoundPitchRange = 0.1f; /** effect that this unit emits when falling */ public Effect fallEffect = Fx.fallSmoke; /** effect created at engine when unit falls. */ diff --git a/desktop/src/mindustry/desktop/DesktopLauncher.java b/desktop/src/mindustry/desktop/DesktopLauncher.java index 72a73a00fa..fa1c9fa0a0 100644 --- a/desktop/src/mindustry/desktop/DesktopLauncher.java +++ b/desktop/src/mindustry/desktop/DesktopLauncher.java @@ -88,6 +88,7 @@ public class DesktopLauncher extends ClientLauncher{ case "antialias" -> samples = 16; case "debug" -> Log.level = LogLevel.debug; case "maximized" -> maximized = Boolean.parseBoolean(arg[i + 1]); + case "testMobile" -> testMobile = true; case "gltrace" -> { Events.on(ClientCreateEvent.class, e -> { var profiler = new GLProfiler(Core.graphics); @@ -115,7 +116,6 @@ public class DesktopLauncher extends ClientLauncher{ Version.init(); boolean useSteam = Version.modifier.contains("steam"); - testMobile = Seq.with(args).contains("-testMobile"); if(useDiscord){ Threads.daemon(() -> {