mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
feat: add RESOLUTION_FACTOR
Introduce RESOLUTION_FACTOR to scale ray density for tuning. Consider exposing this in BombConfig for runtime configuration.
This commit is contained in:
parent
7dab92f3b2
commit
baad5cefbe
@ -34,7 +34,8 @@ public class ExplosionNukeRayParallelized implements IExplosionRay {
|
|||||||
private static final int BITSET_SIZE = 16 * WORLD_HEIGHT * 16;
|
private static final int BITSET_SIZE = 16 * WORLD_HEIGHT * 16;
|
||||||
private static final int SUBCHUNK_PER_CHUNK = WORLD_HEIGHT >> 4;
|
private static final int SUBCHUNK_PER_CHUNK = WORLD_HEIGHT >> 4;
|
||||||
private static final float NUKE_RESISTANCE_CUTOFF = 2_000_000F;
|
private static final float NUKE_RESISTANCE_CUTOFF = 2_000_000F;
|
||||||
private static final float INITIAL_ENERGY_FACTOR = 0.3F;
|
private static final float INITIAL_ENERGY_FACTOR = 0.3F; // Scales crater, no impact on performance
|
||||||
|
private static final double RESOLUTION_FACTOR = 1.0; // Scales ray density, no impact on crater radius
|
||||||
|
|
||||||
protected final World world;
|
protected final World world;
|
||||||
private final double explosionX, explosionY, explosionZ;
|
private final double explosionX, explosionY, explosionZ;
|
||||||
@ -72,7 +73,7 @@ public class ExplosionNukeRayParallelized implements IExplosionRay {
|
|||||||
this.strength = strength;
|
this.strength = strength;
|
||||||
this.radius = radius;
|
this.radius = radius;
|
||||||
|
|
||||||
int rayCount = Math.max(0, (int) (2.5 * Math.PI * strength * strength));
|
int rayCount = Math.max(0, (int) (2.5 * Math.PI * strength * strength * RESOLUTION_FACTOR));
|
||||||
this.latch = new CountDownLatch(rayCount);
|
this.latch = new CountDownLatch(rayCount);
|
||||||
List<SubChunkKey> sortedSubChunks = getAllSubChunks();
|
List<SubChunkKey> sortedSubChunks = getAllSubChunks();
|
||||||
this.lowPriorityProactiveIterator = sortedSubChunks.iterator();
|
this.lowPriorityProactiveIterator = sortedSubChunks.iterator();
|
||||||
@ -336,7 +337,7 @@ public class ExplosionNukeRayParallelized implements IExplosionRay {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
float resistance = getNukeResistance(originalBlock);
|
float resistance = getNukeResistance(originalBlock);
|
||||||
if (accumulatedDamage >= resistance) chunkDestructionBitSet.set(bitIndex);
|
if (accumulatedDamage >= resistance * RESOLUTION_FACTOR) chunkDestructionBitSet.set(bitIndex);
|
||||||
innerDamageMap.remove(bitIndex);
|
innerDamageMap.remove(bitIndex);
|
||||||
});
|
});
|
||||||
if (innerDamageMap.isEmpty()) damageMap.remove(cp);
|
if (innerDamageMap.isEmpty()) damageMap.remove(cp);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user