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

Random seed #92

Open
3 tasks done
TannerJ07 opened this issue Aug 28, 2024 · 2 comments
Open
3 tasks done

Random seed #92

TannerJ07 opened this issue Aug 28, 2024 · 2 comments
Labels
enhancement Improvement to existing capability

Comments

@TannerJ07
Copy link

Check ([ ] -> [x]) all that apply, then describe the issue below:

  • I have searched the tracker for similar issues (including closed ones)
  • I have provided a detailed example for how this feature should work
  • I have provided a use case for this feature, e.g. short description/share link of a game you're making and how you'd use the feature in that game, other things you've tried, edge cases, etc. (if applicable)

Random seed would work exactly like random, but it uses the current state of the level to generate the next random result. This would mean that undoing and then moving the same way would have the same result.

Just to be more specific: I imagine the current random uses a random number generator and chooses based on that. Random seed would use a random number generator based on the current state, and then it would choose a rule.

Best use case: any random game where you want undoing allowed, but still randomness that cant be controlled by repeating the same move.

@TannerJ07 TannerJ07 added the enhancement Improvement to existing capability label Aug 28, 2024
@david-pfx
Copy link
Owner

Yes, a feature to do that is a good idea. I was astonished to find out that undo/restart do not work that way.

I think my preference is to have a prelude setting and to track the seed on the undo stack. It looks simpler, both to use and to implement, but I will have to check whether the inbuilt RNG is friendly to that kind of thing.

@david-pfx
Copy link
Owner

BTW my 2048 game is a good example. You can always beat it by undoing a few times.

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

No branches or pull requests

2 participants