I’d like to create an ambient sound/weather system, however I don’t know the most efficient way to accomplish this goal. I was thinking of having nodes that are checked for magnitude every so often by the player, and will play the appropriate ambient sounds attached to those nodes when inside the radius. This gets super complex and difficult though when a player is in a town, where buildings are rectangular instead of spherical or circular.
The drawing above is just an example of a situation. In my ideal system, when a player is outdoors they would see rain and hear the local environment’s effects when it rains. In an exterior (a porch for example), they would see rain only outside of the porch area, and not coming through the roof. When in an interior, they would hear muffled rain effects, and rain could still be seen through windows. When in a deep interior (a cave for example), they would hear that environment’s effects, like water dripping or a howling wind, with no rain sounds or particles.
How would you accomplish this? Sound nodes? Parts that fill every area perfectly and check if you’re inside one? Some complex system of raycasts? Something entirely different?
How would you go about organizing these? Intangible parts filling those spaces?
Also, how would one accomplish things like rain particles falling outside of a porch area, but not inside? If possible, I’d like to also have it so rain doesn’t fall inside of the house, so you wouldn’t see particles falling inside the home through the door if you’re on the porch
Yah I’d just have a bunch of colored bricks that you can have to represent those spaces and turn them into region3’s on start up.
As for particles @As8D made a very cool open sourced particle collision system which you would use to prevent going through parts. But I don’t see you using this without a crap ton of lag.
Unfortunately on Roblox, effects like rain are very difficult to generalize with a “Weather System” it’s a heck of a lot easier just to make custom rain per place, sculpting the parts and emitter lengths around the buildings.
For the Egg Hunt I had a plugin that allowed the builders to place down spherical / box zones and attach lighting settings / music to them. Anything that wasn’t part of a zone was the default zone, which could also have properties. Then there was a system that would check where the player was and tween towards the settings of the right zone.
In the rain effect that I’m pretty close to open-sourcing, it actually does volume attenuating depending on how close you are to spots exposed to the sky. I raycast upwards in a grid centered at the camera, and use that to determine how deep a player is inside a structure.
Raycasting isn’t very expensive, I believe I got about a thousand rain particles working like this a while ago with good performance when I first tested using trails for rain.
That’s awesome! Let’s say you have a map with around 150k to 300k parts though, thinking performance would still be good? Also how did you make them move? Did you cframe them and use some sort of algorithm to make sure they would be where they’re supposed to regardless of FPS?