Author Topic: Encounter Data, Round Two  (Read 3629 times)

Synergy Blades

  • Guest
Encounter Data, Round Two
« on: 2006-10-09 17:19:19 »
I'm not sure if this is common knowledge but I thought I'd put it out there anyway for those interested. Thanks to Cyb looking at the train graveyard I had another look at the script for it and noticed a BTLTB sandwiched between an if-check on the PPV. Thinking about what it could be I did a check & it seems there's some interesting stuff on the Encounter Data in Section 7. For The Saint's existing guide to this, try here.

Turns out you can have two sets of encounter data per field, if needed. The format for the second set is, as far as I can tell, identical to the first, with the same base values, and you can even set different encounter rates for the second set. If you don't specify anything in the script, the first set of encounter data is used, as normal. However, if you use a BTLTB (-> Battle Type B) with the argument set to 1, you will switch to the second set of encounter data. This allows, for example, the player to be able to go through the same field again (such as the train graveyard) and face harder enemies than the first time they went through - all by checking the plot progression variable then using a BTLTB as appropriate. Of course, you can switch back to the first with BTLTB(0).

Which is all good, 'cept I've got to redesign my Encounters tab now.  :lol:

So here's the structure for the whole section:

Code: [Select]
U32 section_length; // 0x30
U8 enc_enabled_A;
U8 enc_rate_A;
U16 standardEncounter_A[6];
U16 lowProbEncounter_A[4];
U16 unknown;
U8 enc_enabled_B;
U8 enc_rate_B;
U16 standardEncounter_B[6];
U16 lowProbEncounter_B[4];
U16 unknown;

If The Saint is right and you can have only four low prob. encounters, I'm not sure what the unknown U16s are.

Lists of fields using the BTLTB opcode (and hence having two sets of data):

blin68_1: (dir,1)
blin68_2: (dir,1)
junair: (dir,1)
junone2: (dir,1)
mds7st2: (init,1) (init,1)
mtnvl2: (dir,1)
mtnvl3: (dir,1)
mtnvl4: (dir,1)
mtnvl5: (dir,1)
mtnvl6: (dir,1)
mtnvl6b: (dir,1)
nmkin_2: (dir,1)
nmkin_3: (dir,1)
nmkin_4: (dir,1)
nmkin_5: (dir,1)
nvdun1: (dir,1)
nvdun2: (dir,1)
nvdun3: (dir,1)
nvdun4: (dir,1)

Hope that's informative to somebody.  :-D

Cyberman

  • *
  • Posts: 1572
    • View Profile
Re: Encounter Data, Round Two
« Reply #1 on: 2006-10-10 06:26:06 »
Hmmm this explains why the encounters you get after blowing up Reactor 1 when you go into this area are different then when you attempt to get to sector 7 again later on.

There are 3 times you can enter this area in the plot.
Return from Reactor 1.
Going to Reactor 5.
and
Getting to Sector seven.

In the first set of encounters you get almost exactly the same (if not the same) encounters you had in the reactor. Minus the Roboguards I believe (or with them I need to check that).
The second one you get weak enemies and mostly this strange death figure on a chariot (easy to beat), that silences people.
The third one you get a lot tougher enemies period.

Cyb

halkun

  • Global moderator
  • *
  • Posts: 2097
  • NicoNico :)
    • View Profile
    • Q-Gears Homepage
Re: Encounter Data, Round Two
« Reply #2 on: 2006-10-10 06:51:02 »
This, I think, is also may have something to do with  first argument in the BATTLE() command. You can select which encouter table with the first argument and then which battle?

Anyone want to verify that?

(I might be totally off here, doesn't BATTLE ignore the encounter table and outright loads the battle module explicitly?)
« Last Edit: 2006-10-10 06:54:51 by halkun »

Synergy Blades

  • Guest
Re: Encounter Data, Round Two
« Reply #3 on: 2006-10-10 11:18:08 »
Yeah, BATTLE uses a battle ID, completely bypassing the encounter data. Have you checked whether it's just a standard bank/address pairing?

[Edit] As I thought, it's a 16-bit bank/address affair. I've edited the Wiki.
« Last Edit: 2006-10-10 11:35:32 by Synergy Blades »

Akari

  • *
  • Posts: 766
    • View Profile
Re: Encounter Data, Round Two
« Reply #4 on: 2006-10-19 10:14:55 »
Hmm. I start working on Random encounter and have some small question.
1) The enc_rate - is how ofter battle appeares on field?
2) The Encounter info (2 bytes) seems have two part.... first 6 bit is probability of this encounter (almost always sum of all values is 0x100) and next is scene number (10 bits - 1024 value). Am I right?

Quote
If The Saint is right and you can have only four low prob. encounters, I'm not sure what the unknown U16s are

This seems to be aligment. Data readed by four bytes.

Cyberman

  • *
  • Posts: 1572
    • View Profile
Re: Encounter Data, Round Two
« Reply #5 on: 2006-10-19 14:44:29 »
This seems to be aligment. Data readed by four bytes.
Oh yes, that means the data is directly loaded into the PS1's memory. This is also seen in all the PS1's graphic data.  The padding bytes (mutter) for alignment (mutter), always bring about the U??? variables ;)

Cyb

Akari

  • *
  • Posts: 766
    • View Profile
Re: Encounter Data, Round Two
« Reply #6 on: 2006-10-20 13:46:27 »
Some info about encounter mechanics can be found here.
http://db.gamefaqs.com/console/psx/file/final_fantasy_vii_enemy_mech.txt