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

fix random seed with new seed_v2 db settings field #10066

Closed
wants to merge 1 commit into from

Conversation

michaeljb
Copy link
Collaborator

  • past games have a seed that is set when the game is started, that is only used for player order
  • the new seed_v2 is used for player order, as well as the in-game @seed used by rand
  • new games don't have seed, but old games with seed and not seed_v2 will continue to work as before, with @seed being set based on the game's ID (so no migrations needed)

Fixes #7465

@michaeljb michaeljb requested review from crericha and removed request for crericha December 31, 2023 03:23
@tobymao
Copy link
Owner

tobymao commented Dec 31, 2023

what is used for in game seed?? why is this needed? is seed only used for player order and not game elements?

* past games have a `seed` that is set when the game is started, that is only
  used for player order
* the new `seed_v2` is used for player order, as well as the in-game `@seed`
  used by `rand`
* new games don't have `seed`, but old games with `seed` and not `seed_v2` will
  continue to work as before, with `@seed` being set based on the game's ID

Fixes tobymao#7465
@michaeljb
Copy link
Collaborator Author

The original seed is just used for player order, #7465 talks about getting repeatable random elements in the game, for example in 18Chesapeake which corporation's presidents share goes with the Cornelius Vanderbilt company.

@crericha
Copy link
Collaborator

Overall looks good.

For what its worth...I think its possible to not replace seed with seed_v2 if you write script that modifies the settings of all existing games to 1) add player_order and 2) make seed nil.

@tobymao
Copy link
Owner

tobymao commented Dec 31, 2023

maybe let’s do that instead? or is player order a new field as well

@michaeljb
Copy link
Collaborator Author

Player order is an existing field, and I’ve got a script now that I think works for this, I’ll update the PR tomorrow

@michaeljb michaeljb closed this Dec 31, 2023
@michaeljb
Copy link
Collaborator Author

Changes were significant enough that I made a new branch instead of modifying this one.
#10070

@michaeljb michaeljb deleted the fix-random-seed branch December 31, 2023 18:15
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

Successfully merging this pull request may close these issues.

Seed specification not functional.
3 participants