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

Charset disappear after talk #2196

Closed
zell180 opened this issue May 4, 2020 · 8 comments · Fixed by #2208
Closed

Charset disappear after talk #2196

zell180 opened this issue May 4, 2020 · 8 comments · Fixed by #2208

Comments

@zell180
Copy link

zell180 commented May 4, 2020

Name of the game:

Saint Seiya -Il Mito-

Player platform:

Android

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

Save01.zip

Describe the issue in detail and how to reproduce it:

After talk with NPC she disappear. Select "No, ho troppo sonno adesso" to short talk

@Ghabry
Copy link
Member

Ghabry commented May 4, 2020

This is slowly becoming too much work for me:

  1. Can I share the game you provided to me with other devs?
  2. If not: Please create a minimal testcase to reproduce this

@zell180 zell180 closed this as completed May 4, 2020
@zell180
Copy link
Author

zell180 commented May 4, 2020

I've shared the game. Issue persist, if you use save not happens.
Please use this save to test:
Save01_charsetdisappear.zip

or goes to game scene without it

@zell180 zell180 reopened this May 4, 2020
@fmatthew5876
Copy link
Contributor

fmatthew5876 commented May 14, 2020

I can reproduce this with the second save zell180 uploaded.

This one has something to do with something in the save game. If you edit and save the map, the bug no longer happens. If you then comment out the save_count code, the bug occurs again.

It happens immediately after Event 349 / page 3 finishes executing. If you add more code to page 3 (and disable save count logic), she immediately dissapears after the event code finishes.

Furthermore, she's still there, just invisible. You can talk to her again, in which case she will immediately re-appear again the game continues like normal.

@zell180
Copy link
Author

zell180 commented May 14, 2020

I think this information can help you: the bug occurs even if you get to that part of the game without loading the save

@fmatthew5876
Copy link
Contributor

This happens right when the event finishes executing. I added a message at the end of the event to verify.

  1. Turns on switch for page 4
  2. Refresh runs, setting up new page
  3. Message appears
  4. Message closes
  5. sprite dissapears

If you edit the game map, you have to disable the save_count logic in Game_Map, otherwise the bug will not happen.

@fmatthew5876
Copy link
Contributor

fmatthew5876 commented May 16, 2020

Also checked with ubsan and address sanitizer. Nothing on this bug

Finally a clue, when the sprite dissapears, the src rect changes

Debug: SPRITE DRAW true 136 128 335544336 2322326775488 Rect{24,32,24,32}
Debug: SPRITE DRAW true 136 128 335544336 2322326775488 Rect{24,128,24,0}

@fmatthew5876
Copy link
Contributor

fmatthew5876 commented May 16, 2020

Ok I've figured this out.

The save game has direction=4 (UpRight) and sprite_direction=1 (right)

When you talk to the event, her sprite_direction changes to face you. Once the event finishes, Player will do sprite_direction = direction.

After that the sprite rendering code computes a bounding rect with sprite_direction == 4 which ends up out of bounds. So you get a Sprite::src_rect with height == 0 and this is what causes the event to dissapear.

This also explains why the bug doesn't occur when save_count logic triggers, because all the events get reset. Her direction must have changed to 4 from a previous event and saved into the save game.

Resetting the events sprite_direction after the event finishes is correct, but we do it wrong. First, in RPG_RT sprite_direction or facing as they call it can never be a diagonal direction.

RPG_RT actually has a virtual function in the Character class heirarchy which resets facing based on current direction. It has logic for converting diagonal directions to 4 direction facing.

To reproduce this bug is simple. Make an event with custom move route Move UpRight, no repeat. Put some message in, Then talk to it. The event will disspear after the message.

This will be fixed in #2208 , but it is not there yet yet.

@fmatthew5876
Copy link
Contributor

This is now fixed in #2208

@Ghabry Ghabry added this to the 0.6.3 milestone Sep 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

3 participants