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

Add "go to previous level" key to replay viewer #55

Closed
tmewett opened this issue Feb 17, 2020 · 5 comments · Fixed by #166
Closed

Add "go to previous level" key to replay viewer #55

tmewett opened this issue Feb 17, 2020 · 5 comments · Fixed by #166
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@tmewett
Copy link
Owner

tmewett commented Feb 17, 2020

There is a "go to next level," so I feel there should be a go to previous, which goes back to the start of the previous depth. This would have to be implemented like any rewinding operation currently, i.e. with a confirm prompt and by going to the start and fast-forwarding.

@tmewett tmewett added enhancement New feature or request good first issue Good for newcomers labels Feb 17, 2020
@kz-dev
Copy link
Contributor

kz-dev commented May 4, 2020

I will start to check this issue !

So I found AdvanceToLocation who take a turn. So we could store all first turn of each level and used them when we press "<" with a confirm prompt.

What do you think about this technique ?

@tmewett
Copy link
Owner Author

tmewett commented May 5, 2020

I think storage of first turns on each level may not be necessary. How does the implementation of go to next level ('>') work? I think we might be able to define '<' as something like

  1. save (current depth - 1) to N
  2. rewind to start of recording
  3. do '>' max{0, N-1} times

@kz-dev
Copy link
Contributor

kz-dev commented May 10, 2020

">" implementation is just a "while" until we are to the next level (with some option to fastforwarding) :

pauseState = rogue.playbackPaused; previousDeepestLevel = rogue.deepestLevel; if (!rogue.playbackPaused || unpause()) { if ((unsigned long) rogue.deepestLevel < maxLevelChanges) { displayCenteredAlert(" Loading... "); commitDraws(); rogue.playbackFastForward = true; while ((rogue.deepestLevel <= previousDeepestLevel || !rogue.playbackBetweenTurns) && !rogue.gameHasEnded) { rogue.RNG = RNG_COSMETIC; // dancing terrain colors can't influence recordings nextBrogueEvent(&theEvent, false, true, false); rogue.RNG = RNG_SUBSTANTIVE; executeEvent(&theEvent); } rogue.playbackFastForward = false; rogue.playbackPaused = pauseState; displayLevel(); refreshSideBar(-1, -1, false); updateMessageDisplay(); } else { flashTemporaryAlert(" Already reached deepest depth explored ", 1000); } } rogue.playbackPaused = pauseState;

And the function

void advanceToLocation(unsigned long destinationFrame) {
allow us to go at a turn number.

Can we standardize "<" and ">" function with this function (advanceToLocation) ?

  • We just need to store an array with the turn number of each start level when we read the recording file (parseFile)
  • When < or > press key : Navigate in the array with advanceToLocation

It's just an idea, else I can implement your previous suggestion.

@tmewett
Copy link
Owner Author

tmewett commented May 11, 2020

When the target location is in the past, advanceToLocation works in a similar way: by rewinding to the start and fast-forwarding. Because of this, storing any data is unnecessary - instead of fast-forwarding until we hit a certain turn number (advanceToLocation), we just fast-forward until we get to a certain depth. Does that make sense?

@kz-dev
Copy link
Contributor

kz-dev commented May 13, 2020

Yes, my reflexion was a bit stupid... I will propose you something !

zenzombie added a commit to zenzombie/BrogueCE that referenced this issue Oct 27, 2020
zenzombie added a commit to zenzombie/BrogueCE that referenced this issue Oct 27, 2020
@tmewett tmewett linked a pull request Nov 13, 2020 that will close this issue
zenzombie added a commit to zenzombie/BrogueCE that referenced this issue Nov 13, 2020
zenzombie added a commit to zenzombie/BrogueCE that referenced this issue Nov 15, 2020
zenzombie added a commit to zenzombie/BrogueCE that referenced this issue Nov 29, 2020
tmewett added a commit that referenced this issue Nov 29, 2020
Closes: #55
Co-authored-by: Tom M <tom@collider.in>
@tmewett tmewett closed this as completed Nov 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants