From 2869c635175c833ee363a0dc6a0e94c0dc871b77 Mon Sep 17 00:00:00 2001 From: Sergio Valor Date: Thu, 21 May 2026 17:11:08 +0200 Subject: [PATCH] tune(debris): N=1, shrink completo y sin herencia angular en enemigos --- source/core/defaults/physics.hpp | 6 +++--- source/game/systems/collision_system.cpp | 3 +-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/source/core/defaults/physics.hpp b/source/core/defaults/physics.hpp index ec64ede..1de337f 100644 --- a/source/core/defaults/physics.hpp +++ b/source/core/defaults/physics.hpp @@ -27,7 +27,7 @@ namespace Defaults::Physics { constexpr float ROTACIO_MAX = 0.3F; // Rotación màxima (rad/s ~17.2°/s) constexpr float TEMPS_VIDA = 2.0F; // Vida mínima garantida (s) — després pot morir per velocitat baixa constexpr float TEMPS_VIDA_NAU = 3.0F; // Ship debris min lifetime (matches DEATH_DURATION) - constexpr float SHRINK_RATE = 0.5F; // Reducció de mida (factor sobre min_lifetime) + constexpr float SHRINK_RATE = 1.0F; // Reducció de mida (1.0 = encoge a 0 al final del min_lifetime) // Política de mort: passat el min_lifetime, el fragment mor quan la // seva velocity cau per sota d'aquest llindar. Així els fragments @@ -53,9 +53,9 @@ namespace Defaults::Physics { // Tuneig específic de l'explosió d'enemic (overrides als defaults // que es passen com a paràmetres opcionals a explode()). - constexpr float ENEMY_LIFETIME = 4.5F; // Vida mínima del debris (s) — els que segueixen movent-se viuen més + constexpr float ENEMY_LIFETIME = 2.5F; // Vida mínima del debris (s) — els que segueixen movent-se viuen més constexpr float ENEMY_FRICTION = -30.0F; // Fricció més suau perquè s'estenguin més - constexpr int ENEMY_SEGMENT_MULTIPLIER = 3; // Còpies de cada segment (5 cares × 3 = 15 trossos) + constexpr int ENEMY_SEGMENT_MULTIPLIER = 1; // Sense còpies (5 cares = 5 trossos); >1 produeix grups sincronitzats // Angular velocity sin for trajectory inheritance // Excess above this threshold is converted to tangential linear velocity diff --git a/source/game/systems/collision_system.cpp b/source/game/systems/collision_system.cpp index 85c362a..f985b8c 100644 --- a/source/game/systems/collision_system.cpp +++ b/source/game/systems/collision_system.cpp @@ -45,7 +45,6 @@ namespace Systems::Collision { void explodeNow(Context& ctx, Enemy& enemy, uint8_t shooter_id) { const Vec2 ENEMY_POS = enemy.getCenter(); const Vec2 ENEMY_VEL = enemy.getVelocityVector(); - const float DROTACIO = enemy.getRotationDelta(); const float BRIGHTNESS = enemy.getBrightness(); const auto SHAPE = enemy.getShape(); const EnemyType TYPE = enemy.getType(); @@ -70,7 +69,7 @@ namespace Systems::Collision { VELOCITAT_EXPLOSIO, BRIGHTNESS, INHERITED_VEL, - DROTACIO, + 0.0F, // sense herència angular: evita que els 5 trossos curvin en bloc 0.0F, // sin herencia visual Defaults::Sound::EXPLOSION, COLOR,