New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Random's consistency #991
Comments
Interesting...
|
We don't need to reinvent the wheel here. C++ has had Things to discuss:
|
Do we want scripts to be able to create PRNG instances (might be cool for random numbers synchronized across clients) I think this would be good. This would also be beneficial for multi-gamemode servers. replace default As long as we can create RandomGenerator instances, I don't see much benefit to having our own equivalent to Imo the only benefit would be making it slightly easier to use, but if your code depends on a consistent PRNG, you probably wouldn't mind going through the minor inconvenience of instantiating your own generator. global vs. per-resource PRNG If we do intend to have a simple function (without the need of instantiating a generator):
|
Per-resource PRNG, please. |
Is your feature request related to a problem? Please describe.
As I understand, Lua's
math.random
depends on OS' implementation of them.At the moment
math.random
returns different values even with same seed (server and client runned on different platforms). So it can't be used for world generation, etc (I have to send huge amount of data from server to clients or use 3rd party libraries)Describe the solution you'd like
Add own
random
functions which will use same algorithm on each platform.Describe alternatives you've considered
3rd party libraries written on Lua may significantly reduce the perfromance if it used a lot
Additional context
no
The text was updated successfully, but these errors were encountered: