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

Added option to randomize INITIAL_DAY #38110

Merged
merged 12 commits into from
Apr 2, 2020

Conversation

ashGlaw
Copy link
Contributor

@ashGlaw ashGlaw commented Feb 17, 2020

Summary

SUMMARY: Features "Added option to randomize INITIAL_DAY"

Purpose of change

I've been told by a number of people that when they create their worlds they find a random number generator online and pick a random start date. It wouldn't be hard to add that to the options and save them some time.

Describe the solution

Setting the INITIAL_DAY option to -1 has been assigned to choose a random start date. The range of options is equal to 4x the SEASON_LENGTH, minus 1.

Describe alternatives you've considered

Instead of setting the random value to -1 a new boolean option could be created, and when set to true would grey out the INITIAL_DAY options.

Could pull the season length earlier to avoid having to retrieve it twice

Testing

Compiled and ran the game with a new world. Set the INITIAL_DAY to -1. Started on day 69 of summer. Tried again and got Day 38 in winter. No errors reported.

Additional context

I'm open to changing how this is done if it would help

@Funguss
Copy link
Contributor

Funguss commented Feb 17, 2020

YESSSSS! I was just thinking the other day how in so many games with an element of farming or some kind of survival aspect you always start at the beginning of spring. This is going to make it feel a lot more immersive, thank you!

@ashGlaw ashGlaw marked this pull request as ready for review February 17, 2020 22:31
@ashGlaw
Copy link
Contributor Author

ashGlaw commented Feb 18, 2020

Looks like the Travis build has an issue, but I don't know how to parse what it's trying to tell me. I'd love to fix it, though

src/game.cpp Outdated Show resolved Hide resolved
@ashGlaw ashGlaw changed the title [WIP] Added option to randomize INITIAL_DAY Added option to randomize INITIAL_DAY Feb 19, 2020
@jkraybill
Copy link
Contributor

As a full-random player, thanks!! Will add more variability to starting scenarios. Being able to set range of the randomizer, and/or allowing scenarios to do the same, would be a great future addition. Having current scenario starts non-dynamic is an obstacle to json-based scenario expansions.

src/options.cpp Outdated Show resolved Hide resolved
@ZhilkinSerg ZhilkinSerg added 0.E Feature Freeze <Enhancement / Feature> New features, or enhancements on existing [C++] Changes (can be) made in C++. Previously named `Code` Time / Turns / Duration / Date Issues concerning any activities being too fast or too slow. Also issues about time and date ingame labels Feb 22, 2020
@ZhilkinSerg
Copy link
Contributor

I would prefer a new Boolean option instead, but it is up to @kevingranade to decide for new options.

@ashGlaw
Copy link
Contributor Author

ashGlaw commented Feb 22, 2020

Thanks for the tags. Is that something you need special privileges to do? I haven't run across the option to tag my PRs

@ashGlaw
Copy link
Contributor Author

ashGlaw commented Feb 22, 2020

I would prefer a new Boolean option instead, but it is up to @kevingranade to decide for new options.

Thanks for the at.
I could probably do a Boolean option, if that's how it's preferred, but this seemed simple and elegant and required fewer changes.

@kevingranade kevingranade merged commit 527688b into CleverRaven:master Apr 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[C++] Changes (can be) made in C++. Previously named `Code` <Enhancement / Feature> New features, or enhancements on existing Time / Turns / Duration / Date Issues concerning any activities being too fast or too slow. Also issues about time and date ingame
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants