Conversation
|
Extracted as-is from the time & weather exploration #1913 |
|
Test build no longer available. |
|
|
||
|
|
||
| func randomize() -> void: | ||
| var rain_type := randf() |
There was a problem hiding this comment.
I don't think you need to change this, but you could instead represent this as a Curve, domain and codomain both in the range [0, 1]; then you pick a random number between 0 and 1, index the curve with it, and the amount_ratio is the y-axis value; and the curve could be edited visually.
There was a problem hiding this comment.
Oh that is a great idea!
There was a problem hiding this comment.
I implemented this at f12befe. I'm actually not entirely convinced it is better!
There was a problem hiding this comment.
I implemented this at f12befe. I'm actually not entirely convinced it is better!
Oh cool let me check. I was also resuming work on this branch:
- Added fade_in() fade_out() methods which may be called (duck-typing) from TimeAndWeather. I verified it works if I make it rain instead of be foggy in the night.
- Added same Randomize tool button with seed value persisted as the other overlays.
And was about to jump into the curve idea. Good timing! I'll check yours first.
|
I'll make it draft for now, so I can play with the "visual curve as setting for random values" idea. |
wjt
left a comment
There was a problem hiding this comment.
I think this is great as-is. If you find the Curve approach is worth it (I guess it would make it easier to customise the heaviness curve) then perhaps that could be a follow-up?
A rain effect that can be used in levels. Like the clouds shadow or fog visual effects, it has a randomize method.
| @onready var gpu_particles_2d: GPUParticles2D = %GPUParticles2D | ||
|
|
||
|
|
||
| func randomize() -> void: |
There was a problem hiding this comment.
If one wanted to have a static amount of rain in a level, rather than a random amount, what would one do?
You could imagine refactoring this to have a rain_amount exported property that gets propagated through to the particles, and then the randomize function would set that property rather than directly setting gpu_particles_2d.amount_ratio.
But I'm not sure it's necessary for now.
So it has the same duck-typing as fog and clouds shadow. And also set it to emit in the scene, for drop-in usage.
Like the other overlay effects.
I really like it! Pushing and merging. Grabacion.de.pantalla.desde.2026-03-03.13-45-30.mp4 |

A rain effect that can be used in levels. Like the clouds shadow or fog visual effects, it has a randomize method.