isaac-mason / recast-navigation-js

JavaScript navigation mesh construction, path-finding, and spatial reasoning toolkit. WebAssembly port of Recast Navigation.
https://recast-navigation-js.isaacmason.com
MIT License
273 stars 25 forks source link

document NavMeshQuery random seed functionality #409

Open GGAlanSmithee opened 4 months ago

GGAlanSmithee commented 4 months ago

I recently created a new project with an updated version of recast-navigation, and noticed the deterministic nature of NavMeshQuery.findRandomSeed, which is amazing.

Even though the implementation makes perfect sense, I was still a bit surprised to see that I got the same series of reproducable randomness as I ran my project over and over, so I was wondering

For the second question, I could not find any documentation on it, and wanted to add it to the README, but could not find a good place to put it. I think it would make sense to mention this functionality, the default seed of 1337, and the expected behavior.

isaac-mason commented 4 months ago

Hey @GGAlanSmithee!

Thanks for creating the issue. There isn't any documentation for this outside of the auto generated docs yet. I'll add some documentation for randomness & setting the random seed shortly and share it here to get your thoughts.

This isn't a breaking change - previously the same seeded random number generator was already being used, but now the seed can be set.

GGAlanSmithee commented 4 months ago

@isaac-mason

cool!

This isn't a breaking change - previously the same seeded random number generator was already being used, but now the seed can be set.

Yeah, I figured. This is really nice though!