Bastrabun wrote: ↑
Sat May 16, 2020 07:19
2. Depends on how it is done. Do you determine above which node a weather effect should take place near a player, or do you add some layers of particles around a player and only check above? I assume you don't do automatic weather below 0 anyways, right?
Like most mods, I check for the maximum daylight at a player's head position. This will always be 15 if a player is not underneath a roof whereas lamps can reach a maximum of 14. In addition to that, I also disable weather presets outside the configurable height range (which defaults to -50 to 120). The light check is extremely fast und only done once per update cycle and player. Only exception is the deep_cave
preset which is applied underneath the usual height range. But all it does is remove sun, stars and moon, and color the skybox black (so that you don't get weird skybox clippings when the terrain is loading in a cave).
How bad is it performancewise to raycast downwards from cloudlevel until a solid node is found and only display weather above? (Or, half the rain/snow effect for each leaves node the raycast is passing?). You don't need to do that every step, but since others use raycasts for radar, it can't be that bad. And you'd only have to do it once the weather starts and then every x seconds (under the assumption that players don't build a roof to shelter). To avoid lagspikes, you don't need to do it all in one step, but at random around the player.
Or am I just wrong and not the where to make weather but the how to make weather with particles is the expensive thing? (And you probably already use raycasts and line_of_sight)
The raycast itself wouldn't be too bad. The problem is that I would then have to split the particles into multiple "height areas" depending on the raycast's result. This, in turn, means that I need multiple particle spawners (with different settings) which lead to a lot more lag because they aren't optimized well. It's possible theoretically but only really doable once the engine gets some optimization for particle systems. Alternatively, I could spawn the particles individually instead of using a spawner. But that's even worse for performance.
I might experiment with this a little bit. But it's most likely going to stay an optional setting that's disabled by default.
I just made it rain in a fairly large cave, that's awesome :)
Wait, what? That should only be possible if you have direct sunlight access.
Although I suppose it's possible if the ceiling isn't loaded based on your viewing range. But that's gotta be a large cave! :o
For the malicous people: Is there a way to make weather for another player? ;)
If you have the weather privilege, you can tinker with the global settings that affect everyone. Othen than that, I really cannot think of a way. You could remove the roof on top of an afk player during a heavy hail, I guess.
What is it that sometimes the fog lifts for about a second and then conceals the landscape again? It feels like this effect is in sync with the sound of the wind?
Uuhhh... I'm not sure what's going on there. Fog should be applied regardless of the indoors check. It does indeed not apply at high windspeeds but the wind should only be updated every 15 seconds. Have you disabled standard MTG weather in the settings as instructed? Because the included mod called "weather" randomizes the clouds (and that's all it does, really). That can obviously interfere with my own cloud effects, including the fog.
But the worst thunderstorm is still looking and sounding quite harmless. Maybe I didn't find the right settings yet. I compare with weather_pack, where the sky gets dark, roaring thunder, ...
Yeah. It's supposed to be more of a heavy rain with occasional lightning as opposed to a full on thunderstorm. I was planning to do a second pack with extreme weather scenarios and desasters. Those are obviously not something for everyone, so they will be separated into their own mod. It's kinda low on my bucket list, though.
6. Could you make it that the puddles created by rainwater can be drained with a bucket, resulting in a bucket with river_water?
Theoretically, I could. I was hesitant to do so because a water bucket usually takes a whole node of water whereas these are just very small puddles. I am working a joke mod, though, that adds a mop you can use to get rid of the puddles and that you can drain in a bucket once it's filled up. I was going to call it "mopkit". XD
7. 3. I get another error when I die in a sandstorm: [...]
When I insert some value I am not supposed to, I get an error: [...]
Agh. Looks like I missed some more stuff. Thanks.
8. Do you prefer my input here or should I make issues on github or any other way? Also english or German?(Asking, since both of us are German)
Either way is fine really. I suppose in an ideal scenario, I prefer general feedback on the forums and bug reports on Github. English is best so that other people can understand what's going on.