• Topic Archived
You're browsing the GameFAQs Message Boards as a guest. Sign Up for free (or Log In if you already have an account) to be able to post messages, change how messages are displayed, and view media in posts.
  1. Boards
  2. Final Fantasy
  3. Step calculation algorithm

User Info: DeeKayFry

12 years ago#1
Hmmm, surprised to still this game is #1 on the NES board. Even after ten years, the more things change the more things stay the same.

Anyway, there is some kind of step algorithm on when battles will occur. Where do I find this? ^_^

Paulygon, I think you, patbuns, and discho figured it out along with myself.

User Info: In2DaBMage

12 years ago#2
Yay,the return of another old FF board vet!

None of the above mentioned vets are here to give you said list,so sorry,cant help you there.
Regina OnionKids: Gunning for the championship in 08-09......
Next Game: TBD

User Info: DragonAtma

12 years ago#3
IIRC they pick a random number from 128 to 256 (or 64 to 256?) and decrease it a fixed value every step depending on the terrain. It's 0 for lcoations without random battles (inside towns, spiked squares, damaging lava, etc.), and I think it's 2 for sea/grass/plains and 5 or 6 for everything else. When it reaches 0, a battle is triggered. After that, it grabs a new random number.
Nagas on a plane! ^_^

User Info: Melirune

12 years ago#4
DeeKayFry? Nooooo wayyyyy!

I remember you.
BIG AWESOME DRAGON Coming soon to store shelves near you.

User Info: anomiex

12 years ago#5
(Original NES version, of course:)
When you take a step on a tile where random battles may occur, the game gets the next "random" number (0-255) and compares it to a particular value depending on where you are: 10 for walking/canoing on the world map, 3 for sailing, or the value from the table beginning at 0x2cc11 for an 'interior' map (these are mostly 8). If the "random" number is less than the particular value, you get a battle.

The "random" number is not really even close to random. The table is at ROM offsets 0x3f110-0x3f20f. The game stores the current index into this table at RAM address $f5, and a "direction" indicator in the high 3 bits of $f6. $f5 is incremented/decremented based on the high bit of $f6, and each time $f5 hits 0 it adds 0xa0 to $f6. Thus, the full sequence of "random" numbers runs through the table from indexes 00->ff, 00, ff->01, 00->ff, 00, ff->01, 00, ff->01, 00->ff, 00, ff->01, 00->ff. The game does not save $f5 or $f6 or clear RAM on power on, so the starting index in the sequence when the NES/emulator is turned on depends on what random values uninitialized RAM holds.

The only reason this "works" in the game is because the sequence of values in the table guarantees a reasonable minimum and maximum steps-between-encounters for any encounter rate actually used in the game. It's probably also why some remakes have b0rken encounter rates, where you can easily hit a second battle the instant you step away from the first and you can have very long runs without encounters: they changed the "random" number generator to something more random, but didn't fix the formula to be something like DragonAtma thought it was.

See also:

User Info: DragonAtma

12 years ago#6
I stand corrected. Maybe I was thinking of another game?
Nagas on a plane! ^_^

User Info: silktail

12 years ago#7
Maybe I was thinking of another game?

That was how it was believed to have worked before the data was researched.

Note: I can't remember who did the first research on this, I just remember them counting the steps manually in each location.
(Although kingshriek was the first person who I saw, finding and post the actual table from the code. Despite lacking the location values.)

Here's a cut and paste of the table with Paulygon's highlighting low values.
24 (18hex) is for Tiamat's floor in the Floating Castle, which is all those highlighted.
Numbers lower 0A would be the world map. Etc, etc.

1F A6 DE BA CC 12 7D 74 1B F3 B4 88 F8 52 F4 07
90 AB B3 BD AA 55 28 BC 8A 6D 0E C4 83 A9 3B 76
20 7C 09 92 FD 4A A8 F0 61 E3 F2 69 6C BB 38 C3
AE B7 43 84 78 23 7B 9B 2D DB 3E 91 CF 02 2A B6
86 EE 9C 8E B8 6F 1A 57 05 E9 73 31 D2 D9 1D FB
94 9D B1 0A 3A 11 5A 47 95 2C 44 E0 6A 8C 5B 7A
A7 5D 36 70 E5 C7 49 DC 68 97 D8 66 A3 0F B0 9F
03 D6 77 16 13 30 25 3C 10 17 AD 98 6B 2F D7 A1
FF A4 EB 51 FE 27 8D 93 D5 3D F6 08 75 E1 A5 46
63 F5 4D DA 32 AF 40 37 D3 C0 89 67 06 21 6E 81
B5 A0 4F 0C 2E E7 1C 58 85 E8 59 CE 35 CB 1E C6
2B 9A E6 DD F1 EC 96 CA AC 00 50 C9 4C FC 14 7E
56 80 D0 79 BF 29 87 48 24 19 C5 22 71 7F 72 0D
CD 8F BE 3F 9E 34 ED 53 54 04 62 A2 C2 41 5E 82
4B 26 5C 42 65 99 4E 60 8B F7 0B 33 DF D1 64 C8
C1 01 EF F9 FA E4 5F 18 B9 B2 39 D4 15 E2 EA 45


User Info: DeeKayFry

12 years ago#8
The more things change the more they stay the same.

My question has been answered. Thank you.

User Info: DeeKayFry

12 years ago#9
Silk, YOU helped Sqpat17 along with myself and discho map out the encounter table.

I am leery of saying this, but I posed the question to make it on topic :P

Anyway, it is really great to see all of you.

Where is Fox at?

Forgive me for some of my mispelling, I did not only stop going to FF I board, I stopped Gfaqs for several years except to check FAQs for various games I was playing.

I see Silktail, Melirune, Paulygon, In2bdmage.

I will browse through the topics, but what is going on with stuff like ULLG, Solo white mage ULLG, anyone do a Thief ULLG?

Any new ground breaking discoveries?

I have a lot of catching up to do :)

What brought me back to this board is I am playing FF III on the DS, and I had thought about this board and figure four or five years is too long.

User Info: DragonAtma

12 years ago#10
umm... I did some looking at ogre battle on the snes board, does that count?
Nagas on a plane! ^_^
  1. Boards
  2. Final Fantasy
  3. Step calculation algorithm
  • Topic Archived

GameFAQs Q&A