Page 1 of 1
replay feature by supplying RNG seed (https://boardgamearena.com/bug?id=134924)
Posted: 21 August 2024, 20:09
by horos22
all,
I want the following feature at BGA to help getting better at games. Often times, when I'm trying to learn, I take randomness out of the game and start at a specific position with a specific ordering of cards. That way, when I replay, I can see if I am actually getting better at the game rather than am at the mercy of whatever randomness is there.
For BGA I think implementing this would be trivial by supplying you the RNG seed at the beginning and allowing you - as an option - to enter that RNG seed at the very beginning to get the same cards on replay.
Anyways I've put up my suggestion here if this sounds cool, please vote:
https://boardgamearena.com/bug?id=134924
Re: replay feature by supplying RNG seed (https://boardgamearena.com/bug?id=134924)
Posted: 22 August 2024, 00:58
by Kayvon
horos22 wrote: ↑21 August 2024, 20:09I think implementing this would be trivial
It only seems trivial until you try implement it, then you discover that bga_rand() and shuffle() use different algorithms and seeds. There's a whole bit about it here if you're interested:
https://en.doc.boardgamearena.com/Main_ ... domization
Although it's far from simple, I implemented a seed for Gaia Project's solo mode. You can play against the same automa as your friend. There's a monthly competition to see who can get the best score against a particular seed. Players share tips and tricks. Really cool... hopefully it's exactly what you're looking for.
Re: replay feature by supplying RNG seed (https://boardgamearena.com/bug?id=134924)
Posted: 22 August 2024, 02:59
by GTSchemer
It is worth noting that seeded RNG should not be used for a game implementation site like BGA, because it may be possible for users capturing sufficient consecutive data points to determine the state of the seeded RNG, and then in theory, they could know future numbers. If I recall correctly, there have actually been some security vulnerabilities on the web in the past due to this sort of thing.
Also, BGA mandates that bga_rand() is used, which is an unseeded random number generator of cryptographic quality.
For games where repeating a sequence of cards could be interesting, it would be possible to let the user import a data string containing a sequence of card IDs, and initialize the deck that way.
Re: replay feature by supplying RNG seed (https://boardgamearena.com/bug?id=134924)
Posted: 23 August 2024, 02:19
by horos22
> It is worth noting that seeded RNG should not be used for a game implementation site like BGA, because it may be possible for users capturing
> sufficient consecutive data points to determine the state of the seeded RNG, and then in theory, they could know future numbers. If I recall
> correctly, there have actually been some security vulnerabilities on the web in the past due to this sort of thing.
> Also, BGA mandates that bga_rand() is used, which is an unseeded random number generator of cryptographic quality.>>
ok sure.. but:
1. the suggestion is not to replace the current random implementation, just override it for one use case.
2. the random numbers would not be used for anything outside the game but only inside the sandbox that is a particular game. You would get the option when starting a single-player game to give a seed, and obviously you'd need to convey that to all the players of the game that the numbers were deterministic and you would get the same setup each time if you set it.
Anyways in my mind this opens up whole new types of gameplay again for very low startup cost. One of the modes suggested on the bug forum for this was to have the same seed for a given solo game for a month - and have a competition to see how well people can do with that particular seed. So every single one player game on the site instantly gets a competitive mode.
Likewise you could interactively replay a game with friends, go back to say a given move and see how a different action would work out. So much in the way of learning is lost when you can't play variants, and this would allow for such gameplay.
Or you could prefer to remove the randomness from any given game, knowing the cards coming up so you factor that into your gameplay going forwards. Everything becomes more strategic that way, especially in games of cards like dominion or mtg where the anticipation of a given card could be worked into your gameplay.
The mandate is there, yes, but I'm sure that with a reasonable reason to override it an exception could perhaps be made. Or at least I'm hoping.
Re: replay feature by supplying RNG seed (https://boardgamearena.com/bug?id=134924)
Posted: 23 August 2024, 04:18
by Kayvon
horos22 wrote: ↑23 August 2024, 02:19have the same seed for a given solo game for a month - and have a competition to see how well people can do with that particular seed. So every single one player game on the site instantly gets a competitive mode.
That's exactly how Gaia Project does it, as I alluded to earlier. It even provides its own "challenge of the week" if you don't like to copy-paste seeds.
Re: replay feature by supplying RNG seed (https://boardgamearena.com/bug?id=134924)
Posted: 27 August 2024, 06:39
by horos22
Kayvon wrote: ↑23 August 2024, 04:18
horos22 wrote: ↑23 August 2024, 02:19have the same seed for a given solo game for a month - and have a competition to see how well people can do with that particular seed. So every single one player game on the site instantly gets a competitive mode.
That's exactly how Gaia Project does it, as I alluded to earlier. It even provides its own "challenge of the week" if you don't like to copy-paste seeds.
Yes and I agree. Its an awesome idea. I'd just like to provide API support for it so that it comes to my favorite game - as it does everyone's favorite game.
The more I'm thinking about it, the better this idea gets. You could for example implement a true rewind system using it. If you implemented a game as a list of turn actions, you could simply rewind to any point in the turn stack by starting over, playing through those turns using the same seed, and getting to the desired place in the game. As long as the replay isn't looped through the gui, it should be doable.
And it would be a wonder for a tutorial system. I run a games club teaching teenagers board games as a method to learn critical thinking - and the chess and go part of the club is much more focused on learning strategy and tactics than the rest simply because the programs support this infinite redo - you can bring the game to any point and play different variations to see what works and what doesn't work.
I miss this for games like diplomacy or games like agricola and terra mystica. Again, I would like to try different strategies out and see how they work - as it stands, I see a cool variation - either online or in person - and it is gone as soon as it comes.
Anyways I sincerely doubt that this is going to get developer attention because I think that the only really good way of showing how cool this would be would be by prototyping it. And I'm willing to put in the effort to make such a patch but have no clue on how I could get the access to do something like this.
Re: replay feature by supplying RNG seed (https://boardgamearena.com/bug?id=134924)
Posted: 27 August 2024, 13:45
by Kayvon
horos22 wrote: ↑27 August 2024, 06:39You could for example implement a true rewind system using it.
That's a cool idea, but a completely different one. Seeding the RNG doesn't provide infinite undo. Providing a seed for Gaia Project was a lot of work, but only a fraction of what "true rewind" would take. Unfortunately, you're vastly underestimating the work required here.
You said only really good way of showing how cool this would be would be by prototyping it. I've prototyped the original idea and while it's cool; it's not so groundbreaking that people are clamoring to gst it. Even you, the most excited of everyone, are mostly interesed in seeing it in your own game, not in trying it out in a different game to see how it is.
If you're willing to put in the effort, you'll need to contact the developer and be added to the project. If you're already fluent in the coding languages, set aside twenty hours to implement just the basic idea.