Player: Barrels do not roll

Created on 4 May 2020  路  10Comments  路  Source: EasyRPG/Player

Name of the game:

Saint Seiya -Il Mito-

Player platform:

Android

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

barrels_not_roll.zip

Describe the issue in detail and how to reproduce it:

Load the save and talk to the boy in front of you, select one of the choices (first play 1 level of game, 4 play 4 levels) and a minigame starts.
If you be hitten by the barrel you lose a life and the game restart but in EasyRPG the barrels no longer roll

Move Routes Patch available Testcase available

Most helpful comment

Confirmed in the page reset function at 0x4AAF50 in dynrpg RPG_RT. Happens near the end.

if (old_page == nullptr || old_move_route != new_move_route) {
   original_move_route_index = 0;
}

All 10 comments

It seems that when two event pages have Exactly the same custom move commands then the move command continues at the same position. Just with the new frequency settings applied. WTF.

Also tested with same length commands. It must be really 100% the same, otherwise it restarts.

@CherryDT did you know this one? ;)

Confirmed in the page reset function at 0x4AAF50 in dynrpg RPG_RT. Happens near the end.

if (old_page == nullptr || old_move_route != new_move_route) {
   original_move_route_index = 0;
}

Are you sure this is the line for this? This looks like the normal index reset on page change code.
For determining whether the move route is the same I expect some loop or memcmp on the chunk.

0x4AAF50 is the start of the page change function. 0x4AB200 calls a function which compares the arrays.

In this case it's not a true memcmp, it looks like it only checks the command codes. So if you had for example:

Move Right, Sw1 on Move Right, Sw2 on, they would still compare equal and the index would not be reset. This should be verified with a test.

Just tested it: Your observation is correct. Sometimes reverse engenering is useful to find edge-cases in edge-cases -_-

This seems to be also the case when you set the Move Route with "Change Move Route" and then switch to a new page with a Custom route that matches the "Event cmd move route".

Though I observe something strange:

I have RRRRDDDDLLLLUUUU for both. Then I switch the page (movement becomes slow) and somehow when the initial route was custom the U movement is suddenly fast again.

Will share the map you will see what I mean:

Next to you (tile on the right) is an event that switches the page:

Map0003.zip

Ah nevermind. I had "Sw1" turned on in my tests which was the page trigger. Still a good test maybe ^^

Confirmed fixed by #2208

Pizus reported is using the same feature in his game. He's using the same custom route in multiple tabs (more than two, but same behavior) and continues as documented.

So this trick seems to be known by more game authors and actively exploited because it is useful to change commands and character appearance between tabs while preserving the same route without interruptions (e.g. action RPG bosses).

Added another test case kindly provided by Pizus: issue2197.zip

So this mysterious logic is actually not so mysterious at all.

It's a there to specifically avoid the issue in #2255

There is a second part of this story not mentioned here, which was necessary to fix the other issue.

When you have a move route with a switch, if the switch changes the page and that page has a different move route, then the logic in this issue sets the index to 0. Once the refresh function returns, the switch move command handler will check if the index is 0 and exit.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

akien-mga picture akien-mga  路  15Comments

Siltala picture Siltala  路  25Comments

BlisterB picture BlisterB  路  66Comments

fmatthew5876 picture fmatthew5876  路  31Comments

Klauserus picture Klauserus  路  16Comments