AboutFrameProcessing - cwtickle/danoniplus-docs GitHub Wiki

English | Japanese

| < Object hierarchy | Pseudo-frame processing specification | Interrupt processing by custom js (skin js) > |

Pseudo-frame processing specification

  • Dancing Onigiri "CW Edition" uses setTimeout to reproduce the frame processing in Flash. An image of this is shown below.

Frame Processing Concept

  • When fps=60, 1/60 second is allocated to each frame so that 60 frames can be processed per second, and drawing and calculation are performed in that time. The remaining time is used for waiting time. If the drawing or calculation process cannot keep up, it tries to recover the delay in subsequent frames. Due to the setTimeout specification, a wait of 4 ms will be added even if processing is delayed.
  • When "playbackRate" is other than 1 (e.g., low speed), recalculation of the number of frames can easily result in information errors. To prevent this, the information error is minimized by allowing a fraction of the original number of frames to be calculated only when "playbackRate=1". (The calculated number of frames is rounded to the integer part.)

Relationship between arrow travel distance and number of frames processed

  • The load process determines the distance each arrow moves. The display position and timing are calculated by calculating backward from the position on the step zone and adding the amount of movement for each frame. The amount of movement is counted backward until it exceeds the drawing area, and the drawing of the arrow begins with that distance back.

Pseudo fractional frames for "Adjustment" by adjusting music playback position

  • The "Adjustment" width is pseudo-fractional frames in units of 0.1 frame by adjusting the music playback position. This is because the music playback position can be expressed in milliseconds, not frames.

Variable for number of frames in play

  • The frame position currently being processed will vary depending on the music playback position, "Adjustment", and other values listed above. Multiple frames (positions) are maintained so that actual production and playback are not interfered with.
Variable Name Description
g_scoreObj.frameNum Actual number of frames added to "Adjustment", correction frames in the chart settings and settings screen
g_scoreObj.baseFrame Number of frames from the chart creator's point of view, excluding all correction frames.

Frame-constrained and non-frame-constrained items

Items subject to frame constraints

  • Arrow and freeze arrow generation, movement (redrawing), speed change, color change, background/mask motion, arrow and freeze arrow motion
  • Other information types on "mainEnterFrame"

Items not restricted by frame

  • Music playback position, key operation event (number of error frames from the judgment position depends on the number of frames)

Related pages

Changelog

Version Change details
v23.0.1 - Fixed an issue in which "Adjustment" did not work in some cases when the number of frames of chart data was extremely small (modified the calculation formula).
v23.0.0 - Extended to use pseudo 0.1 frame unit "Adjustment" by adjusting the music playback position.
v1.0.0 - Initial implementaion

| < Object hierarchy | Pseudo-frame processing specification | Interrupt processing by custom js (skin js) > |