Punch Glitch: Difference between revisions
No edit summary |
No edit summary |
||
Line 5: | Line 5: | ||
<blockquote> | <blockquote> | ||
''The issue is the <code>acos</code> in <code>logic-target.gc</code>. In PCSX2/PS2 it can never quite return 0.0. But on PC it does, and it causes <code>0/0</code> instead of <code>0/very-small-number</code>. This is used as the input to a slerp and it ends up setting the output quaternion to 0 0 0 0. Over the next 2 frames, this completely breaks the dir-targ and unknown-quaternion00 and the target/camera rotation matrix ends up being identity. This sudden change rotates jak's velocity so it is entirely in the global x direction.'' | ''The issue is the <code>acos</code> in <code>logic-target.gc</code>. In PCSX2/PS2 it can never quite return 0.0. But on PC it does, and it causes <code>0/0</code> instead of <code>0/very-small-number</code>. This is used as the input to a <code>slerp</code> and it ends up setting the output quaternion to <code>0 0 0 0</code>. Over the next 2 frames, this completely breaks the <code>dir-targ</code> and <code>unknown-quaternion00</code> and the target/camera rotation matrix ends up being identity. This sudden change rotates jak's velocity so it is entirely in the global x direction.'' | ||
''My understanding is that this should only happen when the dir-targ aligns with jak's velocity exactly. It may only be catastrophic if the camera is also aligned so that pushing forward on the stick will move jak in this direction.'' | ''My understanding is that this should only happen when the dir-targ aligns with jak's velocity exactly. It may only be catastrophic if the camera is also aligned so that pushing forward on the stick will move jak in this direction.'' |
Revision as of 00:51, 19 February 2024
Punch glitch is a bug that is exclusively encountered on the PlayStation 3 Jak and Daxter Collection.
Technical
During the development of the PC port for Jak and Daxter: The Precursor Legacy, it was discovered that punch glitch was occurring.
The issue is the
acos
inlogic-target.gc
. In PCSX2/PS2 it can never quite return 0.0. But on PC it does, and it causes0/0
instead of0/very-small-number
. This is used as the input to aslerp
and it ends up setting the output quaternion to0 0 0 0
. Over the next 2 frames, this completely breaks thedir-targ
andunknown-quaternion00
and the target/camera rotation matrix ends up being identity. This sudden change rotates jak's velocity so it is entirely in the global x direction.My understanding is that this should only happen when the dir-targ aligns with jak's velocity exactly. It may only be catastrophic if the camera is also aligned so that pushing forward on the stick will move jak in this direction.
I don't think the location has anything to do with it. It's possible that it only happens on ground that's perfectly level but I don't know. Instead, I think it tends to happen in places where people are lined up well with the camera and punching in/out of the camera exactly.
- Water111
The following code was added to acos
in trigonometry.gc
to fix the problem:
(defun acos ((arg0 float)) "Inverse cosine. Returns rotation units" (let ((result (- 16384.000000 (asin arg0)))) (#when PC_PORT ;; to avoid punch glitch: ;; (note: it might be a better fix to change the global rounding mode, ;; but it's not super clear to me that the mode picked by PCSX2 is ;; more accurate than normal in all cases. So, we'll do this for now.) (when (= result 0.0) (set! result 0.00000000001) ) ) result ) )
Discovery
Other Notes
Glitches, Bugs, Exploits, and Secrets | |
---|---|
Jak and Daxter: The Precursor Legacy | Audio Pause Glitch • Bridge Blast • Dark Glitch • Developer Pictures • Dupe State • Flut Flut Escape • Game Crash • Ghost Glitch • Hard Fish • Idle Deload • Line Glitch • Moon Walk • Orb Duplication Glitch • Pause Buffer • Punch Glitch • Statue Glitch • Void Out • Walking While Talking • Zombie Glitch • Zoomer Escape |
Jak II | Developer Pictures • Game Crash • Ghost Town • Invisibility Glitch • Invulnerability Glitch • Line Glitch • Orb Duplication Glitch • Pause Buffer • Peacemaker Stacking • Punch Glitch • Statue Glitch • Zombie Glitch |
Jak 3 | Developer Pictures • Game Crash • Invisibility Glitch • Invulnerability Glitch • Line Glitch • Orb Duplication Glitch • Peacemaker Stacking • Punch Glitch • Statue Glitch • Zombie Glitch |
Jak X | Line Glitch |
Daxter | placeholder text |
Jak and Daxter: The Lost Frontier | placeholder text |