Skip to content
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

Add some sort of random seed source #401

Closed
gnarz opened this issue Feb 16, 2022 · 3 comments
Closed

Add some sort of random seed source #401

gnarz opened this issue Feb 16, 2022 · 3 comments

Comments

@gnarz
Copy link

gnarz commented Feb 16, 2022

As we can not rely on the operating system for this, it would be neat to have a few bytes (like, 4 or 8), that are different on each invocation of w4. The intent is to use them as a random seed source, so that games whose level layout depends on random numbers don't always look the same. Anything would be fine, like a timestamp or something, as long as it changes with each invocation. Alternatively there could be a function to do that.

@aduros
Copy link
Owner

aduros commented Feb 16, 2022

#365 adds a timestamp which might be useful here.

Alternatively you can use the gamepad input to seed the RNG (such as frames elapsed on your game's title screen before getting to the actual gameplay)

@gnarz
Copy link
Author

gnarz commented Feb 16, 2022

that‘s exactly what I would need here. Thanks!

@gnarz gnarz closed this as completed Feb 16, 2022
@tjpalmer
Copy link
Contributor

Alternatively you can use the gamepad input to seed the RNG (such as frames elapsed on your game's title screen before getting to the actual gameplay)

I'm mentioning the title screen trick in the video I'm making, by the way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants