New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Razas: Screen stays black after starting any battle with a wild enemy #1032

Closed
Zegeri opened this Issue Sep 15, 2016 · 6 comments

Comments

Projects
None yet
2 participants
@Zegeri
Member

Zegeri commented Sep 15, 2016

Name of the game:

Razas

Player platform:

All platforms

Attach files (as a .zip archive or link them)

The game hasn't been released yet. If you've got an alpha copy, here's a save file.
Save01.lsd.zip

Describe the issue in detail and how to reproduce it:

Load Save01.lsd. Collide with the red bee enemy. The screen will fade to black and the player will be teleported to Map0052.lmu, but the screen doesn't fade in.

The game runs a Tint Screen command that makes the screen black, but it doesn't reach the Tint Screen command that clears it.

@Ghabry Ghabry added this to the 0.5.1 milestone Sep 15, 2016

@Ghabry

This comment has been minimized.

Show comment
Hide comment
@Ghabry

Ghabry Sep 15, 2016

Member

Even with Tint change disabled this stays black.

Member

Ghabry commented Sep 15, 2016

Even with Tint change disabled this stays black.

@Ghabry

This comment has been minimized.

Show comment
Hide comment
@Ghabry

Ghabry Sep 15, 2016

Member

That's some problem with Show Screen. Disabling this event (return true) starts the battle.

Member

Ghabry commented Sep 15, 2016

That's some problem with Show Screen. Disabling this event (return true) starts the battle.

@Zegeri

This comment has been minimized.

Show comment
Hide comment
@Zegeri

Zegeri Sep 15, 2016

Member

This seems to be yet another weird behaviour of RPG_RT. The battle won't start because the switch 102 LANZA_SBS3D isn't activated. Activating manually this switch fixes the issue.

2016-09-15_17-54-02

After the Teleport command, parallel events keep executing commands that frame. There are no more map updates until the teleport is finished and all events are removed. However, executing ShowScreen/HideScreen will delay the teleport, even if it's called after it like in this case.

Gotta go, I'll finish this post later.

Member

Zegeri commented Sep 15, 2016

This seems to be yet another weird behaviour of RPG_RT. The battle won't start because the switch 102 LANZA_SBS3D isn't activated. Activating manually this switch fixes the issue.

2016-09-15_17-54-02

After the Teleport command, parallel events keep executing commands that frame. There are no more map updates until the teleport is finished and all events are removed. However, executing ShowScreen/HideScreen will delay the teleport, even if it's called after it like in this case.

Gotta go, I'll finish this post later.

@Ghabry

This comment has been minimized.

Show comment
Hide comment
@Ghabry

Ghabry Sep 15, 2016

Member

I made some tests: It looks like this depends on the main_flag again. When it is a non-parallel interpreter Hide Screen and Show Screen run imediately at the position where they are placed.

For parallel events these calls just define the transition and continue. The effect itself isn't played until reaching a Teleport or end of event.

Just try e.g.

Message XXX
HideScreen
Message YYY

Parallel shows both messages, then hides. Normal shows first, then hides.

Member

Ghabry commented Sep 15, 2016

I made some tests: It looks like this depends on the main_flag again. When it is a non-parallel interpreter Hide Screen and Show Screen run imediately at the position where they are placed.

For parallel events these calls just define the transition and continue. The effect itself isn't played until reaching a Teleport or end of event.

Just try e.g.

Message XXX
HideScreen
Message YYY

Parallel shows both messages, then hides. Normal shows first, then hides.

@Zegeri

This comment has been minimized.

Show comment
Hide comment
@Zegeri

Zegeri Sep 16, 2016

Member

I'm getting only the first message with parallel events.
TestHideScreen.zip

Member

Zegeri commented Sep 16, 2016

I'm getting only the first message with parallel events.
TestHideScreen.zip

@Ghabry

This comment has been minimized.

Show comment
Hide comment
@Ghabry

Ghabry Sep 16, 2016

Member

You are right. No idea what I tested there... should have used a clean project...

Member

Ghabry commented Sep 16, 2016

You are right. No idea what I tested there... should have used a clean project...

Ghabry added a commit to Ghabry/easyrpg-player that referenced this issue Oct 5, 2016

Delay teleport when a parallel interpreter calls Show/EraseScreen.
RPG_RT does not yield the interpreter when doing Transitions compared to our code which does the transition in the graphic update.
Due to this a pending teleport is executed directly after a Show/EraseScreen due to our yield. This means it is executed too early and events following a Show or Erase screen are not executed after a map change (which is wrong).
By inventing an additional flag the teleport is delayed (= not executed) when the interpreter yields due to a Show/EraseScreen, continuing the event execution on the same map as expected one frame later.

It's possible that this causes some timing issues but this flag is only relevant for the mentioned corner case.
Show/Erase on the main interpreter will not toggle it (typical Parallel vs. Main inconsistency in RPG_RT).

Fix #1032
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment