Editing
Field map encounter mechanics
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== How it actually works == A procedure is run on every frame on which Cloud moves on any field map. The procedure is as follows: <pre> Add one step fraction. If the current fraction is now zero, and we are on a hostile field, and encounters are enabled: Run Value = Field Scale * (4 if Run is held, 1 if it is not) Danger = Danger + (2 * Run Value / Encounter Rate) x = increment_step_id() If x < Preemptive Rate Preempt Flag = True Else: Preempt Flag = False x = increment_step_id() If x < ((Danger * Enemy Lure Value) / 4096): Set the game so we’re going to enter a battle x = increment_formation() / 4 // Check Special Formations // Back Attack slot 1 If Mastered Preempt Flag is not set: threshold = back attack slot 1 encounter rate Else: threshold = back attack slot 1 encounter rate / 2 If x < threshold: Set battle formation to back attack slot 1 Preempt Flag = False Exit this procedure // Back Attack slot 2 If Mastered Preempt Flag is not set: threshold = threshold + back attack slot 2 encounter rate Else: threshold = threshold + back attack slot 2 encounter rate / 2 If x < threshold: Set battle formation to back attack slot 2 Preempt Flag = False Exit this procedure // Side Attack slot threshold = threshold + side attack slot encounter rate If x < threshold: Set battle formation to side attack slot Exit this procedure // Pincer slot If Mastered Preempt Flag is not set: threshold = threshold + pincer slot encounter rate Else: threshold = threshold + pincer slot encounter rate / 2 If x < threshold: Set battle formation to pincer slot Exit this procedure // Check Standard Formations threshold = 0 x = increment_formation() Current Encounter Slot = standard slot 6 For i from 1 to 5: threshold = threshold + standard slot i encounter rate If x / 4 < threshold: Current Encounter Slot = standard slot i Break out of the loop Set battle formation to Current Encounter Slot encounter formation // Reroll (“Bump”) check If Current Encounter Slot encounter formation == Last Encounter Formation: threshold = 0 x = increment_formation() Set battle formation to standard slot 6 For i from 1 to 5: threshold = threshold + standard slot i encounter rate If x / 4 < threshold: Set battle formation to standard slot i Last Encounter Formation = std. slot i encounter formation Exit this procedure Else: Last Encounter Formation = Current Encounter Slot encounter formation </pre> Procedure increment_step_id: <pre> stepid = stepid + 1 If stepid = 0: offset = offset + 13 Return RNG_TABLE[stepid] - offset; </pre> Procedure increment_formation: <pre> formation = formation + 1 Return RNG_TABLE[formation] </pre> '''Notes:''' * All divisions round down to an integer, as everything here is done with truncating integer arithmetic. * One Step Fraction is actually a unit of 32, so step fractions actually go 32, 64, 96… 224, 0. * Field Scale is a value assigned to each field. Usually it's 512, but it can be larger or smaller. See [https://pastebin.com/UrRQ7ezH] for a list of field scale values. * Run Value isn’t a value calculated at this part of the encounter logic, it’s actually calculated every frame based on whether Run is held or not and is constantly updated even while not moving. * Encounter Rate is a 1-byte value in the current encounter table. Counterintuitively, lower Encounter Rate values mean a higher danger increase per step, and higher Encounter Rate values mean a lower danger increase per step. * Because of the complex interaction between Run Value and Encounter Rate, It’s more useful to think of each screen as having a DIPS value, or Danger Increase Per Step, which is the final value that gets added to Danger per step of running. * For some reason, Preempt Flag actually gets set to a value of 4 to signal True and 0 for False. * In reality, the Preempt Value and Mastered Preempt Flag are combined into a single value, where the most significant bit is the Mastered Preempt Flag and the seven least significant bits are the Preempt Value. * The Mastered Preemptive Flag is weird, see below.
Summary:
Please note that all contributions to Final Fantasy VII Speedrun Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Final Fantasy VII Speedrun Wiki:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
Edit source
View history
More
Search
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Tools
What links here
Related changes
Special pages
Page information