Merry-go-Round and Twist ending animations cause a few frames in the animation cycles to be skipped
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 16.2k
- Forks
- 1.9k
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 80
Description
Operating System
Windows 10, 64-bit
OpenRCT2 build
V0.4.26
Base game
RollerCoaster Tycoon 2
Area(s) with this issue?
This bug is a graphical glitch or error
Describe the issue
The Merry-go-Round (and its derivatives like the Double Decker), which uses rotation type 3, and the Twist (and its numerous derivatives), which uses rotation type 1, have an ending animation that does not cycle back to the first frame of rotation as it should. In VehicleData.cpp there's an array that maps time to animation frame for all three rotation types (the Enterprise and its derivatives being the other type, called type 2 in the code), with each entry corresponding to a game tick. All rotation animations are divided in starting, looping and ending, and the ride cycle always start at frame 0 of the animation, obviously. However, rotations of types 1 and 3 have an ending animation that does not cycle back to frame 0 at the end, and thus when the next cycle begins it will jump two frames back to 0 and cause the animations to appear choppy. This does not happen with rotation type 2 (and thus, it does not affect Enterprise-like rides).
For the Twist, which has 215 animation frames, notice that the last value in the ending animation array is 214 (it should be 0 so as to not result in skipped frames): https://github.com/OpenRCT2/OpenRCT2/blob/develop/src/openrct2/ride/VehicleData.cpp#L160
For the Merry-go-Round, the full animation has 127 frames but the ending animation array ends with frame 126 (it should also be 0): https://github.com/OpenRCT2/OpenRCT2/blob/develop/src/openrct2/ride/VehicleData.cpp#L363
The Enterprise correctly has its ending animation reset back to frame 0: https://github.com/OpenRCT2/OpenRCT2/blob/develop/src/openrct2/ride/VehicleData.cpp#L254
Steps to reproduce
- Build a Merry-go-Round or a Twist
- Notice that for the first cycle, there is no skip in animation frames (because the animation is at frame 0)
- When the ride ends and the next cycle starts, notice that it will skip two frames to get back to frame 0
Attachments
In the gifs below, notice how the ride stops, "jerks" to frame 0, and begins the next cycle.
Contributor 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.
Research direction
Start in src/openrct2/ride/VehicleData.cpp, inspecting the ending animation arrays around lines 160 and 363 and comparing them with the Enterprise array around line 254. Build the game and reproduce a Merry-go-Round or Twist cycle; done means both animations return to frame 0 without a visible skipped-frame jerk.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- computer-graphics, game-dev
- Issue type
- Bug
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 55/100