-
Notifications
You must be signed in to change notification settings - Fork 25
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
(On Hold) [melody] non-casting state between songs #81
Conversation
The changes look reasonable (and allowing manual insta-click in the 150 ms timing window until the next song would be hard to claim is automating things). I don't entirely understand the timing updates of the ActorInfo->CastingSpellId and whether stop_current_cast() is going to get repetitively called until that transitions (maybe harmless). Executing the stop_current_cast() immediately after the start of cast didn't appear to cause any issues (not sure if there could be a race condition, but if we see one, we could just push that stop cast at some fixed few 100 msec after the start_of_cast_timestamp). I went through the test cases at the top of the melody.cpp, and those all worked fine along with some limited weaving / kiting to confirm general functionality. I didn't see any new issues. The timing vulnerability of clicking on a spell gem at the end of a melody cast is still there. |
Tonight I can play around with some debug logging around stop_current_cast() to confirm. I believe it was not being repetitively called, which makes me believe the client immediately updates ActorInfo->CastingSpellId locally. But it's worth being 100% sure and defensive against making the client not do unecessary/unusual behavior, even if it seems harmless. |
One item I did notice after my comments above is that if I was early with a macro set to "/useitem 16" to trigger a SS BP invigorate, it would abort the current melody cast (current_index) and then skip it without performing the Invigorate cast. The melody would just advance to the next song. If I timed it well and did /useitem in that gap, invigorate did cast and the melody resumed after w/out obviously skipping anything. I didn't test an insta-click like journeyman's boots. |
Ah I didn't test anything with /useitem, just via direct hotkeys or clicks. I'll see if maybe /useitem needs some defensive logic to do nothing if you are already casting something, maybe it's something strange on the /useitem side that is acting oddly with melody. I assume the behavior we'd want is that nothing happens if /useitem is pressed at the wrong time. |
What would be the impact of allowing useitem in the melody itself (if even
possible)? Can anyone see any negatives or possible exploits if this was
allowed? Is it too much of an automation?
The positives are obvious, I’d think.
…On Mon, Sep 2, 2024 at 7:52 PM Cord B. ***@***.***> wrote:
Ah I didn't test anything with /useitem, just via direct hotkeys or
clicks. I'll see if maybe /useitem needs some defensive logic to do nothing
if you are already casting something, maybe it's something strange on the
/useitem side that is acting oddly with melody. I assume the behavior we'd
want is that nothing happens if /useitem is pressed at the wrong time.
—
Reply to this email directly, view it on GitHub
<#81 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/A6UYBWCTDGDJJKMCLVUB2JDZUUB3RAVCNFSM6AAAAABNPCNETKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMRVGQZDIMZUHA>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
i was going to suggest extending melody so you could do /melody 129 1 2 3 5 where 1** is the /useitem |
This was raised as a suggestion by Moliere in zeal-suggestions on Discord and received a negative reaction. If you want to revive that thread and get it approved by the powers that be, it could be a future enhancement PR, but I don't think it is needed for this PR (which is clearly not automating anything). If this PR can make /useitem simply not abort/skip if used too early, then it will at least allow some precise timing use of /useitem without having to stop/start melody. |
Agreed, Sherra. My query was more a thought experiment for those who are
developing this to see if pursuing an approval would even be worth it. I
tend to be very cautious about anything that could be used to automate any
class outside of nice to have QOL issues, and am extremely cautious about
bards even though I main one.
If this PR goes in, it would be welcome of course, but the question then is
what is the fallout if we just allowed melody to useitem?
…On Wed, Sep 4, 2024 at 9:56 AM SherraBard ***@***.***> wrote:
This was raised as a suggestion by Moliere in zeal-suggestions on Discord
and received a negative reaction. If you want to revive that thread and get
it approved by the powers that be, it could be a future enhancement PR, but
I don't think it is needed for this PR (which is clearly not automating
anything).
If this PR can make /useitem simply not abort/skip if used too early, then
it will at least allow some precise timing use of /useitem without having
to stop/start melody.
—
Reply to this email directly, view it on GitHub
<#81 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/A6UYBWFIFWZHQOH5BB6TYY3ZU4NSTAVCNFSM6AAAAABNPCNETKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMRZGI4TGMRWHE>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Added the /useitem fixes in a separate PR, since those are a standalone improvement: |
So the only potential behavior change I noticed is that in a laggy zone (just EC basically), sometimes the earlier invocation of stop_current_cast() will cause the spell to not fire upon completion about 10% of the time. The only workaround would be to delay the stop_current_cast(), and introduce an extra forced ~100ms gap between stop_current_cast() and cast(), but that might end up slowing down the overall speed of Melody if the time between songs gets longer. A middle ground would be to put this behavior behind an option/flag, and players can choose to have the song-gap included, with either the small risk of misfires in EC or with a slightly longer pause between songs. Or maybe they can just specify the song gap length via config, etc. I think this is the main thing that needs to be figured out before deciding on these changes. |
There is the existing forced delay of 150 ms from when the casting window drops until the next song is started. I think Salty picked that empirically. What if you delayed the stop casting call until the casting visible window drops? Just add a (current_timestamp > casting_visible_timestamp) check along with the "is casting" ones before calling stop_current_cast(). That might eliminate 99% of the 150 msec casting dead time you want to open up for a manual clicky while ensuring completion of melody step. |
The code section calling stop_current_cast() is already after |
Yeah, you are right that it is after the visible check. It's been a while since I touched that. I agree that it is likely a client / server sync issue. I don't know if there is another server -> client message that confirms the song fired (completed) server side. Or alternatively if there was a confirmation from the server that the cast had started, which could then be used for the 3 sec offset to do the stop. These are Salty questions. |
AFAIK the The safe way is to wait for the confirmation, but we end up back in the original boat of stopcast/startcast basically happening at the same time and the gap being effectively too small. Would defer to Salty if this is still worth pursuing. If we want to allow users to add an optional/additional gap via config, I could try that, or something. |
I chatted with Salty, and there wasn't a clear way to sync things better to know when to execute the stop cast. The current 150 ms delay works 99.9% of the time. Increasing the delay between songs to add some additional non-singing gap would make a lot of Bards grumpy, as even now a 4 song rotation can drop a buff with unlucky timing. cord-b, can you try out this and see if it is an acceptable alternative to weave in clickies? It does require dedicated macros for each clicky inventory slot. And then you should be able to hit (1) whenever you want to use the clicky and (2) after to restart the melody. Another alternative might be adding melody pause / resume commands and a macro like below, but I'm not sure it's worth it: or could add a /melody extra_delay value, but that's also making things complicated. At the very least I think this PR has some cleanups of the stop_current_cast that could be worthwhile even if the stop_cast timing is reverted. |
Yeah I could split the PRs into (1) Improving the helper functions to be more spell/song tolerant against skipping ahead/backwards, especially if additional changes are to be added. (2) It sounds fine by Salty/Secrets, as an acceptable alternative due to the technical limitations, we let the /useitem, if used during a melody, would pause the melody, use the item, and resume the melody at the current song. Then players could just press that near the start of the song for the same effect as if there was a manual gap. An alternative to (2) would be a dedicated Effectivelly I think it's the same as (2) but with more steps, so maybe (2) would just be simpler. |
I agree on splitting it and getting the (1) fix in. For (2), I can't speak for Secrets, soI think it's worth making a Zeal Suggestion on Discord making it clear that it simply "interrupts" the current melody cast and pauses restarting melody for XX seconds and is entirely a manual trigger. It would be a /melody pause command probably. |
I think what I'll do is actually override
|
So while working on the extracting defensive logic and testing every timing possible, I came across that same timing vulnerability in the client and realized what is happening. This probably needs to be fixed if we're working on allowing players to trigger even more song events between songs, or pausing melodies right at those moments, etc. Because all of that relies on not triggering this glitch all the time, otherwise it's really annoying. That being said, that fix only matters if we're putting in the time for things like Melody Pause feature, which I have working, barring this bug from being so frequent. For a while I was thinking this was a bug with Melody when I noticed that sometimes it immediately re-casts certain songs when you try to stop them, but it's actually just a glitch that's part of the client caused by packet race conditions. The Melody is actually trying to stop, as it should, but the server keeps sending the wrong state to the client and tricking the client into "casting" a phantom spell that was already actually interrupted. Here's a reproduction: 1. Make your client Cast a spell.
2. Make your client send a StopCast (eg click a
|
Gonna wrap this thread up shortly and move over to the new PR(s). 1st new PR is up with the core logic improvements, without any of the behavioral changes. Should be pretty safe. |
What
Supporting changes
Visualization / Example
This visualizes the effect of the change on the player state:
Legend
Why
Previously, stopcast was not invoked until the startcast of the next song. This caused the melody to be completely airtight in terms of the player always being in a casting state. This differs from standard twisting mechanics where there is a small window of non-casting between songs (the gap between
/stopsong
and/cast #
). This window between songs was often utlized by bards to use clicklies like Breath of Harmony by timing their clicky right in this window, without interrupting their twist rotation.This is not an attempt to add any smart-clicky support, features, automation, or scope creep for Melody. This is just to allow the client to be in a non-casting state in the small gap between songs, which more accurately mirrors how song twisting worked, allowing players the same access to techniques that they used to be able to use while twisting back in the day. I see this more as a feature-parity style change, but would make people fairly happy with being able to use their clickies during a Melody (but still requires fairly precise user control to pull off).
Test
I did initial testing on this and it seems to not break melody behavior after I added the supporting changes. Without the supporting changes, Melody would sometimes repeat a song because some clickies emit a "reason 3" stopcast event for their spell ID, which we should simply ignore by checking that it wasn't the melody song that we got the event for.
Tested/working with: