Title: Docile NPCs Author: SilentEnigma Version: 1.0 Release Date: 2020-04-18 Applies to: Final Fantasy III (v1.0) (U) Contents: DocileNPCs-H.ips = the patch for headered ROMs DocileNPCs-NH.ips = the patch for non-headered ROMs readme.txt = this file ROM Addresses: C0/7BB9 - C0/7BBB Free space used: C0/DB00 - C0/DB48 (49 bytes) ________________________________________________________________________________ TABLE OF CONTENTS 0. Description 1. Relevant Offsets & Disassembly 2. Revision History ________________________________________________________________________________ 0. DESCRIPTION This is a quality-of-life mod for FF3/6 SNES which makes wandering NPCs more readily yield ground to the player character. In the original game, wandering NPCs have a tendency to be ever so slightly a pain in the neck to get around. Most noticeably, if the player tries to move into a tile that an NPC is exiting, the player may be out of luck if the NPC decides to move back into the same spot. Now, whenever the player character and an NPC are simultaneously attempting to move into the same empty field map tile, the player character is given priority, and the NPC's move is canceled. This should make navigating though crowded spaces a bit less of a struggle. ________________________________________________________________________________ 1. RELEVANT OFFSETS & DISASSEMBLY Original: C0/7BB9: 20 03 7D JSR $7D03 Modified: C0/7BB9: 4C 00 DB JMP $DB00 ; Jump to new subroutine C0/DB00 New Subroutine C0/DB00: C0/DB00: 20 03 7D JSR $7D03 ; Originally at C0/7BB9 C0/DB03: AE 03 08 LDY $0803 ; Player character info C0/DB06: A9 29 LDA #$29 ; Divisor C0/DB08: 8E 04 42 STX $4204 C0/DB0B: 8D 06 42 STA $4206 C0/DB0E: EA NOP ; Wait for divide C0/DB0F: EA NOP C0/DB00: EA NOP C0/DB11: EA NOP C0/DB12: EA NOP C0/DB13: EA NOP C0/DB14: EA NOP C0/DB15: AD 14 42 LDA $4214 ; X / A = Player character I.D. C0/DB18: 0A ASL A ; ...multiply by 2 C0/DB19: A6 1E LDX $1E ; NPC's target tile offset C0/DB1B: DF 01 20 7E CMP $7E2001,X ; Is player one tile east of NPC's target? C0/DB1F: D0 04 BNE $DB25 ; Branch if not C0/DB21: A9 02 LDA #02 ; I.D. for button press Left C0/DB23: 80 1C BRA $DB41 ; Branch to button test C0/DB25: DF FF 1F 7E CMP $7E1FFF,X ; Is player one tile west of NPC's target? C0/DB29: D0 04 BNE $DB2F ; Branch if not C0/DB2B: A9 01 LDA #01 ; I.D. for button press Right C0/DB2D: 80 12 BRA $DB41 ; Branch to button test C0/DB2F: DF 00 21 7E CMP $7E2100,X ; Is player one tile south of NPC's target? C0/DB33: D0 04 BNE $DB39 ; Branch if not C0/DB35: A9 08 LDA #08 ; I.D. for button press Up C0/DB37: 80 08 BRA $DB41 ; Branch to button test C0/DB39: DF 00 1F 7E CMP $7E1F00,X ; Is player one tile north of NPC's target? C0/DB3D: D0 07 BNE $DB46 ; Branch if not C0/DB3F: A9 04 LDA #04 ; I.D. for button press Down C0/DB41: 24 07 BIT $07 ; Mapped controller input C0/DB43: F0 01 BEQ $DB46 ; Branch if matching button is not pressed C0/DB45: 60 RTS ; Skip this NPC move C0/DB46: 4C BE 7B JMP $7BBE ; Allow this NPC move ________________________________________________________________________________ 2. REVISION HISTORY 2020-04-18 : Version 1.0 released. ________________________________________________________________________________ Copyright (C) 2020 David R. Thompson (SilentEnigma). The copyright holder ("author") permits the free use of the attributed work referenced by this document exclusively for non-commercial purposes, provided that the following conditions are met: 1. This readme document shall accompany the attributed work wherever it is redistributed. 2. The author shall be credited wherever the attributed work referenced by this document is reused, redistributed, or modified.