Simple/Colloquial Weather [2.1.0] - An easy way to create weather

Proudly representing, Kalaran.


:open_book: What is Simple/Colloquial Weather?

Simple Weather is a concluded module to simulate the environment a player sees within the game. here are some features and things to know!

  • :gear: Many Behavior Options to choose from, such as Ambiance and Cloud Settings

  • :recycling_symbol: Transitions between Weather Types, which include: Sound, Lighting and Sky, and Wind

  • :books: Easy to Modify and Add Changes.

  • :busts_in_silhouette: Runs on both the Client or Server.

  • :globe_with_meridians: Supports Server to Client communication/replication; for global weather changes


:eyes: Small Showcase (OLD)

Performance has greatly increased from recent versions…

(2.1.0 | 4/26) Testing Place: SimpleWeatherTest.rbxl (137.4 KB)


:bullseye: How do I use it? (Quick Start)


Download the Module,
requiring the ID does not work.


Open a Script preferably a LocalScript, and Initialize.

local SimpleWeather = require(game.ReplicatedStorage.SimpleWeather)

SimpleWeather:Init() -- loads the module, you can put a weather type to start with, inside '()'

task.delay(5, function()
    SimpleWeather:ChangeWeather("Rain")
end)

SimpleWeather.WeatherChanged:Connect(function(NewWeather)
    print('The Current Weather is now : '..NewWeather)
end)

:notebook_with_decorative_cover: API Reference

Summary

Lifecycle


:Init(overrideStartWeather: string?)

Initializes SimpleWeather. Calling it again returns the module without re-initializing. Must be called before any other method.

Parameter Type Description
overrideStartWeather string? Name of a weather type to start with instead of Config.StartWeather.

Returns: WeatherService


:Cleanup()

Destroys all created instances, stops sounds, and clears the weather queue. No-ops if not initialized.


Weather Control


:ChangeWeather(weatherName: string, overrideTime: number?)

Transitions to the given weather type. On the server when replicating, updates state and fires signals without applying visuals — clients handle rendering. No-ops if the weather is already active.

Parameter Type Description
weatherName string Name of the weather type to transition to. Must exist in Config.WeatherTypes.
overrideTime number? Overrides Config.TransitionTime for this transition only. Pass 0 for an instant change.

If a transition is already in progress and PutWeatherOnQueues is enabled, the request is queued and processed after the current transition completes.


:ToStartWeather()

Shorthand for :ChangeWeather(Config.StartWeather).


:GetRandomWeather()

Returns a random weather type name that is not the current weather.

Returns: string


Signals


WeatherChanging(weatherName: string, isReplicated: boolean)

Fires at the start of a weather transition, before any visuals are applied.

Parameter Type Description
weatherName string The name of the incoming weather type.
isReplicated boolean true if this change originated from server replication.

WeatherChanged(weatherName: string, isReplicated: boolean)

Fires after a weather transition fully completes, including tween duration.

Parameter Type Description
weatherName string The name of the now-active weather type.
isReplicated boolean true if this change originated from server replication.

Properties


CurrentWeather: string

The name of the currently active weather type.


Config

Module-level configuration table. Should be set before calling :Init().

Key Type Default Description
TransitionTime number 5 Duration in seconds for weather transitions.
EasingStyle Enum.EasingStyle Sine Easing style used for tween transitions.
EasingDirection Enum.EasingDirection InOut Easing direction used for tween transitions.
InstantWindChange boolean true If true, wind changes instantly instead of tweening.
PutWeatherOnQueues boolean true If true, weather changes requested mid-transition are queued.
WeatherFolderParent Instance workspace Parent for the weather folder. Must be a descendant of workspace.
StartWeather string "Normal" The default starting weather type.
WeatherTypes table {} Table of weather type definitions. Can be populated manually or via WeatherTypes module scripts.

Internal Configuration

These are module-level constants defined at the top of the script. They must be changed directly in the source.

Constant Type Default Description
REPLICATE_WEATHER_CHANGES boolean true If true, the server manages weather and replicates changes to clients. The server will not create visual instances.
ON_REPLICATION_CHANGE_WEATHER boolean true If true, clients apply weather visuals when a replication event is received. If false, only WeatherChanging is fired.
TWEEN_CACHING_ENABLED boolean true If true, tweens for persistent objects are cached and reused across transitions.
MAX_CACHED_TWEENS number 9 Maximum number of cached tweens per object before oldest entries are evicted.
CAN_DEBUG boolean true If true, warnings are printed via warn() for invalid usage.

Weather Type Schema

Each entry in Config.WeatherTypes must follow this structure:

Key Type Description
AmbientID number? Asset ID for the ambient sound. nil for no sound.
Volume number? Volume of the ambient sound.
CloudColor Color3? Color of the clouds.
CloudCover number? Cloud cover amount, 0–1.
Density number? Cloud density, 0–1.
SkyBrightness number? Lighting.Brightness value.
WindDirection Vector3? Direction of the wind. Normalized internally.
WindSpeed number? Speed of the wind.
Fog number? Atmosphere.Density value, 0–1.

( If one of the properties are not provided, It’ll use the Instance’s current property value. )


:globe_with_meridians: How to Sync Simple/Colloquial Weather across Clients

Modular Method (Best)

Instead of creating instances, Simple weather can handle all of that for you!

Inside the module, scroll down until you see a commented section called Internal Configuration. To start replication turn REPLICATE_WEATHER_CHANGES to true - The module will now send events from the server to tell the clients what the current weather is on the server.

ON_REPLICATION_CHANGE_WEATHER; Once set to true, when the server calls WeatherService:ChangeWeather( ... : string ) the client will automatically change the weather - the client will yield and wait for the server to create the necessary objects: a RemoteEvent and RemoteFunction.

Example

Client

local Weather = require(game.ReplicatedStorage.SimpleWeather):Init()

Weather.WeatherChanging:Connect(function(NewWeather: string, isFromServer: boolean)
	print(`[CLIENT]: Going into : {tostring(NewWeather)} | fromServer?: {tostring(isFromServer)}`)
end)

Weather.WeatherChanged:Connect(function(NewWeather: string, isFromServer: boolean)
	print(`[CLIENT]: The Current Weather is now : {tostring(NewWeather)} | fromServer?: {tostring(isFromServer)}`)
end)

Server

local Weather = require(game.ReplicatedStorage.SimpleWeather):Init()

task.defer(function()
	while task.wait(8) do
		local newWeather = Weather:GetRandomWeather()
		Weather:ChangeWeather(newWeather)
	end
end)

Weather.WeatherChanging:Connect(function(NewWeather: string)
	print("[SERVER]: Going into : ".. NewWeather)
end)

Weather.WeatherChanged:Connect(function(NewWeather: string)
	print("[SERVER]: The Current Weather is now : "..NewWeather)
end)
Vanilla Method

This is quite a simple way to sync data between clients, this is generally better as it makes the tweens much smoother, since everything is calculated and processed in the client.

Create Two Events in ReplicatedStorage
Screenshot 2024-12-24 192028

Create A Local-Script and a (Server-)Script
"Script" Location
"Local-Script" Location


Communicator : (Server-)Script

--// Services : https://devforum.roblox.com/t/simple-weather-14/3028058
local replicatedStorage = game:GetService("ReplicatedStorage")

--// Modules
local modules = replicatedStorage.Modules
	local SimpleWeather = require(modules.SimpleWeather)

--// Shared
local shared_ = replicatedStorage.Shared
	local GetWeatherFunction = shared_.GetWeather
	local ChangeWeatherEvent = shared_.ChangeWeather

--// Constants
local MIN_CHANGE_TIME = 5
local MAX_CHANGE_TIME = 10

--// Values
local currentWeather = SimpleWeather.GetRandomWeather()
SimpleWeather.CurrentWeather = currentWeather

--// Functions
function ChangeWeather(name)
	if name and SimpleWeather.WeatherTypes[name] then
		currentWeather = name
	else
		currentWeather = SimpleWeather.GetRandomWeather()
	end
	SimpleWeather.CurrentWeather = currentWeather
	ChangeWeatherEvent:FireAllClients(currentWeather, tick()) -- Fire to all clients
end

--// Connection
GetWeatherFunction.OnServerInvoke = function()
	return SimpleWeather.CurrentWeather
end

while task.wait(Random.new():NextInteger(MIN_CHANGE_TIME,MAX_CHANGE_TIME)) do
	ChangeWeather(nil)
end

WeatherHandler : Local-Script

--// Services : https://devforum.roblox.com/t/simple-weather-14/3028058
local replicatedStorage = game:GetService("ReplicatedStorage")

--// Modules
local modules = replicatedStorage.Modules
	local SimpleWeather = require(modules.SimpleWeather)

--// Shared
local shared_ = replicatedStorage.Shared
	local GetWeatherFunction = shared_.GetWeather
	local ChangeWeatherEvent = shared_.ChangeWeather

--// Values
local weatherChangeConnection:RBXScriptConnection

--// Functions

-- Prepares and Syncs the Weather
function Setup()
	local currentWeather = GetWeatherFunction:InvokeServer() -- ask from the server what the weather is like currently
	SimpleWeather.Init(currentWeather) -- catch up to current weather
	
	weatherChangeConnection = SimpleWeather.WeatherChanged:Connect(function(currentWeather)
		print("Change to",currentWeather)
	end)
end

function ChangeWeather(name, requested:number)
	local instant = tick() - requested >= 5
	SimpleWeather.ChangeWeather(name,instant)
	
	if instant then
		warn("The client is experiencing latency, quickly changing.")
	end
end

--// Connection
spawn(Setup)

ChangeWeatherEvent.OnClientEvent:Connect(ChangeWeather)

How can I add more Types of Weather?

To add more Weather-Types you can either,

Insert Manually

Add a module, inside the WeatherTypes folder, name it to your preference.

The image shows the properties you can set, these are the default Roblox properties, the AmbientId: number.

Please remember to set yourStartWeather to a valid weather type.

Insert Directly

Index the name of your weather preset and insert the data with a table - [string]: WeatherTypeData. These are all the available properties to use, the AmbientId: number.

Please remember to set yourStartWeather to a valid weather type.

Information is given in this image…


Other Similar Sources
In no particular order:

Please note the the leaves moving is using another module called WindShake | boatbomber, I highly recommend this module too!


Version History
1.0.0 | Initial Release
  • Code Revamp
  • Optimization
2.1.0 | 4/4/26
  • Code Revamp
  • Added Replication
  • Optimization (Tween Caching)

| :building_construction: DOWNLOAD |

-SOME RELEASES MAY NOT BE STABLE PLEASE REPORT BUGS TO THIS TOPIC-


29 Likes

Minor Update | New Features
Added more Customization Options.

2 Likes

Hi,
Thanks for sharing.

Is there anyway of having it run on the client? Because you might have different biomes and want different weather going on for different players…

1 Like

This is very nice!
Will fork it and combine it with RLTIME to get a more “Realistic” feel.

RL TIME: Introducing RLTime: Real-Time Lighting & Time Simulation

game that I will use this in: Prelude (WIP) - Roblox

1 Like

I was thinking about that, this would mean that i could make another one that is client side…

Edit : On second thought, you can, if im not wrong, just make sure everything is run on the client only because clashing could happen between Server and Client.

Awesome! good-luck creating it. its a such a gift to see someone finding relevance to something that I made. :slight_smile:

1 Like

Of course!

Will give you the files for the forked version once I’m done

Oh, ok! Maybe I could make a revamped version of the current one?

The current one had amazing features!

It could use some optimization and some extra feature but what you have rn is a solid and amazing resource!

1 Like

Also, an example .rbxl or open source place is always nice to play with…

1 Like

I just added one now, thanks for that!

So, I just got to using this module and just realized that you cant have multiple parts rain at the same time.
Could you add a tag/attribute that it checks for and then cycles the weather loop?

Currently i plan to make this game huge, So I will need tons of diffrent parts to cycle at the same time.

Game link:Sanrio Project - Roblox

I dont understand? Please know anything outside the module like rain effects and extra sounds arently really issued with me… I think you might be refering to my example place?

Sorry, Its hard to explain because English is not my first language.
In the test place, there is 1 part named “fake rain” that is the area which rain is produced.
However, in my game. I would like there to be multiple parts across the in game map.
I dont think your module is capable of handling multiple parts without tons of duplicate scripts.
For example: I have 2 fake rain parts. I want both of them to cycle rain independently without having to make multiple scripts for each one.
Therefore, i think tags or attributes would be useful, you could use them like smart bone does to tag objects the client needs to work on.

For more, fun, how hard is it to have it NOT go through parts, like a part that is a roof…

or not go through terrain, like in a cave

also what about adding puddles when it hits the ground?

thanks

1 Like

You will have to script that your self unfortunately. I made a script so when the weather changed it would activate the particles depending on what weather its currently on, the script is not part of the system.

Like i mentioned before the rain effect is not part of system, i may add it in future but not right now. Please script these unadded features and this means the system would have to be clientside to do so. I hope you all understand, you must script these rain effects by using raycasts or zone detections - this is help btw. The system is meant for static open scences like forests, and transitioning scences if you get what i mean.

mm, maybe V 2.5 will be client side… :slight_smile: , but I get what you are saying… it is just that alot of maps are going to have different bioms, and or people are going to be in different areas

1 Like

It actually is already lol, you just need to make sure every script that initializes the system, is a Local Script; Its both Server and Client but it only works properly on one.

A new Update Patch has been received!
Simple Weather has gained a few bug fixes and revisions, it should run as intended and experience less Issues, I’ve decided continue this project but with less Updates.

SW is suggested to run on the Client now.