Changes

Jump to navigation Jump to search

FF7/Field/Encounter

2,262 bytes added, 05:14, 23 May 2019
m
13 revisions imported
=== Section 7 ([[User:Terence Fergusson|Terence Fergusson]]) = Overview ==
As stated, Section 7 is The encounter section provides encounter data for the Encounter listing, field by referencing [[FF7/Battle/Battle_Scenes|battle IDs]] and is generally 48 bytes long (not including the Length dword)providing probabilites for each type of encounter required. IThe section consists of two ''ve not even started to decrpyt what the other bytes mean around there... I suspect encounter rates and other thingstables'' that hold sets of these battle configurations; these tables may be switched between using field scripting. Each The two encounter is stored something like: xxxxxxxx yyyyyyxx, where the 'x's tables are the standard Battle ID we're familiar with, contiguous and follow directly after the 'ysection's are something connected length description; due to that specific the presence of the two encounter. Encounters where you can get ambushed appear to be held seperately from tables regardless of whether they are used or not, the others, too, starting at... what... 0x14? Unsuresection length is always 48 bytes.
First, every Field file's Encounter section is 48 bytes long (52 if you include the size). It's then split into definite partitions: struct SECTION_ENCOUNTER { u32 section_length; /* 0x30 */ ENC_TABLE tables[2]; };
0x00: <br /> == Encounter Data Table Structure ==  struct ENC_TABLE { u8 enabled; u8 rate; ENCOUNTER enc_standard[6]; ENCOUNTER enc_special[4]; u16 _pad; } The first byte of the table provides a switch to signify whether this table is used or not. If set to ''0'' encounters will not be used, regardless of the table contents; ''1'' signifies the table will be used. The second byte signifies the main encounter rate, possibly enounter rate in 2nd bytes? and ranges from 0xFF (2 bytesbattles occur infrequently)0x02-0x0D: Encounter+Chanceto 0x01 (?battles occur very frequently) bytes. 0x00 value causes a division by zero. Following these are the ten encounter structures; these are divided into two groups of six and four, as stated beforedetailed below. There is also a further two-byte "padding" value, used for alignment. === Switching Between Tables === The total purpose of two tables is to allow the scripting system to switch between a choice of two sets of encounter data. This is used in-game to allow two levels of difficulty within one field, so that if the player revisits an area in a later part of the 'Chancegame (?such as areas of Midgar)' bytes for this part always adds up to 64 if , the enemies will be suitably more difficult. This can be implemented by placing "easier" encounters are possiblein the first table, harder encounter IDs in the second table, and switching appropriately (perhaps by checking the Plot Point Variable).0x0E-0x17: Secondary encounters. Sometimes blankTables are switched between by simply passing a 0 or 1 to the [[FF7/Field/Script/Opcodes/4B_BTLTB|BTLTB]] opcode, sometimes gapsrepresenting the required table. No clue on The first table is the chance bytesdefault if no BTLTB opcode is specified; either table may be empty, or how it relates but if switched to previous using BTLTB, encounters will be deactivated as there will be no encounter dataset for that table.0x18: == Encounter Data 2, same setup as Encounter Data 1Structure ==  struct ENCOUNTER /* pseudo */ { bit prob[6]; bit encounter_id[10]; }  // Create from two-byte value u16 enc_entry; /* holds the read value */ u8 prob = enc_entry &gt;&gt; 10; u16 encounter_id = enc_entry &amp; 0x03FF; Each individual two-byte encounter entry is further split into two groups of bits. Very often blank The first six bits denote the probability for this encounter; the sum of all the probabilites for the standard encounters is 64, no idea what though this data is not the case forthe special battles. 0x1A-0x25For further information on how encounter probabilities are used and calculated, Terence Fergusson's [http: Encounter+Chance(?) bytes for Encounter Data 2//db.gamefaqs.com/console/psx/file/final_fantasy_vii_enemy_mech.txt Battle Mechanics Guide] contains detailed information. Again, adds up to 64 The second ten bits denote the [[FF7/Battle/Battle_Scenes|ID]] of the battle. 0x26-0x2F: Secondary encounters for === Encounter Data 2Entry Types === The set of ten battles is split into two groups. AgainThe first six battles are generic battles, no idea what it's used intended forgeneral use, whose probabilities must total 64.The final four battles are intended to be used in the following order: * Back Attack 1* Back Attack 2* Side Attack* Attack From Both Sides

Navigation menu