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

Give a chance of another try if game is unable to find a valid starting location #55025

Merged
merged 3 commits into from
Feb 3, 2022
Merged

Give a chance of another try if game is unable to find a valid starting location #55025

merged 3 commits into from
Feb 3, 2022

Conversation

Night-Pryanik
Copy link
Contributor

Summary

Features "Give a chance of another try if game is unable to find a valid starting location."

Purpose of change

Describe the solution

On unsuccessful attempt of finding a valid starting location, query player if he wants to give it another try. On positive answer reset the world and make another attempt of finding a valid starting location.

Describe alternatives you've considered

None.

Testing

Reduced chance to spawn for one of locations so it has a fairly high chance of fail to find a suitable location, made several attempts of starting a game. Answered both yes and no to the query, checked that game correctly resets world and tries to find valid starting location once more.

Additional context

изображение

As I said earlier, this PR doesn't fix the issue because player could adjust settings of the world (in particular, sizes of cities) so game won't ever find a valid starting location. Player might not even know that selected location has conditions/constraints to spawn as they are hidden in jsons and ain't shown to the player in game. I think we need to track down these cases and at least notify player that his starting location won't ever spawn on his current world settings.

@Night-Pryanik Night-Pryanik added [C++] Changes (can be) made in C++. Previously named `Code` Character / World Generation Issues and enhancements concerning stages of creating a character or a world Quality of Life QoL: degree to which players are comfortable, and able to enjoy CDDA labels Feb 2, 2022
@github-actions github-actions bot added json-styled JSON lint passed, label assigned by github actions astyled astyled PR, label is assigned by github actions labels Feb 2, 2022
Co-authored-by: NetSysFire <[email protected]>
@NetSysFire
Copy link
Member

This change looks good overall but there might be a disaster waiting to happen because it is that trivial to accidentally reset the world. Perhaps check if there is more than one save in the world and make the warning a bit bolder?

"This will delete all savegames! Are you sure?"

@github-actions
Copy link
Contributor

github-actions bot commented Feb 2, 2022

Spell checker encountered unrecognized words in the in-game text added in this pull request. See below for details.

Click to expand
  • Try again? Warning: all savegames in current world will be deleted!\n\nIt may require several attempts until the game finds a valid starting location.

This alert is automatically generated. You can simply disregard if this is inaccurate, or (optionally) you can also add the new words to tools/spell_checker/dictionary.txt so they will not trigger an alert next time.

@Night-Pryanik
Copy link
Contributor Author

Night-Pryanik commented Feb 2, 2022

I don't know, I think it's equally easy to accidentally reset the world even if there would be a "ARE YOU SURE?" type of warning.

After all, ideally this query should appear on very rare occasion, not on everyday basis, so I think it would catch player's attention.

@Zireael07
Copy link
Contributor

Player might not even know that selected location has conditions/constraints to spawn as they are hidden in jsons and ain't shown to the player in game. I think we need to track down these cases and at least notify player that his starting location won't ever spawn on his current world settings.

Is there a way for devs to detect it programmatically or would it need to be audited by hand like the start difficulty entry?

@Night-Pryanik
Copy link
Contributor Author

Is there a way for devs to detect it programmatically

Sure. For example, check for city_sizes and city_distance fields in json definitions of OM specials.

@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label Feb 2, 2022
@kevingranade kevingranade merged commit f948178 into CleverRaven:master Feb 3, 2022
@Night-Pryanik Night-Pryanik deleted the try-again-if-unable-to-find-starting-location branch February 4, 2022 05:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions [C++] Changes (can be) made in C++. Previously named `Code` Character / World Generation Issues and enhancements concerning stages of creating a character or a world json-styled JSON lint passed, label assigned by github actions Quality of Life QoL: degree to which players are comfortable, and able to enjoy CDDA
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants