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
Merged

Screen flash fixes #1501

merged 2 commits into from Nov 28, 2018

Conversation

fmatthew5876
Copy link
Contributor

No description provided.

@fmatthew5876
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 changed the title Load screen flash from saved games Screen flash fixes Nov 18, 2018
@fmatthew5876
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??

Copy link
Member

@Ghabry Ghabry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

only this, otherwise 👍

src/game_map.h Show resolved Hide resolved
@Ghabry
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 merged commit bc182b3 into EasyRPG:master Nov 28, 2018
@fmatthew5876 fmatthew5876 deleted the load_flash branch November 28, 2018 20:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

None yet

4 participants