[game] Process more than one action per frame - #315
Open
modawan wants to merge 1 commit into
Open
Conversation
We used to execute up to 1 action per frame. With a high dt multiplier, a single frame takes ~100ms (virtual time, 8x dt). For a busy queue of multiple actions (script continuations, for example), it is possible that processing actions one by one will take much longer than for a queue of a single action. With DelayCommand actions, it is crucial that they execute in the same relative order, even when pushed to different queues. With the "1 action per frame" limitation, it is possible that commands in a busy queue can be delayed for so long, they effectively execute out-of-order relative to a command in a single action queue, for example. This happens with `k_pebn_pophawk` and `k_pebo_carthtlk` when running with 8x dt multiplier: - `k_pebn_pophawk` spawns Carth with a 0.5s delay (module queue). - `k_pebo_carthtlk` starts a dialogue with 1.0s delay (trigger queue). The module queue contains other delayed commands, so it takes a few frames to process them. The trigger queue only has 1 action, so it can execute before the module queue actually gets to execute the spawn command.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We used to execute up to 1 action per frame. With a high dt
multiplier, a single frame takes ~100ms (virtual time, 8x dt). For a
busy queue of multiple actions (script continuations, for example), it
is possible that processing actions one by one will take much longer
than for a queue of a single action.
With
DelayCommandactions, it is crucial that they execute in the samerelative order, even when pushed to different queues. With the "1
action per frame" limitation, it is possible that commands in a busy
queue can be delayed for so long, they effectively execute
out-of-order relative to a command in a single action queue, for
example.
This happens with
k_pebn_pophawkandk_pebo_carthtlkwhen runningwith 8x dt multiplier:
k_pebn_pophawkspawns Carth with a 0.5s delay (module queue).k_pebo_carthtlkstarts a dialogue with 1.0s delay (trigger queue).The module queue contains other delayed commands, so it takes a few
frames to process them. The trigger queue only has 1 action, so it can
execute before the module queue actually gets to execute the spawn
command.