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

F5 to reload chart in training mode #449

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

marseille
Copy link
Contributor

Figured I might toss this out there, just in case you guys find it helpful. It's been useful to me, so I figured what the heck, might be useful to other people. If it's not inline with your objectives, roadmap, or just plain undesirable go ahead and decline without a second-thought.

Dunno if there's been a better way of chart editing...but for me it involves this loop - every time. looking at training mode, pasting to snack tja studio, looking+matching+changing, pasting back to .tja, exiting to music select, selecting song, fast-forwarding to the changed-measure...and then finally inspecting my change.

So I've mapped F5 to reload the chart whilst in training mode. It's only active in training mode, and you have to be paused. It doesn't interfere with the F5 bga format in "regular mode".

On F5, the changes happen immediately, keeping the same measure on screen. Cuts out a lot of steps as I can simply keep my position (measure) in my text editor, and F5 in training mode without losing my place. And the file is all ready for play when I disable training-mode

Looked around quite hard to ensure things were cleaned up properly, and I wasn't causing memory leaks. This is the best I came up with.

The music select song-title/artist doesn't update, but that's always been like that.

Cheers

@0auBSQ
Copy link
Owner

0auBSQ commented Mar 3, 2023

Hello, thank you for your proposition, did you tested how it behaves in the following cases ?

  • The tja file getting deleted before the F5 press
  • The chart being shorter than the current measure before the F5 press
    I will consider merging it if it does not crash on the 2 aboves cases (ideally for the first one, going back to the song select menu would be a very good method)

@marseille
Copy link
Contributor Author

Hey there,

I got the chance to try this and it fails #1. I tried to play around with saved/previous state, but the CWAV and such is not exposed to the CAct演奏Drums特訓モード.cs file --- so I couldn't get that to work quickly. Returning to song select is a fantastic way, but it goes beyond my understanding of the stage lifecycle, and likely more involved than I'm looking to get.

I think I'll try looking at how the escape key is used and/or the menu options....but I don't think I'll get very far. I may just keep it for my unique purposes and use-case. In that case, I appreciate your consideration and thank you for your feedback.

Out of curiosity, I did try #2, and it works from what I can see, very well. If you are paused in a far off measure that doesn't exist anymore, reload, and then unpause --- the game sends you back to measure zero. You are also able to navigate back to measures that still exist (and forward again). The only potential weird behavior is still being able to navigate the lost measures (the total measure remains the same as before). But nothing crashes or breaks, from what I can see acts weird.

I'll try seeing what I can find, but I may just have to #1 as can't fix, I'll let you know.

@0auBSQ
Copy link
Owner

0auBSQ commented Mar 5, 2023

Hello,

Alright ! Please let me know.
I am pretty open about the implementation choices for the 1st point, but I do not want it to crash as it would be problematic in terms of program stability.

@marseille
Copy link
Contributor Author

I was actually able to get a working solution for this -- I'm going to put together a cleaned up commit and push the changes up here in a bit.

I did notice one thing with #2. The song will correctly play, the chart will correctly scroll display, and the measure counter will increase correctly --- but when starting the song in a nonexistent measure; the measure counter remains at zero and does not increase. It will still correctly reset to measure 0, and play the song and chart as expected though.

I think this is a fairly innocuous detail, given the otherwise-would-be-broken scenario of a missing .tja. And if the .tja is restored, it can still be reloaded correctly in the same training-mode session.

@marseille
Copy link
Contributor Author

I've pushed the changes for nonexistent tja behavior --- this works quite well. It returns to music select on F5, and if you try to select the song, it simply flashes and does nothing. If you then undo the delete --- it works as normally, like nothing happened.

However, I feel like the measure counter mismatch issue is a bigger inconvenience than previously thought. Keeping the total measures updated feels more important now. I tried having a go at updating it but I didn't get very far at all. I'm not sure I would merge it into the main codebase. Nothing breaks, nothing crashes, nothing inhibits any interaction with the game, the measures rewind and play fine --- but I'll explain why I feel this way.

If I'm editing a chart, -- let's say 24 measures -- I may decide I want to delete one measure entirely. There's now 23 total measures, but the display will remain at 48. Maybe a not huge issue....but what if I decided I didn't like the last half of the chart? Now there are a total of 24 measures and a display of 48 (or....would it be 23 total measures, since the display didn't update to 47?)

Now as I rebuild the second half of the chart, I'm adding measures 24,25, and 26 -- the display still is showing 48 measures.

In another (likely) scenario, you're building a chart iteratively. Adding a new measure and testing it. You load up training mode, maybe it's empty. Every time you add a measure and reload, the total measures will display 0. Sure, the current measure will always be up to date and correct, but you'll be looking at 3/0 , 4/0 , 5/0 the whole time.

It just doesn't feel polished enough for other people to use, you know? Until the live update of total-measures is fixed, I don't think I would include it. I tried looking at the graphics, the finalbar//startbar, and chiplist; but this was beyond me. I doubt I'll be able to figure that out.

The DNE logic for protecting against tja deletion could definitely be incorporated somehow though. That's solid, so if you wanted to leverage that somehow for another purpose or section of the game; go right ahead.

@0auBSQ
Copy link
Owner

0auBSQ commented Mar 19, 2023

Hello,

Thank you for your update, it is definitively an interesting feature for charting, so I will keep this PR open and will check more in depth when I will have more time for the measure issue too, though as long as it is possible to check the measures newly created it is not a big issue in my opinion

@marseille
Copy link
Contributor Author

I actually just made use of this yesterday, and not losing my place (exiting, selecting, scrolling to target measure) was quite the
time-saver. Hitting F5 without losing that context was, kind of amazing.

I'm open and accept any direction you have for this PR. Whether you want to merge it, keep it open, modify the branch, or close it --- It's all yours :) Just note that I won't be committing any more resources to fixing that measure issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants