A lot more sound effects

This commit is contained in:
Anuken 2025-11-12 17:37:51 -05:00
parent dd8c06192e
commit 67495e628b
24 changed files with 38 additions and 16 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -3,11 +3,13 @@ package mindustry.audio;
import arc.*; import arc.*;
import arc.audio.*; import arc.audio.*;
import arc.struct.*; import arc.struct.*;
import mindustry.gen.*;
import static mindustry.gen.Sounds.*; import static mindustry.gen.Sounds.*;
/** Sets up priorities and groups for various sounds. */ /** Sets up priorities and groups for various sounds. */
public class SoundPriority{ public class SoundPriority{
static int lastGroup = 1;
public static void init(){ public static void init(){
//priority 2: long weapon loops //priority 2: long weapon loops
@ -35,6 +37,7 @@ public class SoundPriority{
respawning respawning
); );
sameGroup(Sounds.missile, Sounds.missileShort);
for(var sound : Core.assets.getAll(Sound.class, new Seq<>())){ for(var sound : Core.assets.getAll(Sound.class, new Seq<>())){
sound.setMinConcurrentInterrupt(Math.min(0.25f, sound.getLength() * 0.5f)); sound.setMinConcurrentInterrupt(Math.min(0.25f, sound.getLength() * 0.5f));
@ -44,6 +47,11 @@ public class SoundPriority{
mechStep.setMaxConcurrent(3); mechStep.setMaxConcurrent(3);
} }
static void sameGroup(Sound... sounds){
int id = lastGroup ++;
for(var s : sounds) s.setConcurrentGroup(id);
}
static void set(float value, Sound... sounds){ static void set(float value, Sound... sounds){
for(var s : sounds) s.setPriority(value); for(var s : sounds) s.setPriority(value);
} }

View file

@ -3494,7 +3494,7 @@ public class Blocks{
inaccuracy = 1f; inaccuracy = 1f;
shootCone = 10f; shootCone = 10f;
health = 260; health = 260;
shootSound = Sounds.bang; shootSound = Sounds.artillerySmall;
coolant = consumeCoolant(0.1f); coolant = consumeCoolant(0.1f);
limitRange(0f); limitRange(0f);
}}; }};
@ -3531,7 +3531,6 @@ public class Blocks{
flags = EnumSet.of(BlockFlag.turret, BlockFlag.extinguisher); flags = EnumSet.of(BlockFlag.turret, BlockFlag.extinguisher);
}}; }};
//TODO these may work in space, but what's the point?
lancer = new PowerTurret("lancer"){{ lancer = new PowerTurret("lancer"){{
requirements(Category.turret, with(Items.copper, 60, Items.lead, 70, Items.silicon, 60, Items.titanium, 30)); requirements(Category.turret, with(Items.copper, 60, Items.lead, 70, Items.silicon, 60, Items.titanium, 30));
range = 165f; range = 165f;
@ -3551,6 +3550,7 @@ public class Blocks{
accurateDelay = false; accurateDelay = false;
shootSound = Sounds.laser; shootSound = Sounds.laser;
coolant = consumeCoolant(0.2f); coolant = consumeCoolant(0.2f);
chargeSound = Sounds.lasercharge3;
consumePower(6f); consumePower(6f);

View file

@ -219,7 +219,7 @@ public class UnitTypes{
recoil = 5f; recoil = 5f;
shake = 2f; shake = 2f;
ejectEffect = Fx.casing3; ejectEffect = Fx.casing3;
shootSound = Sounds.bang; shootSound = Sounds.shootScepter;
inaccuracy = 3f; inaccuracy = 3f;
shoot.shots = 3; shoot.shots = 3;
@ -235,6 +235,7 @@ public class UnitTypes{
lightningColor = Pal.surge; lightningColor = Pal.surge;
//standard bullet damage is far too much for lightning //standard bullet damage is far too much for lightning
lightningDamage = 20; lightningDamage = 20;
despawnSound = Sounds.sparkBullet;
}}; }};
}}, }},
@ -245,6 +246,7 @@ public class UnitTypes{
rotate = true; rotate = true;
ejectEffect = Fx.casing1; ejectEffect = Fx.casing1;
bullet = smallBullet; bullet = smallBullet;
shootSound = Sounds.shootDagger;
}}, }},
new Weapon("mount-weapon"){{ new Weapon("mount-weapon"){{
reload = 16f; reload = 16f;
@ -253,6 +255,7 @@ public class UnitTypes{
rotate = true; rotate = true;
ejectEffect = Fx.casing1; ejectEffect = Fx.casing1;
bullet = smallBullet; bullet = smallBullet;
shootSound = Sounds.shootDagger;
}} }}
); );
}}; }};
@ -299,6 +302,7 @@ public class UnitTypes{
fragBullets = 3; fragBullets = 3;
fragLifeMin = 0f; fragLifeMin = 0f;
fragRandomSpread = 30f; fragRandomSpread = 30f;
despawnSound = Sounds.explosion;
fragBullet = new BasicBulletType(9f, 20){{ fragBullet = new BasicBulletType(9f, 20){{
width = 10f; width = 10f;
@ -1080,7 +1084,7 @@ public class UnitTypes{
shoot.shots = 2; shoot.shots = 2;
inaccuracy = 5f; inaccuracy = 5f;
velocityRnd = 0.2f; velocityRnd = 0.2f;
shootSound = Sounds.missile; shootSound = Sounds.missileLong;
bullet = new MissileBulletType(3f, 14){{ bullet = new MissileBulletType(3f, 14){{
width = 8f; width = 8f;
@ -1165,7 +1169,7 @@ public class UnitTypes{
shake = 1f; shake = 1f;
rotateSpeed = 2f; rotateSpeed = 2f;
ejectEffect = Fx.casing1; ejectEffect = Fx.casing1;
shootSound = Sounds.shootBig; shootSound = Sounds.shootSpectre;
rotate = true; rotate = true;
shadow = 8f; shadow = 8f;
bullet = new BasicBulletType(7f, 55){{ bullet = new BasicBulletType(7f, 55){{
@ -1214,7 +1218,7 @@ public class UnitTypes{
rotateSpeed = 2f; rotateSpeed = 2f;
reload = 45f; reload = 45f;
recoil = 4f; recoil = 4f;
shootSound = Sounds.laser; shootSound = Sounds.laser2;
shadow = 20f; shadow = 20f;
rotate = true; rotate = true;
@ -1234,7 +1238,7 @@ public class UnitTypes{
y = 27f; y = 27f;
rotateSpeed = 2f; rotateSpeed = 2f;
reload = 9f; reload = 9f;
shootSound = Sounds.shoot; shootSound = Sounds.shootCyclone;
shadow = 7f; shadow = 7f;
rotate = true; rotate = true;
recoil = 0.5f; recoil = 0.5f;
@ -1248,7 +1252,7 @@ public class UnitTypes{
ejectEffect = Fx.casing1; ejectEffect = Fx.casing1;
rotateSpeed = 7f; rotateSpeed = 7f;
shake = 1f; shake = 1f;
shootSound = Sounds.shoot; shootSound = Sounds.shootCyclone;
rotate = true; rotate = true;
shadow = 12f; shadow = 12f;
shootY = 7.25f; shootY = 7.25f;
@ -1307,7 +1311,7 @@ public class UnitTypes{
reload = 30f; reload = 30f;
ejectEffect = Fx.none; ejectEffect = Fx.none;
recoil = 2f; recoil = 2f;
shootSound = Sounds.missile; shootSound = Sounds.missileShort;
velocityRnd = 0.5f; velocityRnd = 0.5f;
inaccuracy = 15f; inaccuracy = 15f;
alternate = true; alternate = true;
@ -1504,6 +1508,7 @@ public class UnitTypes{
y = 1.5f; y = 1.5f;
rotate = true; rotate = true;
ejectEffect = Fx.casing1; ejectEffect = Fx.casing1;
shootSound = Sounds.shootDagger;
bullet = new BasicBulletType(2.5f, 9){{ bullet = new BasicBulletType(2.5f, 9){{
width = 7f; width = 7f;
height = 9f; height = 9f;
@ -1519,7 +1524,7 @@ public class UnitTypes{
y = -5f; y = -5f;
rotate = true; rotate = true;
ejectEffect = Fx.casing1; ejectEffect = Fx.casing1;
shootSound = Sounds.missile; shootSound = Sounds.missileShort;
bullet = new MissileBulletType(2.7f, 12, "missile"){{ bullet = new MissileBulletType(2.7f, 12, "missile"){{
keepVelocity = true; keepVelocity = true;
width = 8f; width = 8f;
@ -1565,7 +1570,7 @@ public class UnitTypes{
rotateSpeed = 5f; rotateSpeed = 5f;
inaccuracy = 8f; inaccuracy = 8f;
ejectEffect = Fx.casing1; ejectEffect = Fx.casing1;
shootSound = Sounds.shoot; shootSound = Sounds.shootDuo;
bullet = new FlakBulletType(4.2f, 3){{ bullet = new FlakBulletType(4.2f, 3){{
lifetime = 60f; lifetime = 60f;
ammoMultiplier = 4f; ammoMultiplier = 4f;
@ -1587,7 +1592,7 @@ public class UnitTypes{
rotateSpeed = 2f; rotateSpeed = 2f;
shake = 1.5f; shake = 1.5f;
ejectEffect = Fx.casing2; ejectEffect = Fx.casing2;
shootSound = Sounds.bang; shootSound = Sounds.artillerySmall;
bullet = new ArtilleryBulletType(3f, 20, "shell"){{ bullet = new ArtilleryBulletType(3f, 20, "shell"){{
hitEffect = Fx.flakExplosion; hitEffect = Fx.flakExplosion;
knockback = 0.8f; knockback = 0.8f;
@ -1671,7 +1676,7 @@ public class UnitTypes{
inaccuracy = 5f; inaccuracy = 5f;
velocityRnd = 0.1f; velocityRnd = 0.1f;
shootSound = Sounds.missile; shootSound = Sounds.missileShort;
ammoType = new ItemAmmoType(Items.thorium); ammoType = new ItemAmmoType(Items.thorium);
ejectEffect = Fx.none; ejectEffect = Fx.none;
@ -1730,7 +1735,7 @@ public class UnitTypes{
inaccuracy = 7f; inaccuracy = 7f;
ejectEffect = Fx.none; ejectEffect = Fx.none;
shake = 1f; shake = 1f;
shootSound = Sounds.missile; shootSound = Sounds.missileLong;
shoot = new ShootAlternate(){{ shoot = new ShootAlternate(){{
shots = 6; shots = 6;
@ -1772,7 +1777,7 @@ public class UnitTypes{
recoil = 3f; recoil = 3f;
shadow = 12f; shadow = 12f;
ejectEffect = Fx.casing3; ejectEffect = Fx.casing3;
shootSound = Sounds.shootBig; shootSound = Sounds.shootSpectre;
shoot.shots = 3; shoot.shots = 3;
shoot.shotDelay = 4f; shoot.shotDelay = 4f;

View file

@ -609,7 +609,7 @@ public class BulletType extends Content implements Cloneable{
} }
despawnEffect.at(b.x, b.y, b.rotation(), hitColor); despawnEffect.at(b.x, b.y, b.rotation(), hitColor);
despawnSound.at(b); despawnSound.at(b, 1f + Mathf.range(hitSoundPitchRange));
Effect.shake(despawnShake, despawnShake, b); Effect.shake(despawnShake, despawnShake, b);
} }

View file

@ -437,6 +437,13 @@ public class FloorRenderer{
int idx = vidx; int idx = vidx;
vidx += spriteSize; vidx += spriteSize;
//fixes graphical artifacting due to low precision positions/UVs. TODO: test for issues
final float grow = 0.01f;
x -= grow;
y -= grow;
width += grow*2f;
height += grow*2f;
if(!Mathf.zero(rotation)){ if(!Mathf.zero(rotation)){
//bottom left and top right corner points relative to origin //bottom left and top right corner points relative to origin
float worldOriginX = x + originX; float worldOriginX = x + originX;

View file

@ -629,7 +629,9 @@ public class Planet extends UnlockableContent{
batch.color(Tmp.c1); batch.color(Tmp.c1);
batch.vertex(Tmp.bz3.valueAt(Tmp.v32, f).add(normal, -stroke)); batch.vertex(Tmp.bz3.valueAt(Tmp.v32, f).add(normal, -stroke));
} }
Gl.disable(Gl.cullFace);
batch.flush(Gl.triangleStrip); batch.flush(Gl.triangleStrip);
Gl.enable(Gl.cullFace);
} }
public Vec3 lookAt(Sector sector, Vec3 out){ public Vec3 lookAt(Sector sector, Vec3 out){