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

Spawn delay in garbage mode is incorrect #128

Open
kirjavascript opened this issue Jan 5, 2025 · 1 comment
Open

Spawn delay in garbage mode is incorrect #128

kirjavascript opened this issue Jan 5, 2025 · 1 comment

Comments

@kirjavascript
Copy link
Owner

discussion from discord:

zohassadar
 — 
Today at 15:52
https://github.com/kirjavascript/TetrisGYM/blob/9ad2faacc6cfd919782330659468028aea04533b/src/playstate/garbage.asm#L37-L39

@Kirjava I think setting vramRow to 0 here would add 3 or 4 frames to the spawn delay when garbage is added.
Kirjava
 — 
Today at 15:54
hmm, that's annoying because otherwise the rendering won't be correct
I guess we have to either:

    write some custom rendering for garbage
    adjust the spawn delay code to account for garbage

zohassadar
 — 
Today at 15:55
It can be worked around if the garbage is added on the same frame as the end of the line clear animation
i don't know how much of the scoring logic needs to be done though
Kirjava
 — 
Today at 15:56
sometimes garbage is added without a line clear
zohassadar
 — 
Today at 15:56
Oh yeah
@zohassadar
Copy link
Contributor

Here's the timing when no vramRow delay is introduced due to piece height:

1 lock
2 check row
3 check row
4 check row
5 check row
<< line clear maybe >>
6 score
7 prepare next
8 receive garbage
9 vramRow delay
10 spawn next

One approach could be to double up playstate_checkForCompletedRows and to use the saved frames to do the scoring first, being careful to update the render flags for the score results on the appropriate frame.

1 lock
2 check row x2
3 check row x2
4 score
5 prepare next + receive garbage
<< line clear maybe >>
6 vramRow delay
7 vramRow delay
8 vramRow delay
9 vramRow delay
10 spawn next

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

No branches or pull requests

2 participants