Battle flow/drops predetermined?

A forum to ask questions if you are stuck in the The Gate Rune Wars; or wish for more clarity on the gameplay systems.
Post Reply
walterxx1

Battle flow/drops predetermined?

Post by walterxx1 »

I've been playing around with random battles on an emulator (trying to make it as easy as possible to get rare drops :roll: ) and using save states, and I've noticed almost all battles are predetermined. For example, when I save state before even beginning a battle, do it, and then reload and do it again, the same exact things will happen (same exact enemies will dodge, counter, same exact people will critical for exact same amount of damage). Further showing this, the Holy crystal has a supposed <1% chance of dropping, yet when I reload the battle, I got it all 5 times. I'm guessing this shows several things at the beginning of the battle are already determined?

And I just did another experiment with the slimes on Mt. Tigerwolf. I saved state after the battle intitiated (but I didn't make any commands yet) and if I free will or attack them to death, I get the water rune piece every single time. However, if I firestorm them to death, or take more than one turn to kill them, I get nothing every time.
Antimatzist
Posts: 2770
Joined: Sat Apr 19, 2008 9:48 am
Location: Germany, yeah baby
Contact:

Re: Battle flow/drops predetermined?

Post by Antimatzist »

there was a topic about that already :http://suikosource.com/phpBB3/viewtopic.php?f=8&t=9115

but somehow it got overlooked. But it seems, that it really is that way.
User avatar
Celes
Global Admin
Posts: 1422
Joined: Sun Nov 12, 2006 6:25 pm

Re: Battle flow/drops predetermined?

Post by Celes »

Nothing is predetermined. The game uses "random numbers" to calculate anything that is... well... random (attack patterns, drop rates, encounters). Since there are technically no random numbers, these games calculate numbers out of existing variables. If you reload a save state without changing anything at all, all variables in the game are exactly the same - and therefor the outcome of "random" events are as well.

You have given a good example yourself with the Killer Slime battle. Do anything different and you will produce other results elsewere.

That's why using save states will produce similar results everywhere. Don't use them if you don't want anything like this to happen :)
KFCrispy
Global Admin
Posts: 6174
Joined: Wed Jun 30, 2004 3:29 pm

Re: Battle flow/drops predetermined?

Post by KFCrispy »

well like the previous post i made stated, the actual order of battles and number of steps you take is determined earlier, when you first enter the area. you can walk in any direction, stop moving, use the menu, run.... you will still encounter exactly the same enemy party after the same number of steps. The drops, damage, hits, etc, are more "random" the way Celes described them.
User avatar
Celes
Global Admin
Posts: 1422
Joined: Sun Nov 12, 2006 6:25 pm

Re: Battle flow/drops predetermined?

Post by Celes »

KFCrispy wrote:... when you first enter the area. you can walk in any direction, stop moving, use the menu, run....
Well, did you actually change something when using the menu? Like items usage or formation changes? If not, all variables will be the same.
KFCrispy
Global Admin
Posts: 6174
Joined: Wed Jun 30, 2004 3:29 pm

Re: Battle flow/drops predetermined?

Post by KFCrispy »

i don't recall using items or changing the formation, but you can have different actions in battles/different number of turns and the encounters wouldn't change.
User avatar
Pyriel
Webmaster
Posts: 1227
Joined: Wed Aug 18, 2004 1:20 pm

Re: Battle flow/drops predetermined?

Post by Pyriel »

You probably still didn't change anything significant. In a typical scenario, all that matters is the condition of the state table, and what comes out of it. Different actions and different numbers of turns won't matter in the short term, because the use that the data spat out by a random number generator is put to typically has no effect on it*. Let's say, for example, you create a save state, attack, and the action receives a random number of 2,003. That number is adjusted by whatever formula the game applies, and comes out as 956 damage. Then you cast a spell, it gets a number of 2,576, which results in 1,322 damage. If you restore the save state, and reverse the order of your actions, the first number spat out will still be 2,003, resulting in whatever spell damage, and the second will still be 2,576.

A fairly typical algorithm for an RNG produces a result, and then after some period, like after 624 results are produced, either uses the current result, or some fixed value to help regenerate the values in its state table. This helps create an illusion of randomness, but it's still an illusion. The order of values returned from the table is predictable, and each iteration of the state will have a predictable pool of values.

As it's highly unlikely that the game "stacks" a series of encounters on entering an area, the more likely explanation is that your battle changes either didn't change the number of outputs the RNG produced during battle, or were too insignificant to cause enough drift in the state table that different enemy parties were encountered afterward. It's also possible that different RNGs are used for encounters than for damage/healing, etc. It doesn't even have to be different RNG algorithms. There could just be separate state tables. I wouldn't do it that way, because you end up wasting a KB or more of the PS1's precious RAM for each table, but I've seen it done.

*I've seen a few cases where a random number was generated, and the manipulated result, e.g. damage, was used to offset the impending value. In a case like that, the actions you choose will absolutely have an effect on the random values received.
User avatar
BadPotato
Posts: 170
Joined: Mon Feb 09, 2009 10:07 am
Location: Canada - Québec

Re: Battle flow/drops predetermined?

Post by BadPotato »

I made few test about this some time ago, while looking for speedrunning... the best way to have different result is to get_out/enter the aera. If the battle patern is still looking bad(like you keep getting uninteresting drop), you might want to get a random battle before you enter in your "hunting aera"... this should help for the random battle generator.

I'm very unsure if there a way to change these random number, by browsing the menu or just waiting.
User avatar
MatildaWhiteKnightLeader
Posts: 642
Joined: Wed Jul 20, 2005 12:14 am
Location: Matilda

Re: Battle flow/drops predetermined?

Post by MatildaWhiteKnightLeader »

KFCrispy wrote:well like the previous post i made stated, the actual order of battles and number of steps you take is determined earlier, when you first enter the area. you can walk in any direction, stop moving, use the menu, run.... you will still encounter exactly the same enemy party after the same number of steps. The drops, damage, hits, etc, are more "random" the way Celes described them.
Yup, I can confirm this. Although after a certain number of steps/time, it becomes "random" again.
Basically the first handful of battles in the area coming off a save point will have the same enemy parties at the same step count, but once you enter a new area,trigger an event, etc..., there's no longer a pattern.
Strategy is the key to victory!
Post Reply