TetrisGYM
TetrisGYM copied to clipboard
Spawn delay in garbage mode is incorrect
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
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