You should totally make a github repo for this, so we can look at the source as we please without hopping into studio to try it out, not to mention you wouldn’t have to make a new post or edit your post everytime you changed it lol
Maid’s don’t “prevent” memory leaks, they’re just a more abstract way of doing it.
This:
local connection = something:Connect(someone)
connection:Disconnect()
Also ‘prevents’ memory leaks
Indeed. I’d rather use a maid module than merely throw things into a table though.
I might help this guy improve his module, if he lets me. Since I will be using this in my game, it may pay off.
I tried this module in studio and lagged my behind off using the sample code lol, I think that should 100% not happen because I have a decent computer; here’s reason(s) why this could be happening:
1, you’re connecting a new heartbeat for every cloud, i’ve tested it myself via microprofiler and firing more frame events is significantly more expensive than 1 loop that handles them all.
1a, make sure you use += for positioning clouds lol, it’s a bit micro but not indexing an extra time is going to help a little some if you’ve got a ton of clouds.
1b, here’s a more significant optimization: don’t construct a new cframe / position everytime, make sure you have a single one pre-constructed at all times, even if you need to have a method function to update said value, it’s still better. Now with all this said and in-mind, here’s an exaple of what i’d do for moving your clouds:
RunService.Heartbeat:Connect(function() -- a single heartbeat
for Cloud, Rate in pairs(CloudsTableHere) do
Cloud.Position += Rate
end
end)
That should yield significantly better performance compared to your current heartbeat setup.
Also a small gripe, for each cloud type you’re repeating your entire cloud construction in the code, what you can do instead is one construction that just uses a different mesh that you’d swap out before hand based on cloud type
Okay, I got to my computer and looked at the code. It appears that this module doesn’t wok the way I envisioned it in the backend, so I may be rewriting it.
Edit: As an explanation, I thought this was making real, volumetric clouds with math.noise
and density algorithms (Sebastian Lague has a good video on this). Then I learned it’s just cloning a model…
Unfortunately, to my knowledge, roblox studio is very limiting and dosen’t allow you to write shader code. In other words the Sebastian League video is impossible in roblox studio (again to my knowledge).
maybe not make the clouds completely flat in the bottom would make it way cooler
+
So really great looking cloud,I’ve seen you use stacked part,Which is beautiful but any idea on how to increase the performance because it’s quit laggy on my end,Anyway to reduce the part count?
Yeah, but you could probably find a way to substitute that for parts, if you’re clever.
I believe you could significantly reduce lag by using ImageHandleAdornments instead of parts, since they’re only suppose to display images. I tested it and saw no noticeable lag, but my machine is pretty good so that doesn’t say much. You can download my implementation and test its performance out here: CloudsRenderer.rbxm (4.6 KB).
EDIT: Finally compared the performance of the two methods. ImageHandleAdornments are indeed WAY faster.
Haha. I love weird bugs. Ill be fixing that in phase 3! Thank you for alerting me.
In phase 3 (Coming sometime this week) I plan to reduce the lag by nearly 100% to make it fully useable. Phase 3 will also contain several other properties for lag reduction, and a ton of new other cloud types for maximum customization.
The one that this module uses is “basically” that but it uses images I believe instead. Either way, parts or images, its impossible to get it to look as good as Sebastian League’s clouds.
UPDATE: Phase 3 is aimed to release friday at 7 PM Est
If it’s not too much work, I would suggest rewriting your module to implement perlin noise cloud generation. This could allow for random 3D clouds and octaves, to make more or less detailed clouds! If you don’t do it, I will…
It Impacts performance quite a lot. Phase 3 has the intention of having fully immersive clouds which wont effect performance, which will boost the immersivity of the users experience. My goal is to have the CloudsService be completely customizable, and have much more freedom.
Update: I’m now attempting to make a version that uses Perlin Noise and ParticleEmitters to replicate more 3D clouds. Wish me luck.