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
Story mode timers #3258
Story mode timers #3258
Conversation
Update fork
Update StoryModeStatus
Main menu screen : timer launch when selecting story mode Race results : stopping timer when finishing the game Race GUIs : displaying the casual story timer Options UI : support the new options
Update fork
It's the same file, but now GitHub is happy and don't see pink elephants anymore... I mean merge conflicts.
Merge clang warning fixes
As discussed on IRC : |
While the speedrun timer is meant only for players which would be interested in completing the story mode quickly ; a lot of work (and indeed, a substantial part of the line/file changes) has gone to also give a more casual story mode timer, which can be saved and resumed over several sessions, as detailed in the presentation message. Enabled by default (so that the player is aware of the options), it is meant to be useful to a larger audience, without being too intrusive (it is only displayed in the overworld and in challenge races, and I could have it displayed only in the overworld or in some other place if preferred). To support my point about the usefulness of a general timer for the story mode, I don't think it annoy many pokemon players that the game stores and display in profile the game time since start. Granted, it's not the same kind of game, but it's certainly less a game about speed than STK, so if it can make sense there, it certainly can here too. Then, also take into account that while the speedrun part may not be useful to a lot of players, it will be useful for dedicated players, who do publicity for the game, help to improve the game by finding exploits, balance issues, etc. Surely, adding one checkbox in the UI options is not that big of a deal. |
I am happy to support speed-runner with a special command line option or so, but I don't see any reason to add a second timer, so could this be removed. |
The use of two timers is a conscious design choice :
If there is some subelement of the timers which could be shared between them without harming the computation, why not ; but really, two standalone counters trumps in simplicity one dual-purpose timer which would have to do a lot of checks to guarantee integrity. (Of course, I could also just dump the normal story mode timer, but considering that a)it has the potential to be useful for numerous players ; b)implementing it with correct saving and loading was a pain (I had the speedrun timer quite ready much sooner) ; I feel it would be a waste) EDIT : As for the get() functions, I'll take a look. |
I had a look at the get function return value. I can detect quite easily if the node doesn't exist, but it's only worthwhile if this profile had not started the story mode (otherwise, the speedrun values are invalidated, and the normal story timer values will be wrong). So, considering that the next version will use a different profile folder anyway, I'm not sure if extra code to handle this case more nicely is worth it (would basically only be for current git users). |
To summarise auria and my comments: am happy to accept a patch for a speedrun timer, which can be activated via command line, but I really do not want to to overload our gui with even more options (and esp. I don't like the non-speed-run timer). So I am closing this pull request, but encourage you to extract the speed-run timer and a command line option. Thanks a lot! |
Hmm, I actually rather liked the idea of having a not-so-strict timer for Story Mode. Most users would probably like a timer but would likely find the speedrun timer frustrating, since relaunching resets it completely. Since the UI settings page is mostly empty, is having one spinner or checkbox that big of a deal? |
OK, I'll have a look at the pull request again. It seems very invasive, but am happy to re-evaluate. |
I'll update the code after the beta. The options need to be adapted to the current options menu, and there are some other things I have to check (there are some issues when profile-switching iirc). |
Some suggestions/brain-storming ideas ... feedback welcome:
|
The reason for this choice is simple : the story mode timer is meant to count only the time spent inside story mode until beating Nolok for the 1st time ; this includes a pausing whenever leaving the story mode. The speedrun timer keeps running if the player goes back to the main menu or in another mode ("pausing" and "speedrun" don't go well together). My first attempts used a single timer, but I soon discovered that the conflicting rules created a headdache whenever the options selecting the timer to use was switched (the time of the previous timer was not valid for the new timer). With two timers, the options only control the display and there is no breaking of the underlying value when switching.
The code I used at the beginning was done with chrono, and it worked very well so I never changed it and had not a special look at STK's own functions to handle this. When I will update the PR, I will have a look at it and see if it makes any difference. If it doesn't, I will convert the code to use STK's own functions.
Such a timer of total time "played" (really with the game open because of idling as you point out) could indeed be interesting, but it's not quite the same. "You have played 43 hours" and "You finished the story mode in 2h38m" don't replace one another in my opinion. One is just about leaving the executable running, the other is more a kind of achievement. |
Even if we use a 'time played' timer, we can add an additional message (and perhaps even store it in the player profile) when the story mode was finished (we can even print it everytime the final challenge is done ... it will only increase the time, who cares :) ). That would give us everything, one timer, and easy to install timer start/end calls. |
There are several code incompatibilities here (as the files which this PR change were edited since), in addition to some functional issues. I've made a rebased branch which also fix the issues, I'll open a new PR in time. |
This PR fixes #2907
Some details on the implementation (I will add an illustrating video later) :
KNOWN LIMITATIONS :
The new nodes it tries to read don't exist on old player profiles saved before, so it will have junk data when loading them (and the subsquent saves, while creating the nodes, will contain the invalid data so will keep being worthless). Considering that there is already a profile breaking change in master compared to 0.9.3 ; I don't consider this a huge issue, but it reinforces the need of using a separate config profile folder for the next release (on that topic, I also think that git versions should not use the same profile folder than stable releases).Not an issue anymore as the next release will have a different profile folder.