Users browsing this thread: 1 Guest(s)
Patch: Wilder Randomness

#1
Posts: 149
Threads: 21
Thanks Received: 40
Thanks Given: 3
Joined: Dec 2013
Reputation: 9
Status
Auto-life
Patch:  Wilder Randomness 1.0
Target: Final fantasy 3, Version 1.0, English, With Header
Download


Description:

Final Fantasy 3 has a few pseudo random number generators. They base the random number generation in a table of available numbers. They choose the numbers in a sequential order based on different indexes.

The method to choose a random number based on a sequential order generates poorly random numbers. They are predictable and, in specific situations, are almost rigged.

The patch changes the indexes used by the random numbers generators. Instead of always be based on a sequential order, they now are based in a random order.

For every unit of 1/60 (0,0166) of a second in the game, the indexes used to get the next sequential number are added by a random value between [0, 1]. It is accumulative by each time unit.

With this method, the random numbers generated are more unpredictable when compared with the original game.
  Find
Quote  
[-] The following 2 users say Thank You to HatZen08 for this post:
  • Gi Nattak (01-20-2016), SSJ Rick (05-02-2017)

#2
Posts: 3,966
Threads: 279
Thanks Received: 233
Thanks Given: 56
Joined: Oct 2011
Reputation: 65
Status
Tissue-aware
Haven't looked at your code but this is a really nice patch!

Do you know technically how it differs from Lenophis Holy randomness Batman patch or BNW RNG implementation. I know little about those two others randomness systems but with the description you gives yours seems to be among the most random it can get for a SNES game.

Also, in vanilla game, does the random numbers generated from bank C2 use the table and routine in bank C0?
  Find
Quote  

#3
Posts: 826
Threads: 11
Thanks Received: 22
Thanks Given: 13
Joined: Nov 2011
Reputation: 16
Status
Double
I get the feeling that Lenophis' version isn't nearly as good as the BNW version. No clue how this compares though.


Confused Moogles FTW
Quote  

#4
Posts: 676
Threads: 44
Thanks Received: 26
Thanks Given: 21
Joined: Jan 2015
Reputation: 11
Status
Zombie
Last I heard on the Lenophis version, I think he said it turned out to be same level of random, just different random.

That is unless it was secretly updated and nobody found out.

From the way I under stand the description, this MAY have a similar result, however, the extra pseudo ramdom number in the equation should make it bounce around at better.

The last I tested anything toward random was on the auction house, and while the old random fix patch did play with my version better, in the end I have to think it really was just that it played better with the code, not that it was more random. Hrm, might be worth testing that, with this.


The only true wisdom is knowing you know nothing.
  Find
Quote  

#5
Posts: 2,548
Threads: 98
Thanks Received: 147
Thanks Given: 156
Joined: Aug 2009
Reputation: 52
Status
Nattak\'d
(01-20-2016, 05:11 PM)Catone Wrote: Last I heard on the Lenophis version, I think he said it turned out to be same level of random, just different random.

That is unless it was secretly updated and nobody found out.

From the way I under stand the description, this MAY have a similar result, however, the extra pseudo ramdom number in the equation should make it bounce around at better.

The last I tested anything toward random was on the auction house, and while the old random fix patch did play with my version better, in the end I have to think it really was just that it played better with the code, not that it was more random. Hrm, might be worth testing that, with this.

http://slickproductions.org/forum/index....8#msg20698

Yeah Lenophis's RNG patch that is available for download is a bit of a mystery as it seems he is not even sure how random it is. I'm still using it, and imo it seems random enough,  but I'm not sure on a technical level, I just know damage and healing numbers fluctuate and nothing that should be random seems predictable. I'm looking forward to possibly updating to HatZen's, here, but would like to hear how it differs as well.

I'd also like to know what all uses randomness? I know of damage in battle, running away chance, encountering a random battle & the monster formation... but besides these obvious things is there anything else like outside of battle? The pseudo random event command also uses RNG randomness? I always assumed it was just a 50/50 thing. Same for item drops, I figured they just use a set % instead of a RNG...or is it that the actual % comes from the RNG?


We are born, live, die and then do the same thing over again.
Quote  

#6
Posts: 676
Threads: 44
Thanks Received: 26
Thanks Given: 21
Joined: Jan 2015
Reputation: 11
Status
Zombie
The event "pseudo" random 50/50 is the only part I ever actually looked at. Never saw any hard factual proof that it does use the randomness code, but there was a noticable difference in my auctions (I used a freaking ton of that 50/50 event code in selection, and at least 6 or 7 per auction), anyway, yes there was a difference when using vanilla, and when using Lenophis' patch.

So my guess is strongly toward, yes, the event code uses it in some way. But in the end I couldn't prove more/less random. Reloading a save state mid auction always came out about the same conclusions with both patches. One was just different than the other.


The only true wisdom is knowing you know nothing.
  Find
Quote  

#7
Posts: 2,548
Threads: 98
Thanks Received: 147
Thanks Given: 156
Joined: Aug 2009
Reputation: 52
Status
Nattak\'d
That's the thing about randomness and improvements to a RNG, it's hard to tell if it's being more random or not, because it's random lol. How I see it, improving something to be even more random wouldn't necessarily result in a better randomness than before. Increasing the amount of choices to have it pick from is one thing, but how it determines/chooses which choice is still going to be as random as always. I realize this statement might not make much sense, but it's how I've always viewed randomness of any kind. Although FF6's original RNG is pretty much non-existent from what I've heard, so any improvement to it is going to be better.


We are born, live, die and then do the same thing over again.
Quote  

#8
Posts: 149
Threads: 21
Thanks Received: 40
Thanks Given: 3
Joined: Dec 2013
Reputation: 9
Status
Auto-life
Quote:Do you know technically how it differs from Lenophis Holy randomness Batman patch or BNW RNG implementation.

I don't know enough about them, in a technical detail, to give you an answer. They were created by different authors and i am not familiar with their code. The code of 'Randomness Batman' is available in the mentioned link. However, i don't know exactly how the code works, especially about how the game system works with all the registers in its code. However, i can give you more technical details about my patch, if it can help you.

At C3/13C8, the game updates the total time played. The function, called every 1/60 of one second in game, updates the seconds, minutes and hours played. it is called everywhere: the overworld map, dungeons, menus, battles, etc. The patch actually is an extra code for this routine.

First, it calculates a random number. Two numbers are used to calculate the random number. The first one is the horizontal scanline location, also know as the register $213C or H counter. The second one is the vertical scanline location, also know as the register $213D or V counter. They are special registers and indirectly work as a pseudo-random number when read.

The random number used in the patch is the sum of the low bytes of the H counter and the V counter.

With the random number, the first four bits determinate the indexes which will be incremented. If the bits is unset, the correspondent indexes will be incremented. Otherwise, they wwill not. The indexes are:

Code:
$1F6D       related to many purposes 
$1FA1       related to overworld map
$1FA2       related to dungeons/towns
$1FA5       related to Veldt

Quote:Also, in vanilla game, does the random numbers generated from bank C2 use the table and routine in bank C0?

Quote:I'd also like to know what all uses randomness? I know of damage in battle, running away chance, encountering a random battle & the monster formation... but besides these obvious things is there anything else like outside of battle? The pseudo random event command also uses RNG randomness? I always assumed it was just a 50/50 thing. Same for item drops, I figured they just use a set % instead of a RNG...or is it that the actual % comes from the RNG?

The truth is that the random number generation is a mess. In general, the table at C0/FD00 is used as the 256 available candidates for a random number. Unfortunately, every routine has its own way to get a random number from this table.

The common way is to use an index to determinate the position where to get the random number in the C0/FD00 table. After it, the index is incremented by one. Yes, the original random number generators actually can just be based on a sequential order obtained from this table.

There are not necessarily a logical design for the indexes used. A routine, which gets a random number based on the same index, can give a random number for the most variate objectives, whatever they are. They can be multi-functional, even if they have more influence in a specific aspect of the game.

Every case is a case. Even if they use the default method to get a number from the C0/FD00 table based on indexes, there are exception. They can just do as they like to obtain a random number, by any ways available.

Technically, the patch interferes with the registers $1F6D, $1FA1, $1FA2 and $1FA5, used as indexes by random number generators. $1FA5 is a exception because it doesn't actually get a number from the mentioned table but indirectly is used as one. Anyway, any code which uses these indexes will be affected. Any code which doesn't use them will not be affected.

I still have four bits that i can use to update more indexes used by random number generators. I choose the most apparent ones because i was unsure about how the others indexes were used. However, i know there are more indexes used to generate random numbers in this game but i choose to be careful about indexes with unknown factors.

Quote:So my guess is strongly toward, yes, the event code uses it in some way. But in the end I couldn't prove more/less random

If we are talking about the BD event opcode, its main code is at C0/B271. It calls C0/062E to get a random number based on the index of $1F6D:

Code:
C0/062E:    DA          PHX            (from C0/0EDB, C0/0EFD, C0/7B0C, C0/7B19, C0/7BB1, C0/B271)
C0/062F:    EE6D1F      INC $1F6D      (increment RNG index in SRAM)
C0/0632:    AD6D1F      LDA $1F6D      (load RNG index from SRAM)
C0/0635:    AA          TAX
C0/0636:    BF00FDC0    LDA $C0FD00,X  (Load Xth entry of Random number table)
C0/063A:    FA          PLX
C0/063B:    60          RTS

By the way, C0/062E is a good example of the most common code of random number generators used in this game.

Quote:That's the thing about randomness and improvements to a RNG, it's hard to tell if it's being more random or not, because it's random lol.

Quote:Although FF6's original RNG is pretty much non-existent from what I've heard, so any improvement to it is going to be better

It is difficult to compare randomness between the original and different related hacks. It is something that can't be easily evaluated. However, the original random number generator is so bad that almost anything is better. Whatever new method or hack you choose for the random number generators, it will be better than the original game design.
  Find
Quote  

#9
Posts: 676
Threads: 44
Thanks Received: 26
Thanks Given: 21
Joined: Jan 2015
Reputation: 11
Status
Zombie
I guess the real test of randomness would be how difficult it was to produce a forced/repeated result using the RNG in question.

Google anything close to "manipulate the RNG", Gamefaqs.com forum seems to be have a fondness for this sort of stuff. FF4 psp had some wild ones, all to make an item drop after battle. Was just reading about an "arrow trick" on Fire emblem as well. All methods of checking or forcing the RNG to produce the value you want.

So, the real test of randomness would be, how hard would it be to force the same result, repeatedly? Least, I figure it would be a perfect random test... even if only in random theory.

Thanks for the detailed explination too. Really not sure how you could get much more random if I read that correctly.


The only true wisdom is knowing you know nothing.
  Find
Quote  

#10
Posts: 826
Threads: 11
Thanks Received: 22
Thanks Given: 13
Joined: Nov 2011
Reputation: 16
Status
Double
(01-20-2016, 08:20 PM)HatZen08 Wrote: It is difficult to compare randomness between the original and different related hacks. It is something that can't be easily evaluated. However, the original random number generator is so bad that almost anything is better. Whatever new method or hack you choose for the random number generators, it will be better than the original game design.

I think the XKCD random number generator would be worse. Shrug

@Catone: The way I see it, there's more than one aspect to making the random number generator.  Yes, unpredictability and preventing manipulation (excluding save states) are important, but it's also useful to have a distribution of numbers that is even on average.  If I were supposed to make an RNG that picks a number between 1 and 10, and it picks from 1-5 two thirds of the time, it could be completely impossible to get a "forced/repeated result" (if say, it changed every frame like with this patch, it would pass your test), but you still can't really call it a good RNG.

Think0028 from the Insane Difficulty forums was the guy who made the BNW RNG.  The thread about it here gives the full discussion:

http://www.insanedifficulty.com/board/in...rng-patch/


Confused Moogles FTW
Quote  



Forum Jump:

Users browsing this thread: 1 Guest(s)


Theme by Madsiur2017Custom Graphics by JamesWhite