TearRing Saga is a RPG which basically is a Fire Emblem game (it was designed by the creator of the Fire Emblem series after he left Intelligent Systems). It was only released in Japan.
I wanted to TAS this game for a long time, but for some reasons the game isn't emulated well with both PSXjin and PCSX-rr (it is playable, however from time to time there are weird lag frames which prevent you to do any inputs for several seconds). But I tested the game with Octoshock (PSXHawk) and it looks like the bugs are gone, so I think it's time to create a topic for this game (let's just hope I am not the only one here to know this game).
RNG mechanics
It's a RPG, so yeah there are some rng involved. I understand some parts of it so I will try to explain.
The memory address 0x000CC270 is a pointer which increase by 1 each time 1 random number is used. Its possible values go from 1 to 624 (it resets to 1 when it reachs 625).
The 2496 bytes from address 0x000E9848 to 0x000EA206 (so that's 624 groups of 4 bytes) are used to determine the 624 next random numbers (for example, if the pointer is equal to 54, the 54th group will be used). They are changed each time the pointer come back to 1, and
I don't know how the game calculate the new values, however it seems that for 624 given groups, the 624 next groups will always be the same, no matter what you do. Only the initial 624 groups can be manipulated, when you press "new game" in the main menu.
Then some "strange" (from my point of view) calculations are done on the 4 bytes group to choose the random number from this 8x16 "random number board" :
{01;08;10;12;13;14;15;16}
{17;18;19;20;21;21;22;23}
{24;24;25;25;26;27;28;29}
{30;30;31;32;33;34;35;35}
{36;37;38;39;40;40;41;42}
{43;44;45;45;46;47;48;49}
{50;50;51;52;53;54;55;55}
{56;57;58;59;60;60;61;62}
{63;64;65;65;66;67;68;69}
{70;70;71;72;73;74;75;75}
{76;77;77;78;79;80;80;81}
{82;83;84;85;86;87;88;89}
{91;93;95;98;NA;NA;NA;NA}
{NA;NA;NA;NA;NA;NA;NA;NA}
{NA;NA;NA;NA;NA;NA;NA;NA}
{NA;NA;NA;NA;NA;NA;NA;NA}
So yeah, this board is the summary of all the (100) random numbers you can get in the game. NA means that the game will calculate the next random number (so the pointer increase by 1), and so on until it finds a valid number.
As you can see, it is
impossible to miss an attack with a displayed hit of 98% or more. On the other hand, there is no difference between a displayed hit (or crit) of 1% or 7% (in the two cases, you only have 1% chance of success).
That's all for this post (here is the
lua script I use to display the next random numbers if someone want it, however I didn't put any useful description in it) but there are obviously other things to talk about (like the route planning for example...)