Skip to content
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

Screen flash fixes #1501

Merged
merged 2 commits into from Nov 28, 2018

Conversation

Projects
None yet
4 participants
@fmatthew5876
Copy link
Contributor

fmatthew5876 commented Nov 18, 2018

No description provided.

@fmatthew5876

This comment has been minimized.

Copy link
Contributor Author

fmatthew5876 commented Nov 18, 2018

Continuous flashing is broken in rm2k3 with save games in a unique way.

If you save your game, and then go to end game, and load without exiting RPG_RT. Then loaded game will load properly and keep the continuous flash going.

If you close RPG_RT, restart the program, and try to load your game, the current flash will finish but then it will not repeat.

I haven't tested but I bet if you save and load different save games you could get surprises. Like save one game with a short continuous flash, and then load a different one with a longer continuous flash. I expect the load would continue with the short flash.

It looks like some state is kept to keep the flash going which is left in memory when you go back to the title and reload.

I'm very confused how it even works. In order for you to be able to repeat the flash, you need to store the original time amount and saturation so that the program knows how to repeat the same flash. The flash_current_level and flash_time_left values get destroyed as the flash completes.

There appears no chunk in the save data to store these extra 2 values.

@CherryDT How are they doing it in rm2k3?

@fmatthew5876 fmatthew5876 force-pushed the fmatthew5876:load_flash branch from 5c7432b to 2e67f6e Nov 18, 2018

@fmatthew5876 fmatthew5876 changed the title Load screen flash from saved games Screen flash fixes Nov 18, 2018

@fmatthew5876

This comment has been minimized.

Copy link
Contributor Author

fmatthew5876 commented Nov 18, 2018

Our algorithm for shake screen looks wrong. It doesn't work at all for some values of speed and power.

@CherryDT What is the algorithm used for computing shake_position each frame? It looks like the maximum amount of shake displacement is 2 * shake_strength but its not clear to me how strength and speed are combined and how this works for each frame.

Player does speed * strength / 10 each frame. That can't be right as it goes to 0 for many combinations of speed and strength, resulting in no shake effect.

Also are these flash and shake effects computed in terms of 1/10 s or frames? It seems the time left is in 1/10 s units.

If its in 1/10 s, our timing is also wrong as it looks like we increment these every frame??

@Ghabry
Copy link
Member

Ghabry left a comment

only this, otherwise 👍

Show resolved Hide resolved src/game_map.h

@fmatthew5876 fmatthew5876 force-pushed the fmatthew5876:load_flash branch from 2e67f6e to 48099b0 Nov 27, 2018

@Ghabry

This comment has been minimized.

Copy link
Member

Ghabry commented Nov 28, 2018

After rebasing the "force-pushed" diff is completely useless because it shows the whole diff to master in there which means you can still sneak in new code without anybody noticing ;)

@Ghabry

Ghabry approved these changes Nov 28, 2018

@Ghabry Ghabry merged commit bc182b3 into EasyRPG:master Nov 28, 2018

6 checks passed

Android (armeabi-v7a) Build finished.
Details
GNU/Linux Build finished.
Details
OSX Build finished.
Details
Windows (x64) Build finished.
Details
Windows (x86) Build finished.
Details
web Build finished.
Details

@fmatthew5876 fmatthew5876 deleted the fmatthew5876:load_flash branch Nov 28, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.