godot-docs
godot-docs copied to clipboard
Replace references to OpenSimplexNoise with FastNoiseLite in manual pages
Godot version
v4.0.alpha [e8520044e]
System information
ArchLinux (godot-git)
Issue description
OpenSimplexNoise doesn't appear to be available in GDScript, it just throws the error in the title in editor and when running. I'm probably doing something stupid but I've followed the latest docs and it's just not having it. Has it been removed or something?
Steps to reproduce
- Build latest Godot
- Create new project
- Create script
-
@onready var noise = OpenSimplexNoise.new()
- Observe error
Minimal reproduction project
Yes. OpenSimplexNoise has been removed in favour of FastNoiseLite. See more in the PR here https://github.com/godotengine/godot/pull/56718
The online docs still need to be updated I guess.
Is a migration guide planned? Especially for breaking changes like OpenSimplexNoise
to FastNoiseLite
.
Godot 3
var noise = OpenSimplexNoise.new()
randomize()
noise.seed = randi()
noise.octaves = 2
noise.period = 10.0
noise.persistence = 0.8
var value = noise.get_noise_2d(x, y)
@twoco There is the official guide (PRs welcome): https://docs.godotengine.org/en/latest/tutorials/migrating/upgrading_to_godot_4.html It mentions the change here in general terms.
There are also third-party guides available.
So, what can replace the code given by twoco ? I have an issue with noise.period which doesn't seems to work like in version 3. Nothing mentionned in the provided link.
Afaik, there is no (simple) 1:1 replacement as a lot has changed. Some things work better, others worse. More or less. You can find almost nothing on the internet by searching "Godot", "FastNoiseLite", "noise_type", etc. and the docs are a bit confusing and dry. Some examples and migration would be great. I could improve the docs, but I didn't fully understand it myself and have not yet enough experience with that. Anyway... I can help with some code and tips. It seems that FastNoiseLite simplex only parameter is Frequency, but can be combine with other layers like Fractal and Domain Wrap. A good start is to create a noise texture on a mesh material and play with the parameters... A common example with all features of simplex noise would be great. But you can start with this code below and discover other paramter like fractal_octaves etc. See docs. Also divide or multiply the x,y values in get_noise_2d to experiment with the result.
var noise: FastNoiseLite = FastNoiseLite.new()
randomize()
noise.noise_type = FastNoiseLite.TYPE_SIMPLEX
noise.seed = randi()
noise.frequency = 2.0
var value = noise.noise.get_noise_2d(x, y)