Player icon indicating copy to clipboard operation
Player copied to clipboard

Transition: First frame not rendered

Open Ghabry opened this issue 6 months ago • 4 comments

Noticed this while implementing the proper version of the Mosaic transition:

It starts with "current_frame = 1" because Update is called before Draw.

See #3440

Ghabry avatar Jul 02 '25 21:07 Ghabry

I tested all transitions. There's a lot of issues, but I need to take more screenshots (some of them are hard to explain).

For now, I'll report these two:

Mosaic: Random offset is too much, it causes stretching (extension) Image I know why: The range is (0, m_size + 1) right now, because you're adding 1 instead of subtracting here:

		for (int i = 0; i < total_frames; ++i) {
			const int initial_scale = 2;
			const int excl_interval = -1;
			// by default i 0..39 for scale 2..41
			mosaic_random_offset[i] = Rand::GetRandomNumber(0, i + initial_scale - excl_interval);
		}

The correct range is (0, m_size - 1). Somehow, I only noticed the issue now, my bad.

Raster Scroll (Wave): The "background" (behind the wave) isn't black, it has the same trailing Mosaic had. (EasyRPG, RPG_RT) Image

Lt-knb avatar Jul 29 '25 15:07 Lt-knb

I've been taking screenshots to make comparisons, but the two issues I reported above make the Mosaic and Wave ones less useful. To make better comparisons, we need to fix those first.

For the second issue, we need to generate a black background behind Wave

Lt-knb avatar Oct 14 '25 13:10 Lt-knb

Now that comparisons are easy, I found two more issues in Wave: The vertical movement (phase) is wrong in half of the frames, due to the integer truncation in percentage. In WaveOut, the horizontal movement (depth) is 30 fps, for the same reason.

The new commit fixes them. This is the remaining difference (in Mosaic and Wave): The off-by-one error is still there, but Wave is missing the last two frames, because it's 41 frames in RPG_RT 👀

I'll make comparisons of all transitions to make a good ol' table.

Also, it seems most of them are plagued by truncation. Hor/Ver Stripes are 30 fps for that reason.

Blind "starts" 4 frames late rather than ending 6 frames early.

There's a bug in RPG_RT: The crop resolution is wrong (slightly bigger and not centered) in BorderToCenter, so it's not exactly a reversed CenterToBorder. I won't implement that difference

Lt-knb avatar Oct 18 '25 23:10 Lt-knb

Alright, I made the tables (for the off-by-one error and frame count). Keep in mind, the EasyRPG table is based on my PR (up to the 10th commit), not the continuous build. Here's that PR build for posterity (build 6220): easyrpg_windows_x64-PR3482_5d8891f.zip

I tested the bottom row of witches in Transitions (Hide, Show), in Test Game 2000 (with your noise image as a background).

In RPG_RT, the duration (including black and "normal" frames) is 35 for Fade, 1 for Cut, and 41 for everything else.

This is what they do:

B = Black frames N = Normal frames with no visible changes, but the witch is looking at you D = Duplicate frames

Transition HideScreen ShowScreen
Fade 32, 3B 33, 2N
Random Blocks 39, 2B 39, 2N
Blind 35, 6B 35, 6N
Hor/Ver Blinds (Stripes) 39, 2B 39, 2N
Inwards (BorderToCenter) 40, 1B 40, 1N
Outwards (CenterToBorder) 1N, 39, 1B 1B, 39, 1N
Scroll 1N, 39, 1B 1B, 39, 1N
Split/Join (Hor/Ver Div/Comb) 1N, 39, 1B 1B, 39, 1N
Quadrisection/Omni (CrossDiv/Comb) 1N, 39, 1B 1B, 39, 1N
Zoom 1N, 39, 1D 1B, 39, 1N
Mosaic 1N, 40 40, 1N
Raster Scroll (Wave) 41 41
Cut 1B 1N

As you can see, Mosaic actually starts with scale 1, so the first frame looks "normal", then it goes from scale 2 to 41, and it has no black frames. Wave is a full 41-frame animation, while all the other transitions have at least one frame that's either black or normal.

The difference between BorderToCenter and CenterToBorder is due to the bug in RPG_RT I reported.


In EasyRPG, there's a black frame between Hide and Show (why?)

EasyRPG (#3482, https://github.com/EasyRPG/Player/pull/3482/commits/5d8891f13fdab4cae28657990b70519b0b71a8de):

Transition HideScreen Middle ShowScreen
Fade 31, 1B 1B 31, 1N
Random Blocks 39, 1B 1B 39, 1N
Blind 35, 5B 1B 35, 5N
Hor/Ver Blinds (Stripes) 39, 1B 1B 39, 1N
Inwards (BorderToCenter) 39, 1B 1B 39, 1N
Outwards (CenterToBorder) 39, 1B 1B 39, 1N
Scroll 39, 1B 1B 39, 1N
Split/Join (Hor/Ver Div/Comb) 39, 1B 1B 39, 1N
Quadrisection/Omni (CrossDiv/Comb) 39, 1B 1B 39, 1N
Zoom 39, 1B 1B 39, 1N
Mosaic 39, 1B 1B 39, 1N
Raster Scroll (Wave) 39, 1B 1B 39, 1N
Cut 0 0 0

Cut just doesn't do anything (when you do "Hide, Show").

There's two additional issues:

RandomBlocksUp/Down: There's way too many blocks at the end, when they should start disappearing. In general, it looks different.

Zoom: The position is completely different.

Since Random Blocks and Zoom seem complicated (and I'm kinda afraid of them 😅), they deserve a separate issue. We'll take care of them after closing this one

Lt-knb avatar Oct 28 '25 21:10 Lt-knb