mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-03-10 13:51:53 +09:00
fix: cloud not spawning often enough if timeDelta > 1
This commit is contained in:
@@ -18,12 +18,12 @@
|
||||
"cumulus": {
|
||||
"filename": "cloud_normal.png", "tw": 1024, "th": 512, "probability": 0.05,
|
||||
"baseScale": 2.0, "scaleVariance": 0.6,
|
||||
"altLow": 1080, "altHigh": 1800
|
||||
"altLow": 1080, "altHigh": 2400
|
||||
},
|
||||
"altocumulus": {
|
||||
"filename": "cloud_normal.png", "tw": 1024, "th": 512, "probability": 1.0,
|
||||
"baseScale": 1.0, "scaleVariance": 0.1,
|
||||
"altLow": 2600, "altHigh": 3400
|
||||
"altLow": 2600, "altHigh": 4800
|
||||
}
|
||||
},
|
||||
"atmoTurbidity": 3.5,
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -277,7 +277,8 @@ internal object WeatherMixer : RNGConsumer {
|
||||
|
||||
while (cloudUpdateAkku >= cloudChanceEveryMin) {
|
||||
cloudUpdateAkku -= cloudChanceEveryMin
|
||||
tryToSpawnCloud(currentWeather)
|
||||
val newCloud = tryToSpawnCloud(currentWeather)
|
||||
// printdbg(this, "New cloud: scrX,Y,Scale=${newCloud?.screenCoord};\tworldXYZ=${newCloud?.pos}")
|
||||
}
|
||||
|
||||
|
||||
@@ -333,7 +334,7 @@ internal object WeatherMixer : RNGConsumer {
|
||||
}
|
||||
|
||||
|
||||
cloudUpdateAkku += delta
|
||||
cloudUpdateAkku += delta * world.worldTime.timeDelta
|
||||
|
||||
|
||||
oldCamPos.set(camvec)
|
||||
@@ -422,10 +423,10 @@ internal object WeatherMixer : RNGConsumer {
|
||||
currentWeather: BaseModularWeather,
|
||||
precalculatedPos: Vector3? = null,
|
||||
ageOverride: Int = 0
|
||||
) {
|
||||
): WeatherObjectCloud? {
|
||||
// printdbg(this, "Trying to spawn a cloud... (${cloudsSpawned} / ${cloudSpawnMax})")
|
||||
|
||||
if (cloudsSpawned < cloudSpawnMax) {
|
||||
return if (cloudsSpawned < cloudSpawnMax) {
|
||||
val flip = Math.random() < 0.5
|
||||
val rC = takeUniformRand(0f..1f)
|
||||
// val rZ = takeUniformRand(1f..ALPHA_ROLLOFF_Z/4f).pow(1.5f) // clouds are more likely to spawn with low Z-value
|
||||
@@ -483,9 +484,9 @@ internal object WeatherMixer : RNGConsumer {
|
||||
|
||||
// printdbg(this, "... Spawning ${cloud.category}($sheetX, $sheetY) cloud at pos ${it.pos}, scale ${it.scale}, invGamma ${it.darkness}")
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
else null
|
||||
}
|
||||
|
||||
private fun initClouds(currentWeather: BaseModularWeather) {
|
||||
|
||||
Reference in New Issue
Block a user