Make the outcome of raise tapping more predictable
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
Research direction
The issue names no files or tests; start by locating the simulation code for passive and manual raise and how it updates displacement and the rise timer. Check issue #554 first, since this issue is blocked by it. Add test cases for consecutive taps and a single tap that reaches a new row; done means the tests establish predictable raise behavior and the manual-raise logic no longer relies on a deferred passive raise.
Written by the indexing model from the issue text.
Description
Blocked by #554
Raising is generally implemented for tap style use: One tap on raise and the game will raise to the next full row.
There are however two use cases that seem subtly broken for every day use with a tap approach:
Raise inputs are blocked for 1 frame right before completing the manual raise
There is a weird implementation detail that causes the manual raise to just stop on the last frame before the row has fully risen and sets the rise timer to 1 so that the actual completion of the raise is performed by passive raise at the start of the next frame and blocks a manual raise on that frame.
This means that when tapping raise twice in a row with the intention of raising by 2 rows, if the second tap lands on that blocked frame you will only get one row even though you tapped twice.
A single raise input may raise more than 1 row
This is mostly the same implementation detail as the other one: A manual raise is considered "complete" on the frame before the next row rises where manual raise is blocked. That means when a manual raise results in displacement 0 and a new row being generated, the manual_raise field is not cleared after that first new row and instead a second one is being raised.
It is not quite as critical as the assumption that a player wants a second row in that situation is not too far off (on most levels they'd have to wait a few frames for the row to raise passively after all) but I feel it might be more correct to clear the on-going raise and just immediately reapply it if the player is still holding raise.
Implementation details
Passive and manual raise are mutually exclusive. Their results on the stack are generally the same besides two differences:
Rise timer
A finished raise through passive raise sets the rise timer to its new value according to the Stack's speed. A manual raise does not - but only because because all manual raising ends with a passive raise at the moment so this is very fixable.
Order of operations
The order of operation within the simulation is the following:
- Passive raise
- Panel updates
- Manual raise
The interesting thing here regarding exclusivity is the following:
When starting a manual raise on a frame that would have naturally resulted in a new row with the next passive raise the generation of the new row is delayed by a frame for the purpose of panel physics (e.g. ghost matches happen 1 frame later) because passive raise sits in front and is cancelled but manual raise sits behind panel updates.
In case no ghost match happens this is then compensated at the end of the manual raise where the final decrement of displacement is deferred to the next passive raise instead of manual raise:
At displacement 2 we get a panel update, then displacement first reduces to 1 due to the manual raise logic and then to displacement 0 due to the passive raise before the next panel update happens.
Why I think this is wrong
The main reason why I think this is incorrect behaviour however is that the stack is reacting differently to inputs with the same timing in relation to the displacement depending on whether there was a previous raise or not and that while doing so it does not distinguish between a held raise and tapped raise:
Tapping at displacement 0 and then at displacement 1 results in 1 row being raised because the second tap is ignored.
But tapping at displacement 1 also results in 1 row because it is not being ignored.
I believe in the case of tapping it would be most reasonable to interpret two disconnected raise taps as individual raise inputs and not ignore the second based on the presence of the first. In a case with holding raise instead, the current behaviour could be considered as an interpretation that is not incorrect but I believe in the tap scenario it should absolutely chain right into a second row being raised.
In consideration of #39 it would also be imaginable to generally queue up another raise when a new raise tap is detected, even while a raise is still in an earlier state of the process to require a bit less accuracy on the player end and tap twice for two rows without careful timing.
Fixing manual raise
Create test cases verifying the assumed behaviour
Remove "needs repro" label once done.
Resolving order of operations
The displacement accelerating/stuttering on the transitions between manual/passive raise in some cases would easily be resolved by placing passive and manual raise together within the simulation.
While the phenomenon itself is not problematic right now, in combination with e.g. #437 it could lead to subtle bugs where in some scenarios pressing raise together with a swap while topped out would allow you to queue up another swap that you would not have gotten under usual circumstances.
Having manual raises finish without deferring to passive raise
Once the order of operation has been resolved, there is no longer a good reason for manual raise to not just finish up rather than deferring; the deferrence was only necessary to compensate the initial delay after all.
This should simplify the logic quite a bit as the use-cases of passive and manual raise become truly disconnected from each other besides the exclusivity.
Cleanup
The code for manual raise across multiple frames is one hot mess so a good opportunity to clean that up.
- Dominant language
- Lua
- Stars
- 30
- Forks
- 20
- Avg merge
- 3d 15h
- Merged PRs (30d)
- 17
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from panel-attack/panel-game
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
panel-attack/panel-game#822 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
panel-attack/panel-game#779 ·
Maintainers usually reply within 1 day
-
bug Client-side priority: 0 - high
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
panel-attack/panel-game#776 ·
Maintainers usually reply within 1 day
-
enhancement priority: 1 - middle
Difficulty 4/5 3-5 days Newbie friendliness 48/100
panel-attack/panel-game#821 ·
Maintainers usually reply within 1 day
-
Animation scenes draw every part separately, costing hundreds of draw calls a framePossibly taken @JamesVanBoxtel claimed this 4 days ago. OpenClient-side enhancement graphics
panel-attack/panel-game#814 · 1 assignee ·
Maintainers usually reply within 1 day
All issues in panel-attack/panel-game
Similar issues
-
slice weekend
Difficulty 2/5 1-3 hours Newbie friendliness 71/100
Life-Framework/Life-Framework#3212 ·
Maintainers usually reply within 1 day
-
bug discord guide:01b-riverglades locale:enUS triage v4.1.1
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 73/100
petertriho/nvim-scrollbar#127 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 83/100