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

Allow player to choose a specific seed through the UI #358

Closed
byorgey opened this issue Jun 4, 2022 · 5 comments · Fixed by #1010
Closed

Allow player to choose a specific seed through the UI #358

byorgey opened this issue Jun 4, 2022 · 5 comments · Fixed by #1010
Assignees
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, a specific seed can be chosen on the command line, e.g.

stack run -- -c 00-classic -s 0

But if you choose e.g. classic mode via the "New Game" menu, you get a random seed with no way to override it. There should be some (optional) mechanism by which the user can specify a seed if they wish (e.g. for "set seed"-style speedruns, to play the same world as their friend, etc.).

@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

How about showing the seed in grey somewhere and hinting at the R key to regenerate it? 🙂

@byorgey
Copy link
Member Author

byorgey commented Jun 5, 2022

Showing the seed in grey somewhere sounds fine for #359 . But I don't see how having an R key helps here. By "regenerate" do you mean "choose a different random seed value"? I want to allow the user to specify the seed, not just cause it to be re-chosen randomly. And if by "regenerate" you mean e.g. "pop up a dialog asking the user to set the seed", it seems strange to have to start a new game with a random seed, then hit R to be able to set the seed yourself. You should just be able to set it before starting the game.

@byorgey
Copy link
Member Author

byorgey commented Aug 9, 2022

How about this: when starting a game with no seed and no default cell specified, we first pop up a dialog asking the user to enter a seed, or to leave the field blank for a random one. This would mean slightly more keypresses to get a basic game started, but I don't think it would be too irritating, and it would be very obvious to anyone who wanted to play with a specific seed how they can do that.

@xsebek
Copy link
Member

xsebek commented Oct 10, 2022

As an alternative, we could always provide a default and then specify if it is possible* to override the seed.

Then when you press E we would bring up a form to edit the scenario parameters (#558) but for now, that would only be the seed. Brick ships with functions to create forms (Brick.Forms) that we could use. Later we could add other parameters, like likelihood of resources in the world function, etc.

*) The --cheat flag would of course ignore that restriction. In speedruns some seeds are more plentiful and we do not want to allow setting a custom one.

@kostmo kostmo self-assigned this Jan 14, 2023
@kostmo
Copy link
Member

kostmo commented Jan 14, 2023

Created a related issue about specifying from the command line: #1006

kostmo added a commit that referenced this issue Jan 15, 2023
kostmo added a commit that referenced this issue Jan 17, 2023
kostmo added a commit that referenced this issue Jan 19, 2023
kostmo added a commit that referenced this issue Feb 1, 2023
kostmo added a commit that referenced this issue Feb 4, 2023
kostmo added a commit that referenced this issue Feb 19, 2023
kostmo added a commit that referenced this issue Feb 22, 2023
kostmo added a commit that referenced this issue Feb 25, 2023
kostmo added a commit that referenced this issue May 2, 2023
kostmo added a commit that referenced this issue May 2, 2023
kostmo added a commit that referenced this issue May 4, 2023
kostmo added a commit that referenced this issue May 4, 2023
kostmo added a commit that referenced this issue May 4, 2023
kostmo added a commit that referenced this issue May 5, 2023
kostmo added a commit that referenced this issue May 5, 2023
kostmo added a commit that referenced this issue May 5, 2023
kostmo added a commit that referenced this issue May 5, 2023
kostmo added a commit that referenced this issue May 6, 2023
kostmo added a commit that referenced this issue May 6, 2023
kostmo added a commit that referenced this issue Jun 4, 2023
kostmo added a commit that referenced this issue Jun 5, 2023
kostmo added a commit that referenced this issue Jun 5, 2023
kostmo added a commit that referenced this issue Jun 6, 2023
kostmo added a commit that referenced this issue Jun 6, 2023
kostmo added a commit that referenced this issue Jun 6, 2023
kostmo added a commit that referenced this issue Jun 6, 2023
kostmo added a commit that referenced this issue Jun 6, 2023
kostmo added a commit that referenced this issue Jun 8, 2023
kostmo added a commit that referenced this issue Jun 8, 2023
kostmo added a commit that referenced this issue Jun 9, 2023
kostmo added a commit that referenced this issue Jun 9, 2023
@mergify mergify bot closed this as completed in #1010 Jun 9, 2023
mergify bot pushed a commit that referenced this issue Jun 9, 2023
Closes #358 and closes #866.

Allows specification of a seed value and/or the path of a script to run.  Specifying a script to run in advance allows eligibility for code size scoring.

Some effort was invested into integrating the Brick `FileBrowser` widget and discovering its idiosyncrasies.  This paves the way for more applications of `FileBrowser` within Swarm.

## Usage

From the scenario selection menu, press the `o` key to pop up a dialog for launch options.

![Screenshot from 2023-06-06 01-38-25](https://github.com/swarm-game/swarm/assets/261693/e306f2ce-db30-4906-9b02-db8e44bc5e99)

Any manually-selected initial-script or seed are persisted to disk and will pre-populate the launch configuration dialog upon the next play.  If a certain scenario is subsequently launched the normal way (i.e. by pressing `Enter` instead of `o`), then this clears the saved script path/seed, and the next pop-up of the launch configuration dialog will not see its fields pre-populated.

## Warning: Save format changed

This PR changes the `ScenarioStatus` datatype, and therefore game status/progress saved previously to this PR will not be recognized.  See #974 (comment) for discussion about this situation.
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
None yet
Development

Successfully merging a pull request may close this issue.

3 participants