mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-10 02:24:05 +09:00
more clouds
This commit is contained in:
@@ -5,7 +5,7 @@
|
|||||||
"cloudChance": 33,
|
"cloudChance": 33,
|
||||||
"cloudGamma": [0.48, 1.8],
|
"cloudGamma": [0.48, 1.8],
|
||||||
"cloudGammaVariance": [0.1, 0.1],
|
"cloudGammaVariance": [0.1, 0.1],
|
||||||
"cloudDriftSpeed": 0.08,
|
"cloudDriftSpeed": 0.16,
|
||||||
"clouds": {
|
"clouds": {
|
||||||
"cumulonimbus": {
|
"cumulonimbus": {
|
||||||
"filename": "cloud_large.png", "tw": 2048, "th": 1024, "probability": 0.25,
|
"filename": "cloud_large.png", "tw": 2048, "th": 1024, "probability": 0.25,
|
||||||
|
|||||||
@@ -255,7 +255,9 @@ object IngameRenderer : Disposable {
|
|||||||
gdxClearAndEnableBlend(0f, 0f, 0f, 0f)
|
gdxClearAndEnableBlend(0f, 0f, 0f, 0f)
|
||||||
|
|
||||||
// draw sky
|
// draw sky
|
||||||
WeatherMixer.render(camera, batch, world)
|
measureDebugTime("WeatherMixer.render") {
|
||||||
|
WeatherMixer.render(camera, batch, world)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// normal behaviour
|
// normal behaviour
|
||||||
|
|||||||
@@ -292,16 +292,16 @@ class BasicDebugInfoWindow : UICanvas() {
|
|||||||
|
|
||||||
if (ingame != null) {
|
if (ingame != null) {
|
||||||
App.fontSmallNumbers.draw(batch, "${ccY}Actors total $ccG${ingame!!.actorContainerActive.size + ingame!!.actorContainerInactive.size}",
|
App.fontSmallNumbers.draw(batch, "${ccY}Actors total $ccG${ingame!!.actorContainerActive.size + ingame!!.actorContainerInactive.size}",
|
||||||
TinyAlphNum.W * 2f, App.scr.height - TinyAlphNum.H * 2f)
|
TinyAlphNum.W * 2f, App.scr.height - TinyAlphNum.H * 2f)
|
||||||
App.fontSmallNumbers.draw(batch, "${ccY}Active $ccG${ingame!!.actorContainerActive.size}",
|
App.fontSmallNumbers.draw(batch, "${ccY}Active $ccG${ingame!!.actorContainerActive.size}",
|
||||||
(TinyAlphNum.W * 2 + 17 * 8).toFloat(), App.scr.height - TinyAlphNum.H * 2f)
|
TinyAlphNum.W * 2f + (17 * 8), App.scr.height - TinyAlphNum.H * 2f)
|
||||||
App.fontSmallNumbers.draw(batch, "${ccY}Dormant $ccG${ingame!!.actorContainerInactive.size}",
|
App.fontSmallNumbers.draw(batch, "${ccY}Dormant $ccG${ingame!!.actorContainerInactive.size}",
|
||||||
(TinyAlphNum.W * 2 + 28 * 8).toFloat(), App.scr.height - TinyAlphNum.H * 2f)
|
TinyAlphNum.W * 2f + (28 * 8), App.scr.height - TinyAlphNum.H * 2f)
|
||||||
if (ingame is TerrarumIngame) {
|
if (ingame is TerrarumIngame) {
|
||||||
App.fontSmallNumbers.draw(batch, "${ccM}Particles $ccG${(ingame as TerrarumIngame).particlesActive}",
|
App.fontSmallNumbers.draw(batch, "${ccM}Particles $ccG${(ingame as TerrarumIngame).particlesActive}$ccY/$ccG${(ingame as TerrarumIngame).PARTICLES_MAX}",
|
||||||
(TinyAlphNum.W * 2 + 41 * 8).toFloat(), App.scr.height - TinyAlphNum.H * 2f)
|
TinyAlphNum.W * 2f, App.scr.height - TinyAlphNum.H * 4f)
|
||||||
App.fontSmallNumbers.draw(batch, "${ccM}Clouds $ccG${WeatherMixer.cloudsSpawned}",
|
App.fontSmallNumbers.draw(batch, "${ccM}Clouds $ccG${WeatherMixer.cloudsSpawned}$ccY/$ccG${WeatherMixer.cloudSpawnMax}",
|
||||||
(TinyAlphNum.W * 2 + 53 * 8).toFloat(), App.scr.height - TinyAlphNum.H * 2f)
|
TinyAlphNum.W * 2f + (18 * 8), App.scr.height - TinyAlphNum.H * 4f)
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -95,8 +95,8 @@ internal object WeatherMixer : RNGConsumer {
|
|||||||
private val clouds = SortedArrayList<WeatherObjectCloud>()
|
private val clouds = SortedArrayList<WeatherObjectCloud>()
|
||||||
var cloudsSpawned = 0; private set
|
var cloudsSpawned = 0; private set
|
||||||
private var cloudDriftVector = Vector3(-1f, 0f, 0.1f) // this is a direction vector
|
private var cloudDriftVector = Vector3(-1f, 0f, 0.1f) // this is a direction vector
|
||||||
private val cloudSpawnMax: Int
|
val cloudSpawnMax: Int
|
||||||
get() = App.getConfigInt("maxparticles") * 2
|
get() = 256 shl (App.getConfigInt("maxparticles") / 256)
|
||||||
|
|
||||||
override fun loadFromSave(s0: Long, s1: Long) {
|
override fun loadFromSave(s0: Long, s1: Long) {
|
||||||
super.loadFromSave(s0, s1)
|
super.loadFromSave(s0, s1)
|
||||||
@@ -220,7 +220,7 @@ internal object WeatherMixer : RNGConsumer {
|
|||||||
|
|
||||||
val cloudChanceEveryMin = 60f / (currentWeather.cloudChance * currentWeather.cloudDriftSpeed) // if chance = 0, the result will be +inf
|
val cloudChanceEveryMin = 60f / (currentWeather.cloudChance * currentWeather.cloudDriftSpeed) // if chance = 0, the result will be +inf
|
||||||
|
|
||||||
if (cloudUpdateAkku >= cloudChanceEveryMin) {
|
while (cloudUpdateAkku >= cloudChanceEveryMin) {
|
||||||
cloudUpdateAkku -= cloudChanceEveryMin
|
cloudUpdateAkku -= cloudChanceEveryMin
|
||||||
tryToSpawnCloud(currentWeather)
|
tryToSpawnCloud(currentWeather)
|
||||||
}
|
}
|
||||||
@@ -257,6 +257,7 @@ internal object WeatherMixer : RNGConsumer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private val scrHscaler = App.scr.height / 720f
|
private val scrHscaler = App.scr.height / 720f
|
||||||
|
private val cloudSizeMult = App.scr.wf / TerrarumScreenSize.defaultW
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param range: range of the randomised number
|
* @param range: range of the randomised number
|
||||||
@@ -281,8 +282,6 @@ internal object WeatherMixer : RNGConsumer {
|
|||||||
val rC = takeUniformRand(0f..1f)
|
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
|
val rZ = takeUniformRand(1f..ALPHA_ROLLOFF_Z/4f).pow(1.5f) // clouds are more likely to spawn with low Z-value
|
||||||
val rY = takeUniformRand(-1f..1f)
|
val rY = takeUniformRand(-1f..1f)
|
||||||
val r1 = takeUniformRand(-1f..1f)
|
|
||||||
val r2 = takeUniformRand(-1f..1f)
|
|
||||||
val rT1 = takeTriangularRand(-1f..1f)
|
val rT1 = takeTriangularRand(-1f..1f)
|
||||||
val (rA, rB) = doubleToLongBits(Math.random()).let {
|
val (rA, rB) = doubleToLongBits(Math.random()).let {
|
||||||
it.ushr(20).and(0xFFFF).toInt() to it.ushr(36).and(0xFFFF).toInt()
|
it.ushr(20).and(0xFFFF).toInt() to it.ushr(36).and(0xFFFF).toInt()
|
||||||
@@ -308,7 +307,7 @@ internal object WeatherMixer : RNGConsumer {
|
|||||||
val sheetX = rA % cloud.spriteSheet.horizontalCount
|
val sheetX = rA % cloud.spriteSheet.horizontalCount
|
||||||
val sheetY = rB % cloud.spriteSheet.verticalCount
|
val sheetY = rB % cloud.spriteSheet.verticalCount
|
||||||
WeatherObjectCloud(cloud.spriteSheet.get(sheetX, sheetY), flip).also {
|
WeatherObjectCloud(cloud.spriteSheet.get(sheetX, sheetY), flip).also {
|
||||||
it.scale = cloudScale
|
it.scale = cloudScale * cloudSizeMult
|
||||||
|
|
||||||
it.posX = posX
|
it.posX = posX
|
||||||
it.posY = posY
|
it.posY = posY
|
||||||
|
|||||||
Reference in New Issue
Block a user