Remote linking to avatars
Do not link to Suikosource images on forums, webpages, or anyplace else. If you wish to use the images, place them in your own webspace. We do not allow you to use them from our server.
Eilie can cause the hero's HP to become 0 out of battle, if she hits him with a knife.
Knife-thrower Glitch
Bug Details
System(s) Playstation,
PSP,
PSN (POPS)
Bug TypeGameplay
Region Introduced
Patch Version2.01.065b

Regions Affected
Early in the game, you meet Eilie and her siblings as they are performing in Ryube. She uses the Hero as a hesitant volunteer in her knife-throwing act. Every time she is about to throw, the player is given the option to keep the hero still, or to move him a hair to the left or the right. If you ever choose to move, she will hit the Hero with her throw, and the event will end. When this happens, your character's hit points are approximately halved, but if he has only one hit point, the value will become zero.

This is the only time it is possible for a character to have zero hit points outside of battle. Without resting, the Hero will go into subsequent battles alive, but with zero hit points. There do not seem to be any detriments to the bug. He will die normally if attacked, and his hit points will be set to one after battle. This bug is more of an oddity, than a hardship on the player.

Cause
The problem lies in the game utilizing code that should probably only be used during battles as part of an out-of-battle script. There is a multipurpose function for dealing with stats that is called when Eilie hits the Hero. The arguments passed will cause a character's current hit points to be halved. Since this is potentially useful in battle, the halving needs to be done so that zero can result, i.e., when hit points are 1, zero should be the result rather than one. As such, Konami used the integer quotient of division as the resultant HP, rather than taking half, and subtracting that from the original value.

During these events, code written for the purpose should have been used, so that the hit point value cannot become zero. Below is the relevant fragment of the multi-purpose routine, taken from the main executable.

TEXT:800730E4                 lhu     $v0, 0x872($v1)
TEXT:800730E8                 nop
TEXT:800730EC                 div     $v0, $a1
....
TEXT:80073114
TEXT:80073114 loc_80073114:                            # CODE XREF: MngCharaStat+F8j
TEXT:80073114                                          # MngCharaStat+100j
TEXT:80073114                 mflo    $v0
TEXT:80073118                 j       loc_8007320C
TEXT:8007311C                 sh      $v0, 0x872($v1)

Most of this routine involves finding the address of the character, and checking for exceptions like Divide By Zero. Those sections of the code have been removed.

The code that calls it is located in /CDROM/020_ARB/VB18.BIN.

RAM:8010DCA0                 li      $v1, 0x80073008
RAM:8010DCA8                 li      $a0, 3
RAM:8010DCAC                 li      $a1, 2
RAM:8010DCB0                 sw      $v1, dword_8015B238
RAM:8010DCB4                 move    $s1, $v0
RAM:8010DCB8                 li      $a2, 1
RAM:8010DCBC                 jalr    $v1
RAM:8010DCC0                 addiu   $a3, $sp, 0x10

Fix
The calling code in the BIN file is hard-coded to both halve hit points and to do so only to the Hero. As such, it can be easily replaced with code that does exactly that, and prevents his hit points from dropping below 1.

; Suikoden II Eilie Script Fix
; Written by Pyriel
.psx
.createfile eilie_fix.bin, 0x8010DCA0
.align 4
 
eilie_fix:
    lui v1, 0x8007
    lhu a0, 0x9896(v1)        ;load hero's current HP
    addu s1, zero, v0        ;preserved from previous code
    srl a0, a0, 1            ;shift hit points right by 1 (divide by 2)
    bne a0, zero, store        ;if hit points not zero, store
    nop
    addiu a0, zero, 1        ;set to 1 if zero
    nop
 
store:
    sh a0, 0x9896(v1)
 
.close