Home  |   What's New  |   Systems  |   Features  |   Boards  |   Help  |   Search
DS | Game Boy Advance | GameCube | PC | PlayStation 2 | Xbox
View Complete List A-Z

 
Final Fantasy III
Message Board
Game Info | FAQs & Guides | Codes & Secrets | Reviews | Check Prices

assassin17 (35): Board List | Topic List | Post New Message | Log Out | Help

My, we've never met like this before.. (aka the evils of RANDOMOSITY)
From: assassin17 | Posted: 10/24/2004 7:28:36 PM | Message Detail
A few months ago, I was flipping through the monster formations with FF3usME, and chuckled when I saw a lone Latimeria couldn't do a Back attack, yet it could Pincer you. Then i thought, "wait, that seems familiar", and set out to duplicate it with my typical test party of Locke, Gogo, Mog, and Shadow. Eight emulator hours later, I was quite miffed after no success. So I decided to figure out what the hell was was happening.

It turns out the game's random number system prevents you from ever encountering monster groups in certain attack formations if you have a certain number of party members. Specifically, Back and Pincer attacks are the victims; Front and Side have large enough probabilities that they can't be fully prevented.

After telling a couple people then just letting the discovery sit for 3 months, I decided to finally make a post.

http://assassin17.home.comcast.net/randomosity.txt

has a list of every possible monster group. "Forced" and "always prohibited" were deciphered ages ago by Lord J or Cless or somebody; RANDOMOSITY is what you want to look at. :)

You'll notice a lot of repetitions, because this behavior is just based on the # of enemies plus the # of characters, rather than *who* the enemies are.

Also, note that you'll never get a Side attack with groups of < 3 party members unless it's forced. I don't bother listing that a billion times in the guide, though my Randomosity calculations do factor it in.

For an explanation of what's happening, see:

http://assassin17.home.comcast.net/00BE-results3.txt

Having never designed my own random number system, I can't really say what's wrong. However, the whole multiplying of Variable $021E (the frame counter, Jyzero tells me) by 4 before putting it in $00BE (the RNG index) seems highly stupid. It takes away THREE QUARTERS of the possible byte values for $00BE.

Thus, the probabilities for enemy encounter formations effectively become M/64 rather than N/255 (where M and N are some numbers). In many cases, this reduction entirely stops a certain sized party from meeting a group of monsters in one -- occasionally two -- arrangements.

This was only tested on FF3us (with all living characters), so I'm definitely interested in whether FF6j and FFA players recall encounters that break my Randomosity "rules." Heck, I could've gone wrong in a number of places, so FF3us players are encouraged to second guess me too. :)

If you're going to test this, be sure not to wear Back Guard.
From: assassin17 | Posted: 10/24/2004 7:45:41 PM | Message Detail
In many cases, this reduction entirely stops a certain sized party from meeting a group of monsters in one -- occasionally two -- arrangements.

oops.. there only seems to be one "random banned" arrangement per party size. typo. ;)
From: Jyzero | Posted: 10/26/2004 6:15:55 PM | Message Detail
It explains why there is a different battle encounter only each 4 frames and only 15 possible initial battle settings.

I still have two question left :

In your first step, you said that the Enemy group has already been picked. When is it picked ?

Second, when and how are preemptive attacks computed ? (Should be 1 out of 8 but sometimes there are none of the 15 possible battle settings that gives preemptive attack.)
From: assassin17 | Posted: 10/26/2004 7:03:14 PM | Message Detail
ooh.. a response! :)

It explains why there is a different battle encounter only each 4 frames and only 15 possible initial battle settings.

what do you mean by "initial battle settings"?


I still have two question left :

In your first step, you said that the Enemy group has already been picked. When is it picked ?


it's picked earlier, in Bank C0, which uses different random number generators than Bank C2. that's why i was able to gloss over it in my description of the RNG steps. see the region around C0/C176 for how a group is chosen from a 4-pack:

http://assassin17.home.comcast.net/c0bank.txt

(some 2-packs are handled around C0/A5B4, which i haven't commented.. this thread discusses their probabilities: http://boards.gamefaqs.com/gfaqs/genmessage.php?board=2000068&topic=16955126)


Second, when and how are preemptive attacks computed ? (Should be 1 out of 8 but sometimes there are none of the 15 possible battle settings that gives preemptive attack.)

see function C2/2E9B in one of these documents:

http://masterzed.cavesofnarshe.com/HackDocs/formodds.txt
http://www.rpglegion.com/ff6/hack/code2.txt

i haven't studied preemptive attacks personally; all i can say is that they're calculated after the attack formation.

do you have any idea why nearly all Side attacks seem to be pre-emptive (or *damn* close to it), even when there's no "Preemptive attack" message? is it intentional, or another side effect of the RNG system?

also, can you think of any advantages to Square's multiplication by 4? there has to be some wisdom behind it.. ;)
From: Imzogelmo | Posted: 10/26/2004 8:37:34 PM | Message Detail
Have you tried removing the *4? I don't see what it would hurt, but it could fix this problem rather handily, iiuc. Of course, I'm just talking, 'cause I haven't studied it as much as you have.

That'd be the best, IMO, but you could add another monkey wrench into the mix if you added a random value to $BE instead of always adding 1. Base it off the VBlank (or some other time-dependent figure) or else you'll just shift the problem (i.e. if you had another random number table, it too would likely have randomosity problems unless it was specifically contrived not to).
---
NEPROMR - http://www.angelfire.com/al2/imzogelmo/patches.html
From: assassin17 | Posted: 10/26/2004 9:58:44 PM | Message Detail
what's holding me back is that i know squat about this frame counter (not even hearing it was a frame counter until two days ago).

apparently, C3/13C8 is responsible for incrementing it and its surrouding variables, and it limits $021E to 1-60 (i had expected 0-255 or 0-63). yes, that means even more encounter formations might be prevented. :/

maybe i can better randomize it by introducing some of those neighboring variables into the calculation..

what sort of values can the VBlank have? will the fact that you have the ominous screen flashing at the start of an encounter somehow make it too predictable? i'm clueless on this topic.
From: assassin17 | Posted: 10/26/2004 10:10:40 PM | Message Detail
afaik, $021B = hours, $021C = minutes, $021D = seconds
From: assassin17 | Posted: 10/26/2004 10:48:04 PM | Message Detail
[This message was deleted at the request of the original poster]
From: assassin17 | Posted: 10/26/2004 10:49:32 PM | Message Detail
well, well.. the third Fixed Die value is Variable $021E MOD 6. if we're right that it's 1-60, that means the third die isn't slanted against you like the first two are! (so the "fixed" dice are actually less fixed overall than the normal ones; go figure)

now i get to enjoy the tedium of verifying it. :|
From: assassin17 | Posted: 10/27/2004 1:30:24 AM | Message Detail
yup; it checks out.

ah, and because the third (i.e. the leftmost) die is so dependent on timing, you'll find it gets a lot of similar results with Offering and/or Genji Glove. for instance, 3 3 4 4 is a mighty common turn. i'm surprised i never noticed a pattern before..
From: SeR | Posted: 10/27/2004 4:25:37 AM | Message Detail
I was trying to work out 'randomosity' myself a couple of weeks ago.
I figured out it was affected by $021E and the number of characters/enemies in the battle before I got bored and left it to rot somewhere in the dark recesses of 'My Documents'.

"Variable $021E (the frame counter, Jyzero tells me)"
*claims the credit for this discovery*
I came to this conclusion after painstakingly observing and analysing the way in which it repeatedly progressed from 1 to 60... 1 to 60... 1 to 60... 1 to 60... 1 to... yeah.

It's primarily used for the game time in the menu, but it seems they decided to use it for other things as well.
(yes, $021B - $021E are hours, minutes, seconds and frames)

"It explains why there is a different battle encounter only each 4 frames and only 15 possible initial battle settings."
That's caused by something unrelated...
For some reason a battle can only start after every 4 frames. Since 60 is perfectly divisible by 4, and the initial state of the battle is generated from the frame counter, you end up with only 15 ways for the next battle to start.
The counter is paused whenever the screen has completely faded out (menu, new area, battle, etc.). This affects the 15 possible values of it at the start of the next battle.
---
http://www.gdward.plus.com/site/
From: assassin17 | Posted: 10/27/2004 2:05:19 PM | Message Detail
I was trying to work out 'randomosity' myself a couple of weeks ago.

out of curiosity (have i mentioned i love "-osities", whether they're words or not? ^__^), what got you interested in it? was it the absence of certain encounter formations, oddities with preemptive attacks, or something else?

the same question goes out to Jyzero.


I figured out it was affected by $021E and the number of characters/enemies in the battle before I got bored and left it to rot somewhere in the dark recesses of 'My Documents'.

ah, see.. there's your problem. i spread my work amongst at least 2 different directories, and none of them are the default Windows ones. ;)


"Variable $021E (the frame counter, Jyzero tells me)"
*claims the credit for this discovery*


haha.. do you two know each other? :)

at any rate, it's *very* cool to see people coming out of the woodwork for this thread. i figured it would have limited interest (besides maybe "Ah, explains what I saw in my playthroughs.."), so this is a pleasant surprise.


"It explains why there is a different battle encounter only each 4 frames and only 15 possible initial battle settings."

That's caused by something unrelated...
For some reason a battle can only start after every 4 frames. Since 60 is perfectly divisible by 4, and the initial state of the battle is generated from the frame counter, you end up with only 15 ways for the next battle to start.
The counter is paused whenever the screen has completely faded out (menu, new area, battle, etc.). This affects the 15 possible values of it at the start of the next battle.


paused? for how long? does the timer actually stop, or does entering a menu/battle just "realign" the frame count that we add 4 to?

thanks to all of you for the info.
From: Wicked Souls | Posted: 10/27/2004 2:07:39 PM | Message Detail
Would it be wrong of me to make a sarcastic comment about how all of this is extremely interesting?

---
"You are an idiot." "Says who?" "Says my magical powers, fool." - hi im jesus666 and SmarterChild
From: assassin17 | Posted: 10/27/2004 2:27:31 PM | Message Detail
[This message was deleted at the request of the original poster]
From: assassin17 | Posted: 10/27/2004 2:36:55 PM | Message Detail
Can I make a sincere comment on how your opinion is highly relevant?

This issue has a widespread effect on gameplay, as you can see from all the entries in randomosity.txt. Haven't you ever thought, "Odd, Jokers never pincer my party of four.. Happy day! I am in great debt to the unseen force that lets me escape the horrid flesh wounds brought by Acid Rain" ??!?

And how many people knew before my post that the third Fixed Die wasn't rigged against you? Exactly.

I would've thought a protege of the great Matthew Lesko could appreciate the importance of numbers. :P
From: Wicked Souls | Posted: 10/27/2004 2:47:43 PM | Message Detail
A simple "yes" would've done just fine.

I'm sorry, but I look at all of this, and all I see is "Blah blah blah NUMBERS!"

---
"You are an idiot." "Says who?" "Says my magical powers, fool." - hi im jesus666 and SmarterChild
From: Zelgaddis | Posted: 10/27/2004 3:04:42 PM | Message Detail
Wicked Souls, I'm absolutely disgusted by your immaturity. You come on this board, after assassin does all this ****ing work, and proceed to just make some stupid-ass blanket statement like:

"I'm sorry, but I look at all of this, and all I see is "Blah blah blah NUMBERS!"

How dare you. Where do you get the nerve? And I QUOTE, from assassin's post earlier in this topic:

"C3/13C8 is responsible for incrementing it and its surrouding variables, and it limits $021E to 1-60 (i had expected 0-255 or 0-63).

You can clearly see from what I've bolded, there is a lot more than just "Blah blah blah NUMBERS!" There are letters, too. Don't you forget that when you're posting on MY message board. There are letters, too. And a dollar sign.
---
Official Yankee-Hater and fan of REAL Baseball
The New York Yankees: Ruining baseball for nearly a century
From: Wicked Souls | Posted: 10/27/2004 3:10:35 PM | Message Detail
Well, I kinda figured that stuff was covered by the "blah blah blah" part.

---
"You are an idiot." "Says who?" "Says my magical powers, fool." - hi im jesus666 and SmarterChild
From: assassin17 | Posted: 10/27/2004 3:25:45 PM | Message Detail
Hey, some topics are destined to be dry.

Simply scrolling through randomosity.txt (a very easy to follow document) will let most people understand the magnitude of the problem. The discussion in this thread is largely just for people who want to explore the "why."

All this offputting "blah blah NUMBERS" may mean very few people know about the third die until it's updated in the Algorithms FAQ. Fine by me.

Since we're on the subject of an American's aversion to numbers, does it bother anyone else how absent they are from political campaigns and debates? We're only talking about the ****** BUDGET, so why explode any poor viewers' heads with *gasp* mention of dollar values? Instead, "better", "bigger", "smaller", "visionary", and "Don't stop thinking about tomorrow! I love your platitudes, Fleetwood Mac!" somehow serve as substitutes for "$143 billion". ...How?!

You just know they're going to color code the national debt sometime soon:

Green - We rollin' in it! Buy pimpin' new rims for Air Force One.
Blue - Congressmen may need to cut back to only 3 mistresses.
Yellow - Turn off the water whilst brushing your teeth (with that toothbrush our shrewd government procured for only $250).
Orange - MC Hammer mocks us ala Nelson Muntz.
Red - Board up your windows, for Switzerland and Brazil have declared a recon war!
From: Jyzero | Posted: 10/27/2004 3:37:49 PM | Message Detail
"Variable $021E (the frame counter, Jyzero tells me)"
*claims the credit for this discovery*

haha.. do you two know each other? :)


If SeR is SprintGod from Nesvideo forums, then yes he deserves the credit.

out of curiosity (have i mentioned i love "-osities", whether they're words or not? ^__^), what got you interested in it? was it the absence of certain encounter formations, oddities with preemptive attacks, or something else?

the same question goes out to Jyzero.


While making my timeattack of FF3, I collected data on frame where I confirm battle vs frame where Terra's gauge is full. My goal was to find a way to get preemptive attacks on every fight. Over 35 pairs of data collected, I didn't get any preemptive fight but I observed a periodicity. SprintGod later told me about the framecounter and everything involved. See the discussion here : http://nesvideos.stc.cx/viewtopic.php?t=602&postdays=0&postorder=asc&start=90

it's picked earlier, in Bank C0, which uses different random number generators than Bank C2. that's why i was able to gloss over it in my description of the RNG steps. see the region around C0/C176 for how a group is chosen from a 4-pack:


When is the RNG of bank C0 called other than for enemy formations ? Is there any action that can be done between 2 fights (like equiping/changing rows, etc.) to change the index of this RNG ?


Second, when and how are preemptive attacks computed ? (Should be 1 out of 8 but sometimes there are none of the 15 possible battle settings that gives preemptive attack.)

see function C2/2E9B in one of these documents:



It looks like preemptive attacks are computed from 4B5A too. I fear it means that if I don't get any preemptive attacks in the 15 possible initial battle settings, I will never be able to get one.
From: Wicked Souls | Posted: 10/27/2004 5:39:26 PM | Message Detail
Maybe all of this would be interesting to me if somebody would just freakin' tell me how they figured out this whole ASM language thing. Everybody throws it around like, "C2 #A023 GSM (01)!!" and I'm left sitting here going, "Um... FF3usME good? Fire bad?"

---
"You are an idiot." "Says who?" "Says my magical powers, fool." - hi im jesus666 and SmarterChild
From: SeR | Posted: 10/27/2004 6:51:32 PM | Message Detail
Gah! I'm useless at explaining stuff...

Maybe an example is in order.
I'll just invent some numbers because I can't be bothered to get some real ones at the moment.
----------
Column 1: Frame # at which a direction is pressed when one step away from a battle.
Column 2: Frame # at which the battle is triggered.
Column 3: Value of the timer ($021E) just before the battle starts.
10000 : 10016 : 11
10001 : 10016 : 11
10002 : 10020 : 15
10003 : 10020 : 15
10004 : 10020 : 15
10005 : 10020 : 15
10006 : 10024 : 19
10007 : 10024 : 19
10008 : 10024 : 19
10009 : 10024 : 19
10010 : 10028 : 23
10011 : 10028 : 23
10012 : 10028 : 23
10013 : 10028 : 23
10014 : 10032 : 27
10015 : 10032 : 27
----------
etcetcetc...
I don't know why this happens, it just does. Possibly something to do with the blur effect.

...

The timer is incremented every frame, except when the screen is blank.
If you go into the menu before entering a battle, the timer will pause in between the fade-out and fade-in effects (7 frames, I think). Leaving the menu does the same (14 frames total). Subtract this number from all the values in the last column to see the effect.

(...and yes, I am SprintGod. HI JYZERO!)
---
http://www.gdward.plus.com/site/
From: assassin17 | Posted: 10/28/2004 1:03:33 PM | Message Detail
thanks to the frame counter info, the files have been updated (previously, i assumed all 0-255 multiples of 4 were valid). it affects its share of formations; the new randomosity.txt is about 5.5KB bigger than the older.

also, the above links are *dead*. this documentation is now with the rest of the guides on my sites:

http://www14.brinkster.com/assassin17/
http://assassin17.home.comcast.net/
From: mnrogar | Posted: 10/28/2004 10:37:14 PM | Message Detail
Maybe all of this would be interesting to me if somebody would just freakin' tell me how they figured out this whole ASM language thing. Everybody throws it around like, "C2 #A023 GSM (01)!!" and I'm left sitting here going, "Um... FF3usME good? Fire bad?"

I know how you feel, people are not very forthcoming with those kinds of links or any sort of help on that subject.:( I believe there are ASM tutorials some place...
---
www.mnrogar.com - updated sept 8th with brand new message boards!
From: Hollywood Narrator | Posted: 10/29/2004 12:58:53 AM | Message Detail
Really cool guide! Almost as fun as collecting MMA.

;< . <
;> . >

I never knew there were so many unused formations. I guess I never paid enough attention during my FFusME sessions.

Assassin, did your old topic get deleted? It looks to be so, and this makes me :((

By the way, which of the two Umaros is the one you actually face in battle? Been wondering about this... But for all I know, an FAQ mentioned it and I now look stupid.
---
Still the road keeps on telling me to go on/Something is pulling me/I feel the gravity of it all ~Wolf's Rain~
From: assassin17 | Posted: 10/29/2004 2:07:50 AM | Message Detail
what's MMA?

naw, the topic's still there.. i just didn't post this update in it yet because it has its own thread.

i'm pretty sure it's Umaro #272, because that's the only one in ZED's Monster Guide to have a location given. who knows what was intended for #271..
From: mnrogar | Posted: 10/29/2004 2:45:48 AM | Message Detail
Marked Message Accuracy
---
www.mnrogar.com
From: assassin17 | Posted: 11/1/2004 1:41:36 AM | Message Detail
So now the question is: how does one fix this mess? I was thinking of using the bottom two bits of the Second count to allow for more indices, but will that drive you speed runners up the wall because you see the world in milliseconds? :)
From: Django Kagato | Posted: 11/5/2004 9:12:00 AM | Message Detail
By the way, which of the two Umaros is the one you actually face in battle? Been wondering about this... But for all I know, an FAQ mentioned it and I now look stupid.

I may be remembering wrong, but I think it's "both". During the battle after some rounds he uses a Green Cherry to raise his stats.. I believe this is actually accomplished by switching Umaro for the one with higher stats.
---
Believing a sign of Zeta -
http://www.operationz.tk/
From: jerrik | Posted: 11/5/2004 9:13:28 PM | Message Detail
I've never thought about it in such great depth. How does it work to be pincered by one person?
---
"You do that eyebrow thing unconciously, I think. It's weird."-Laura
From: assassin17 | Posted: 11/9/2004 4:00:52 PM | Message Detail
The sight of one enemy pincering is much like the sound of one hand clapping. Now ponder that as the autumn breeze blows overhead, grasshopper.. ;)

it's just like when you're pincered by multiple enemies: your party ends up in the middle, and the enemy is on the side of the screen. in this case, you won't be stopped from running by the alleged surrounding; it works just as if you defeated one side of a conventional pincer.

curiously, there are only two groups in the game that prohibit Back attack without forcing a certain encounter type: lone Latimeria and lone L.90 Magic. those both allow Pincer (along with Front and Side). makes me wonder whether Square checked the wrong box or something. or maybe it was done just to underscore that certain enemies are really sneaky.

this could make for good spoof material: "Trapped like rats, you be! Nowhere to run, nowhere to hide! Yess.. you are more smothered than the brothers who bear that very surname." *party looks quizically over their shoulder at the Utah Salt Flats*
From: Alex Jackson | Posted: 11/9/2004 4:27:44 PM | Message Detail
Interesting thread. I don't know how many people here are familiar with Romancing SaGa 3, but it suffers from exactly the same not-so-random number malaise as FF6.

The effects of the problem in RS3 are somewhat more severe, however. In RS3, the RNG gets set to a limited range of states before the enemy formation is determined. This results in quite a few monsters that are supposed to be "rare" but actually never appear at all!

---
To get what is not yours is the steal.
From: Djibriel | Posted: 11/10/2004 6:46:57 AM | Message Detail
Umaro # 271 (the first) was never used in the game. It being at level 14, the best bet I can give you is that it was meant to be obtained in the WoB as well, probably somewhere between completeing the Thamasa scenario and the FC.
---
To also make wourire, if that is possible, if they lend themselves to the play and if this task is with range of our forces.
From: assassin17 | Posted: 11/10/2004 8:29:17 AM | Message Detail
The effects of the problem in RS3 are somewhat more severe, however. In RS3, the RNG gets set to a limited range of states before the enemy formation is determined. This results in quite a few monsters that are supposed to be "rare" but actually never appear at all!

dang, that's bad. :) do those enemies hold any rare items or techniques that are hard/impossible to get elsewhere?

since you're into hacking and you've dealt with Randomosity in other forms, have you thought of any ways to fix it?

the best i've come up with in FF6 so far is to use 2 bits of the Second count along with the Frame count, which raises the possible RNG indices to 240. however, using seconds may not be desirable for Speed runners or people who reload from save states a lot.
From: Boco47 | Posted: 11/10/2004 11:11:53 AM | Message Detail
however, using seconds may not be desirable for Speed runners or people who reload from save states a lot.

But we who do such things only do them on unmodified versions, and the more bugs and glitches we can exploit to our advantage in doing so the better.
So if a solution works for casual play but not tools-assisted play, keep in mind that the TAS community frowns on hacked versions as source material anyway.

---
someone is out there who will like you. take off your mask so they can find you faster.
Protest slaughter of Cyber Elves! http://www.livejournal.com/users/boco
From: Alex Jackson | Posted: 11/10/2004 1:06:43 PM | Message Detail
since you're into hacking and you've dealt with Randomosity in other forms, have you thought of any ways to fix it?

Err... rip out the lame table altogether and replace it with a real pseudo-random-number generator? That's pretty much the only way to fully fix the many, many RN-related problems RS3 and RS2 have. Might be overkill for FF6 but it wouldn't hurt :)

If you want to go code scavenging, I think the Dragon Quest games use a real PRNG rather than a table, and I seem to recall reading that the Apple II Ultimas use a really good PRNG...

---
To get what is not yours is the steal.
From: assassin17 | Posted: 11/11/2004 7:27:49 AM | Message Detail
Hmm.. now I'm thinking of sticking an "INC new_byte_variable" into the function that handles incrementation of the Frame/Second/Minute/Hour counters. This custom variable will essentially be a 0-255 frame counter.

It won't address the "battle can only start after every 4 frames" issue SeR kindly explained, but it will mean a full byte's range of RNG indices are used when you look at enough battles.

Now to find 3 bytes in C3/13C8. :)
From: assassin17 | Posted: 11/12/2004 11:11:19 AM | Message Detail
ah, i cut 4. 8-)

for you hardware gurus: is changing accumulator size with REP/SEP during an interrupt prohibited? i just wanna be sure, as this is new territory for me.

also, are there any RAM bytes that are free both in and out of battle?
From: Alex Jackson | Posted: 11/12/2004 11:35:33 AM | Message Detail
for you hardware gurus: is changing accumulator size with REP/SEP during an interrupt prohibited? i just wanna be sure, as this is new territory for me.

Just make sure that every PLA gets executed with the M flag in the same state that the corresponding PHA was executed with. The same for PLX/PLY and the X flag (of course)

Don't worry--if you mess this up, you'll find out very quickly :)

---
To get what is not yours is the steal.
From: assassin17 | Posted: 11/20/2004 6:19:34 PM | Message Detail
i hear ya. :)

Copyright ©2004 CNET Networks, Inc. All Rights Reserved. Privacy Policy | Terms of Use About CNET Networks