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

Provide a mechanism for learning the current seed #359

Closed
byorgey opened this issue Jun 4, 2022 · 8 comments · Fixed by #633
Closed

Provide a mechanism for learning the current seed #359

byorgey opened this issue Jun 4, 2022 · 8 comments · Fixed by #633
Labels
C-Low Hanging Fruit Ideal issue for new contributors. G-Scenarios An issue having to do with scenario design, the way scenarios are described and loaded, etc. S-Moderate The fix or feature would substantially improve user experience. T-UI Involves the user interface. Z-Feature A new feature to be added to the game. Z-User Experience This issue seeks to make the game more enjoyable to play.

Comments

@byorgey
Copy link
Member

byorgey commented Jun 4, 2022

Currently, if you start a game with a randomly chosen seed, there is no way to find out what seed was used, which means that there is no way to play the same world again later, or tell a friend the seed so they can play the same super-cool world you discovered, etc. There should be some mechanism for displaying the chosen seed to the player. Perhaps it could simply be displayed somewhere in the UI, or perhaps there should be some kind of key command for showing the seed. I don't think there should be a robot command for returning the seed, since it seems to be mixing levels in a strange way: the seed used is a meta-aspect at the level of the game, but it is not something robots would ever be able to learn from within the world.

@byorgey byorgey added Z-User Experience This issue seeks to make the game more enjoyable to play. Z-Feature A new feature to be added to the game. C-Low Hanging Fruit Ideal issue for new contributors. S-Moderate The fix or feature would substantially improve user experience. T-UI Involves the user interface. G-Scenarios An issue having to do with scenario design, the way scenarios are described and loaded, etc. labels Jun 4, 2022
@xsebek
Copy link
Member

xsebek commented Jun 4, 2022

Well we do have a command-line flag --seed, but I just tested it and it seems to be ignored 😅

If it was supported, then one could do:

seed=$RANDOM
cabal run swarm:swarm -- --seed $seed; echo $seed
cabal run swarm:swarm -- --seed $seed; echo $seed

The generated world should be the same.

@byorgey
Copy link
Member Author

byorgey commented Jun 4, 2022

What do you mean it is ignored? It works for me...

Anyway, this is not really sufficient, because it is possible to start the app, then select classic mode from the "New game" menu. At that point a random seed is chosen for you. You should be able to find out what it is.

@xsebek
Copy link
Member

xsebek commented Jun 4, 2022

random seed is chosen for you

I do not understand - what is the point of the flag if not to override this?

Running first with seed 0:
image

Second time:
image

@byorgey
Copy link
Member Author

byorgey commented Jun 4, 2022

Ah, I see, if you specify only a seed, it has no effect. Choosing a scenario from the menu will use the seed specified by the scenario (or choose a random seed). If you want to specify a seed on the command line you have to also specify a scenario, like cabal run swarm:swarm -- --seed 0 --scenario 00-classic.

I suppose we could change it so starting it with only the --seed flag will cause it to remember that seed and apply it to whatever scenario is chosen from the menu. But this is a bit strange, actually --- if you then quit back to the menu and select a different scenario, should it continue to use the same seed specified on the command line?

I see a couple options:

  • Make it an error to use only the --seed flag, and have it print an error message advising you to also use the --scenario flag.
  • Just make classic mode the default scenario, so if you use the --seed flag without also specifying a --scenario it will immediately start classic mode instead of showing you the menu.

I am leaning towards the second option. This is actually very similar to #363.

@xsebek
Copy link
Member

xsebek commented Jun 4, 2022

I would be fine with the first option too (except for writing 00-) 🙂

But given #363 I am voting for a default classic 👍

@byorgey
Copy link
Member Author

byorgey commented Jun 4, 2022

Yeah, I don't like the 00- part either. That is there so that we can specify the order of scenarios in the menu. But maybe we need a better way to do that, and/or automatically allow leaving that part off.

@xsebek
Copy link
Member

xsebek commented Jun 4, 2022

Well sorry for distracting from seed in the game UI twice 😅

My two cents would be to add F2 window showing the configuration and allowing edits.
We could also use it for game speed, showing game save location and maybe debugging stuff (cells, active robots).

@byorgey
Copy link
Member Author

byorgey commented Jun 4, 2022

Hah, no worries. F2 screen sounds like a good idea to me.

mergify bot pushed a commit that referenced this issue Jun 6, 2022
…#364)

Closes #363.  Also addresses the issue discussed in #359 .
@mergify mergify bot closed this as completed in #633 Aug 11, 2022
mergify bot pushed a commit that referenced this issue Aug 11, 2022
Improve the Help (F1) modal dialog.

- Get rid of the list of commands; they are now available in Commands modal
- Improve formatting of keybindings list, and add more global keybindings to the list
- Add some text with pointers to the wiki and IRC
- Display current seed (closes #359)
- Display current web API port
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-Low Hanging Fruit Ideal issue for new contributors. G-Scenarios An issue having to do with scenario design, the way scenarios are described and loaded, etc. S-Moderate The fix or feature would substantially improve user experience. T-UI Involves the user interface. Z-Feature A new feature to be added to the game. Z-User Experience This issue seeks to make the game more enjoyable to play.
Projects
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants