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

#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  



Messages In This Thread
Patch: Wilder Randomness - by HatZen08 - 01-20-2016, 08:31 AM
RE: Patch: Wilder Randomness - by madsiur - 01-20-2016, 03:25 PM
RE: Patch: Wilder Randomness - by Lockirby2 - 01-20-2016, 03:50 PM
RE: Patch: Wilder Randomness - by Catone - 01-20-2016, 05:11 PM
RE: Patch: Wilder Randomness - by Gi Nattak - 01-20-2016, 05:32 PM
RE: Patch: Wilder Randomness - by Catone - 01-20-2016, 06:28 PM
RE: Patch: Wilder Randomness - by Gi Nattak - 01-20-2016, 06:40 PM
RE: Patch: Wilder Randomness - by HatZen08 - 01-20-2016, 08:20 PM
RE: Patch: Wilder Randomness - by Lockirby2 - 01-20-2016, 10:27 PM
RE: Patch: Wilder Randomness - by Catone - 01-20-2016, 10:02 PM
RE: Patch: Wilder Randomness - by HatZen08 - 01-21-2016, 11:31 AM
RE: Patch: Wilder Randomness - by abyssonym - 01-21-2016, 12:34 PM
RE: Patch: Wilder Randomness - by Catone - 01-21-2016, 04:13 PM
RE: Patch: Wilder Randomness - by HatZen08 - 01-21-2016, 05:17 PM
RE: Patch: Wilder Randomness - by abyssonym - 01-21-2016, 08:32 PM
RE: Patch: Wilder Randomness - by Dev J - 04-28-2017, 11:14 PM
RE: Patch: Wilder Randomness - by HatZen08 - 04-30-2017, 09:41 AM
RE: Patch: Wilder Randomness - by Tenkarider - 04-30-2017, 01:57 PM
RE: Patch: Wilder Randomness - by Gi Nattak - 04-30-2017, 02:42 PM
RE: Patch: Wilder Randomness - by HatZen08 - 05-02-2017, 09:12 AM
RE: Patch: Wilder Randomness - by HatZen08 - 09-17-2017, 12:33 AM
RE: Patch: Wilder Randomness - by Dev J - 09-18-2017, 05:45 PM
RE: Patch: Wilder Randomness - by madsiur - 09-18-2017, 09:40 PM
RE: Patch: Wilder Randomness - by Dev J - 09-18-2017, 11:36 PM
RE: Patch: Wilder Randomness - by madsiur - 09-19-2017, 09:08 AM
RE: Patch: Wilder Randomness - by Gi Nattak - 07-08-2022, 01:47 PM
RE: Patch: Wilder Randomness - by Gi Nattak - 04-17-2024, 02:44 PM

Forum Jump:

Users browsing this thread: 1 Guest(s)


Theme by Madsiur2017Custom Graphics by JamesWhite